diff --git a/packages/qobserva/dist/qobserva-0.1.5-py3-none-any.whl b/packages/qobserva/dist/qobserva-0.1.5-py3-none-any.whl new file mode 100644 index 00000000..b730699b Binary files /dev/null and b/packages/qobserva/dist/qobserva-0.1.5-py3-none-any.whl differ diff --git a/packages/qobserva/dist/qobserva-0.1.5.tar.gz b/packages/qobserva/dist/qobserva-0.1.5.tar.gz new file mode 100644 index 00000000..f78c2eb4 Binary files /dev/null and b/packages/qobserva/dist/qobserva-0.1.5.tar.gz differ diff --git a/packages/qobserva/pyproject.toml b/packages/qobserva/pyproject.toml index 99918fc9..0ca51626 100644 --- a/packages/qobserva/pyproject.toml +++ b/packages/qobserva/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "qobserva" -version = "0.1.4" +version = "0.1.5" description = "QObserva - Quantum program observability and benchmarking. One command to install and run everything." readme = "README.md" requires-python = ">=3.10" @@ -31,9 +31,9 @@ classifiers = [ dependencies = [ "typer>=0.12.0", "rich>=13.7.0", - "qobserva-agent>=0.1.0", - "qobserva-collector>=0.1.2", - "qobserva-local>=0.1.1", + "qobserva-agent>=0.1.1", + "qobserva-collector>=0.1.3", + "qobserva-local>=0.1.2", ] [project.optional-dependencies] diff --git a/packages/qobserva/qobserva/__init__.py b/packages/qobserva/qobserva/__init__.py index 3f8cf9cb..30622e2a 100644 --- a/packages/qobserva/qobserva/__init__.py +++ b/packages/qobserva/qobserva/__init__.py @@ -1,9 +1,14 @@ """QObserva - Unified quantum observability package.""" -__version__ = "0.1.4" +from pkgutil import extend_path -# In PyPI installs, qobserva-agent and qobserva share the same package namespace. -# Import directly from the installed namespace package modules. +# Merge `qobserva` from meta + agent when they live on different sys.path entries +# (e.g. `pip install -e packages/qobserva` and `pip install -e packages/qobserva_agent`). +__path__ = extend_path(__path__, __name__) + +__version__ = "0.1.5" + +# Agent modules (`observe`, `client`, …) ship in the `qobserva-agent` distribution. try: from .observe import observe_run from .client import QObservaClient diff --git a/packages/qobserva_agent/dist/qobserva_agent-0.1.1-py3-none-any.whl b/packages/qobserva_agent/dist/qobserva_agent-0.1.1-py3-none-any.whl new file mode 100644 index 00000000..2b33a260 Binary files /dev/null and b/packages/qobserva_agent/dist/qobserva_agent-0.1.1-py3-none-any.whl differ diff --git a/packages/qobserva_agent/dist/qobserva_agent-0.1.1.tar.gz b/packages/qobserva_agent/dist/qobserva_agent-0.1.1.tar.gz new file mode 100644 index 00000000..d02d662b Binary files /dev/null and b/packages/qobserva_agent/dist/qobserva_agent-0.1.1.tar.gz differ diff --git a/packages/qobserva_agent/pyproject.toml b/packages/qobserva_agent/pyproject.toml index ec96b35b..f743abf8 100644 --- a/packages/qobserva_agent/pyproject.toml +++ b/packages/qobserva_agent/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "qobserva-agent" -version = "0.1.0" +version = "0.1.1" description = "QObserva agent: decorator-first telemetry for quantum runs (Qiskit, Braket, Cirq, PennyLane, pyQuil, D-Wave)." readme = "README.md" requires-python = ">=3.10" diff --git a/packages/qobserva_agent/qobserva/__init__.py b/packages/qobserva_agent/qobserva/__init__.py index 79d00cd9..f79ff984 100644 --- a/packages/qobserva_agent/qobserva/__init__.py +++ b/packages/qobserva_agent/qobserva/__init__.py @@ -1,8 +1,12 @@ """QObserva agent public API.""" +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) + from .observe import observe_run from .client import QObservaClient from .report import report_run __all__ = ["observe_run", "QObservaClient", "report_run"] -__version__ = "0.1.0" +__version__ = "0.1.1" diff --git a/packages/qobserva_agent/qobserva/observe.py b/packages/qobserva_agent/qobserva/observe.py index c627fdb9..dfa42ecb 100644 --- a/packages/qobserva_agent/qobserva/observe.py +++ b/packages/qobserva_agent/qobserva/observe.py @@ -14,6 +14,16 @@ from .report import iso_now, report_run from .sanitize import sanitize_error_message +def _package_version(dist_name: str) -> str | None: + """Installed distribution version, or None if not importable as a wheel/sdist.""" + try: + from importlib import metadata + + return metadata.version(dist_name) + except Exception: + return None + + def _hash_program(obj: Any) -> str: try: b = json.dumps(str(obj), sort_keys=True).encode("utf-8") @@ -188,6 +198,20 @@ def wrapper(*args, **kwargs): shots = int(extracted.get("shots", 1) or 1) + _sw: Dict[str, Any] = { + "sdk": extracted.get("sdk", {}), + "python_version": platform.python_version(), + } + _av = _package_version("qobserva-agent") + if _av: + _sw["agent_version"] = _av + _qv = _package_version("qobserva") + if _qv: + _sw["qobserva_version"] = _qv + _cv = _package_version("qobserva-collector") + if _cv: + _sw["collector_version"] = _cv + event = { "schema_version": "0.1.0", "event_id": str(uuid.uuid4()), @@ -196,11 +220,7 @@ def wrapper(*args, **kwargs): "project": project, "tags": tags, "actor": {"host": socket.gethostname()}, - "software": { - "agent_version": "0.1.0", - "sdk": extracted.get("sdk", {}), - "python_version": platform.python_version(), - }, + "software": _sw, "backend": extracted.get("backend", {"provider": "unknown", "name": "unknown"}), "program": extracted.get("program", { "kind": "circuit", diff --git a/packages/qobserva_collector/dist/qobserva_collector-0.1.3-py3-none-any.whl b/packages/qobserva_collector/dist/qobserva_collector-0.1.3-py3-none-any.whl new file mode 100644 index 00000000..1f153465 Binary files /dev/null and b/packages/qobserva_collector/dist/qobserva_collector-0.1.3-py3-none-any.whl differ diff --git a/packages/qobserva_collector/dist/qobserva_collector-0.1.3.tar.gz b/packages/qobserva_collector/dist/qobserva_collector-0.1.3.tar.gz new file mode 100644 index 00000000..876ce740 Binary files /dev/null and b/packages/qobserva_collector/dist/qobserva_collector-0.1.3.tar.gz differ diff --git a/packages/qobserva_collector/pyproject.toml b/packages/qobserva_collector/pyproject.toml index f0a97aac..382e4ca6 100644 --- a/packages/qobserva_collector/pyproject.toml +++ b/packages/qobserva_collector/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "qobserva-collector" -version = "0.1.2" +version = "0.1.3" description = "QObserva local collector service (FastAPI) for ingesting and storing run events." readme = "README.md" requires-python = ">=3.10" diff --git a/packages/qobserva_collector/qobserva_collector/api.py b/packages/qobserva_collector/qobserva_collector/api.py index bf69cc61..9a721616 100644 --- a/packages/qobserva_collector/qobserva_collector/api.py +++ b/packages/qobserva_collector/qobserva_collector/api.py @@ -18,7 +18,7 @@ from .analysis import compute_metrics_and_insights def create_app() -> FastAPI: - app = FastAPI(title="QObserva Collector", version="0.1.0") + app = FastAPI(title="QObserva Collector", version="0.1.3") app.add_middleware( CORSMiddleware, @@ -43,6 +43,36 @@ def _get_installed_version(dist_name: str) -> str: except metadata.PackageNotFoundError: return "unknown" + def _dist_version_or_none(dist_name: str) -> str | None: + try: + return metadata.version(dist_name) + except metadata.PackageNotFoundError: + return None + + def _enrich_software_versions(ev: Dict[str, Any]) -> None: + """ + Fill missing software.* version strings from this collector's environment. + + Client telemetry is preferred when present; this only backfills gaps so + stored run artifacts and Run Details stay useful for older agents or sparse payloads. + """ + sw = ev.get("software") + if sw is None: + sw = {} + ev["software"] = sw + if not isinstance(sw, dict): + return + for key, dist in ( + ("qobserva_version", "qobserva"), + ("agent_version", "qobserva-agent"), + ("collector_version", "qobserva-collector"), + ): + cur = sw.get(key) + if cur is None or (isinstance(cur, str) and not cur.strip()): + v = _dist_version_or_none(dist) + if v: + sw[key] = v + def auth(authorization: str | None = Header(default=None)): cfg = load_config() if not cfg.require_token: @@ -60,6 +90,8 @@ def ingest_run_event(event: Dict[str, Any], _auth: bool = Depends(auth), db: Ses if errs: raise HTTPException(status_code=400, detail={"errors": errs}) + _enrich_software_versions(event) + run_id = event["run_id"] if db.query(Run).filter(Run.run_id == run_id).first(): return {"accepted": True, "run_id": run_id, "duplicate": True} diff --git a/packages/qobserva_local/dist/qobserva_local-0.1.2-py3-none-any.whl b/packages/qobserva_local/dist/qobserva_local-0.1.2-py3-none-any.whl new file mode 100644 index 00000000..7d5f5f6d Binary files /dev/null and b/packages/qobserva_local/dist/qobserva_local-0.1.2-py3-none-any.whl differ diff --git a/packages/qobserva_local/dist/qobserva_local-0.1.2.tar.gz b/packages/qobserva_local/dist/qobserva_local-0.1.2.tar.gz new file mode 100644 index 00000000..0a473d87 Binary files /dev/null and b/packages/qobserva_local/dist/qobserva_local-0.1.2.tar.gz differ diff --git a/packages/qobserva_local/pyproject.toml b/packages/qobserva_local/pyproject.toml index 226503c8..e78197fe 100644 --- a/packages/qobserva_local/pyproject.toml +++ b/packages/qobserva_local/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "qobserva-local" -version = "0.1.1" +version = "0.1.2" description = "One-command local stack runner (collector + UI) for QObserva." readme = "README.md" requires-python = ">=3.10" diff --git a/packages/qobserva_local/qobserva_local/ui_dist/assets/index-Au4EQVmF.css b/packages/qobserva_local/qobserva_local/ui_dist/assets/index-C6Dqxgn4.css similarity index 96% rename from packages/qobserva_local/qobserva_local/ui_dist/assets/index-Au4EQVmF.css rename to packages/qobserva_local/qobserva_local/ui_dist/assets/index-C6Dqxgn4.css index aefb66b1..4924726f 100644 --- a/packages/qobserva_local/qobserva_local/ui_dist/assets/index-Au4EQVmF.css +++ b/packages/qobserva_local/qobserva_local/ui_dist/assets/index-C6Dqxgn4.css @@ -1 +1 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1));font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:1.5rem}.metric-card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:1.5rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.metric-card:hover{border-color:#3b82f680}.btn-primary{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1));padding:.5rem 1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.btn-secondary{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:.5rem 1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-secondary:hover{border-color:#3b82f680}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-12{margin-left:3rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-80{margin-left:20rem}.ml-auto{margin-left:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.min-h-screen{min-height:100vh}.w-16{width:4rem}.w-20{width:5rem}.w-32{width:8rem}.w-5{width:1.25rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[320px\]{min-width:320px}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dark-border{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-error\/30{border-color:#ef44444d}.border-primary{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-primary\/30{border-color:#3b82f64d}.border-warning{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-warning\/30{border-color:#f59e0b4d}.bg-dark-bg{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-dark-bg\/50{background-color:#0f172a80}.bg-dark-surface{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-dark-text-muted\/20{background-color:#94a3b833}.bg-error\/20{background-color:#ef444433}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-primary\/10{background-color:#3b82f61a}.bg-primary\/20{background-color:#3b82f633}.bg-primary\/5{background-color:#3b82f60d}.bg-success{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-success\/20{background-color:#10b98133}.bg-warning{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-warning\/10{background-color:#f59e0b1a}.bg-warning\/20{background-color:#f59e0b33}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-dark-text{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-dark-text-muted{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-error{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-primary\/70{color:#3b82f6b3}.text-success{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-warning{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-50{opacity:.5}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-500{transition-duration:.5s}.qobserva-date-input::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.9;cursor:pointer}.qobserva-date-input::-webkit-calendar-picker-indicator:hover{opacity:1}.hover\:border-primary\/30:hover{border-color:#3b82f64d}.hover\:border-primary\/50:hover{border-color:#3b82f680}.hover\:bg-dark-bg:hover{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-bg\/50:hover{background-color:#0f172a80}.hover\:bg-dark-bg\/80:hover{background-color:#0f172acc}.hover\:bg-dark-surface:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:#3b82f61a}.hover\:bg-primary\/90:hover{background-color:#3b82f6e6}.hover\:stroke-primary:hover{stroke:#3b82f6}.hover\:text-dark-text:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:#3b82f6cc}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-primary\/50:focus{border-color:#3b82f680}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 640px){.sm\:h-20{height:5rem}.sm\:h-24{height:6rem}.sm\:w-20{width:5rem}.sm\:w-24{width:6rem}}@media (min-width: 768px){.md\:h-24{height:6rem}.md\:h-28{height:7rem}.md\:w-24{width:6rem}.md\:w-28{width:7rem}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:h-32{height:8rem}.lg\:w-32{width:8rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:h-36{height:9rem}.xl\:w-36{width:9rem}} +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1));font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:1.5rem}.metric-card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:1.5rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.metric-card:hover{border-color:#3b82f680}.btn-primary{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1));padding:.5rem 1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.btn-secondary{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:.5rem 1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-secondary:hover{border-color:#3b82f680}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-12{margin-left:3rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-80{margin-left:20rem}.ml-auto{margin-left:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.min-h-screen{min-height:100vh}.w-16{width:4rem}.w-20{width:5rem}.w-32{width:8rem}.w-5{width:1.25rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[320px\]{min-width:320px}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dark-border{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-error\/30{border-color:#ef44444d}.border-primary{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-primary\/30{border-color:#3b82f64d}.border-warning{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-warning\/30{border-color:#f59e0b4d}.bg-dark-bg{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-dark-bg\/50{background-color:#0f172a80}.bg-dark-surface{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-dark-text-muted\/20{background-color:#94a3b833}.bg-error\/20{background-color:#ef444433}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-primary\/10{background-color:#3b82f61a}.bg-primary\/20{background-color:#3b82f633}.bg-primary\/5{background-color:#3b82f60d}.bg-success{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-success\/20{background-color:#10b98133}.bg-warning{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-warning\/10{background-color:#f59e0b1a}.bg-warning\/20{background-color:#f59e0b33}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-dark-text{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-dark-text-muted{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-error{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-primary\/70{color:#3b82f6b3}.text-success{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-warning{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-50{opacity:.5}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-500{transition-duration:.5s}.qobserva-date-input::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.9;cursor:pointer}.qobserva-date-input::-webkit-calendar-picker-indicator:hover{opacity:1}.hover\:border-primary\/30:hover{border-color:#3b82f64d}.hover\:border-primary\/50:hover{border-color:#3b82f680}.hover\:bg-dark-bg:hover{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-bg\/50:hover{background-color:#0f172a80}.hover\:bg-dark-bg\/80:hover{background-color:#0f172acc}.hover\:bg-dark-surface:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:#3b82f61a}.hover\:bg-primary\/90:hover{background-color:#3b82f6e6}.hover\:stroke-primary:hover{stroke:#3b82f6}.hover\:text-dark-text:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:#3b82f6cc}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-primary\/50:focus{border-color:#3b82f680}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 640px){.sm\:h-20{height:5rem}.sm\:h-24{height:6rem}.sm\:w-20{width:5rem}.sm\:w-24{width:6rem}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 768px){.md\:h-24{height:6rem}.md\:h-28{height:7rem}.md\:w-24{width:6rem}.md\:w-28{width:7rem}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:h-32{height:8rem}.lg\:w-32{width:8rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:h-36{height:9rem}.xl\:w-36{width:9rem}} diff --git a/packages/qobserva_local/qobserva_local/ui_dist/assets/index-C5K8xCns.js b/packages/qobserva_local/qobserva_local/ui_dist/assets/index-DscupHIx.js similarity index 60% rename from packages/qobserva_local/qobserva_local/ui_dist/assets/index-C5K8xCns.js rename to packages/qobserva_local/qobserva_local/ui_dist/assets/index-DscupHIx.js index e8d8fb44..15e143a3 100644 --- a/packages/qobserva_local/qobserva_local/ui_dist/assets/index-C5K8xCns.js +++ b/packages/qobserva_local/qobserva_local/ui_dist/assets/index-DscupHIx.js @@ -1,4 +1,4 @@ -var e0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=(e,t,r)=>(Np(e,t,"read from private field"),r?r.call(e):t.get(e)),ne=(e,t,r)=>t.has(e)?e0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,n)=>(Np(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),he=(e,t,r)=>(Np(e,t,"access private method"),r);var Pc=(e,t,r,n)=>({set _(i){Y(e,t,i,r)},get _(){return $(e,t,n)}});function $T(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vP={exports:{}},fh={},yP={exports:{}},de={};/** +var t0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||t0("Cannot "+r);var $=(e,t,r)=>(Np(e,t,"read from private field"),r?r.call(e):t.get(e)),ne=(e,t,r)=>t.has(e)?t0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,n)=>(Np(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),he=(e,t,r)=>(Np(e,t,"access private method"),r);var Pc=(e,t,r,n)=>({set _(i){Y(e,t,i,r)},get _(){return $(e,t,n)}});function CT(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yP={exports:{}},fh={},gP={exports:{}},de={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var e0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oc=Symbol.for("react.element"),CT=Symbol.for("react.portal"),MT=Symbol.for("react.fragment"),RT=Symbol.for("react.strict_mode"),DT=Symbol.for("react.profiler"),IT=Symbol.for("react.provider"),LT=Symbol.for("react.context"),FT=Symbol.for("react.forward_ref"),BT=Symbol.for("react.suspense"),zT=Symbol.for("react.memo"),UT=Symbol.for("react.lazy"),t0=Symbol.iterator;function qT(e){return e===null||typeof e!="object"?null:(e=t0&&e[t0]||e["@@iterator"],typeof e=="function"?e:null)}var gP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xP=Object.assign,bP={};function $s(e,t,r){this.props=e,this.context=t,this.refs=bP,this.updater=r||gP}$s.prototype.isReactComponent={};$s.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")};$s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wP(){}wP.prototype=$s.prototype;function zg(e,t,r){this.props=e,this.context=t,this.refs=bP,this.updater=r||gP}var Ug=zg.prototype=new wP;Ug.constructor=zg;xP(Ug,$s.prototype);Ug.isPureReactComponent=!0;var r0=Array.isArray,SP=Object.prototype.hasOwnProperty,qg={current:null},jP={key:!0,ref:!0,__self:!0,__source:!0};function OP(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)SP.call(t,n)&&!jP.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var QT=k,YT=Symbol.for("react.element"),XT=Symbol.for("react.fragment"),ZT=Object.prototype.hasOwnProperty,JT=QT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,e$={key:!0,ref:!0,__self:!0,__source:!0};function _P(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)ZT.call(t,n)&&!e$.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:YT,type:e,key:a,ref:o,props:i,_owner:JT.current}}fh.Fragment=XT;fh.jsx=_P;fh.jsxs=_P;vP.exports=fh;var c=vP.exports,Hm={},kP={exports:{}},br={},AP={exports:{}},EP={};/** + */var YT=k,XT=Symbol.for("react.element"),ZT=Symbol.for("react.fragment"),JT=Object.prototype.hasOwnProperty,e$=YT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,t$={key:!0,ref:!0,__self:!0,__source:!0};function kP(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)JT.call(t,n)&&!t$.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:XT,type:e,key:a,ref:o,props:i,_owner:e$.current}}fh.Fragment=ZT;fh.jsx=kP;fh.jsxs=kP;yP.exports=fh;var c=yP.exports,Km={},AP={exports:{}},br={},EP={exports:{}},NP={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var e0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(C,B){var U=C.length;C.push(B);e:for(;0>>1,q=C[G];if(0>>1;Gi(V,U))iei(Le,V)?(C[G]=Le,C[ie]=U,G=ie):(C[G]=V,C[ce]=U,G=ce);else if(iei(Le,U))C[G]=Le,C[ie]=U,G=ie;else break e}}return B}function i(C,B){var U=C.sortIndex-B.sortIndex;return U!==0?U:C.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,d=null,h=3,p=!1,v=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var B=r(u);B!==null;){if(B.callback===null)n(u);else if(B.startTime<=C)n(u),B.sortIndex=B.expirationTime,t(l,B);else break;B=r(u)}}function S(C){if(m=!1,x(C),!v)if(r(l)!==null)v=!0,L(w);else{var B=r(u);B!==null&&z(S,B.startTime-C)}}function w(C,B){v=!1,m&&(m=!1,b(P),P=-1),p=!0;var U=h;try{for(x(B),d=r(l);d!==null&&(!(d.expirationTime>B)||C&&!N());){var G=d.callback;if(typeof G=="function"){d.callback=null,h=d.priorityLevel;var q=G(d.expirationTime<=B);B=e.unstable_now(),typeof q=="function"?d.callback=q:d===r(l)&&n(l),x(B)}else n(l);d=r(l)}if(d!==null)var ee=!0;else{var ce=r(u);ce!==null&&z(S,ce.startTime-B),ee=!1}return ee}finally{d=null,h=U,p=!1}}var j=!1,O=null,P=-1,A=5,E=-1;function N(){return!(e.unstable_now()-EC||125G?(C.sortIndex=U,t(u,C),r(l)===null&&C===r(u)&&(m?(b(P),P=-1):m=!0,z(S,U-G))):(C.sortIndex=q,t(l,C),v||p||(v=!0,L(w))),C},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(C){var B=h;return function(){var U=h;h=B;try{return C.apply(this,arguments)}finally{h=U}}}})(EP);AP.exports=EP;var t$=AP.exports;/** + */(function(e){function t(C,F){var z=C.length;C.push(F);e:for(;0>>1,q=C[G];if(0>>1;Gi(V,z))iei(Le,V)?(C[G]=Le,C[ie]=z,G=ie):(C[G]=V,C[ce]=z,G=ce);else if(iei(Le,z))C[G]=Le,C[ie]=z,G=ie;else break e}}return F}function i(C,F){var z=C.sortIndex-F.sortIndex;return z!==0?z:C.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,d=null,h=3,p=!1,v=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var F=r(u);F!==null;){if(F.callback===null)n(u);else if(F.startTime<=C)n(u),F.sortIndex=F.expirationTime,t(l,F);else break;F=r(u)}}function S(C){if(m=!1,x(C),!v)if(r(l)!==null)v=!0,L(w);else{var F=r(u);F!==null&&U(S,F.startTime-C)}}function w(C,F){v=!1,m&&(m=!1,b(P),P=-1),p=!0;var z=h;try{for(x(F),d=r(l);d!==null&&(!(d.expirationTime>F)||C&&!N());){var G=d.callback;if(typeof G=="function"){d.callback=null,h=d.priorityLevel;var q=G(d.expirationTime<=F);F=e.unstable_now(),typeof q=="function"?d.callback=q:d===r(l)&&n(l),x(F)}else n(l);d=r(l)}if(d!==null)var ee=!0;else{var ce=r(u);ce!==null&&U(S,ce.startTime-F),ee=!1}return ee}finally{d=null,h=z,p=!1}}var j=!1,O=null,P=-1,A=5,E=-1;function N(){return!(e.unstable_now()-EC||125G?(C.sortIndex=z,t(u,C),r(l)===null&&C===r(u)&&(m?(b(P),P=-1):m=!0,U(S,z-G))):(C.sortIndex=q,t(l,C),v||p||(v=!0,L(w))),C},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(C){var F=h;return function(){var z=h;h=F;try{return C.apply(this,arguments)}finally{h=z}}}})(NP);EP.exports=NP;var r$=EP.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var e0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r$=k,gr=t$;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Km=Object.prototype.hasOwnProperty,n$=/^[: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]*$/,i0={},a0={};function i$(e){return Km.call(a0,e)?!0:Km.call(i0,e)?!1:n$.test(e)?a0[e]=!0:(i0[e]=!0,!1)}function a$(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function o$(e,t,r,n){if(t===null||typeof t>"u"||a$(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Vt(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Vt(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){kt[e]=new Vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Hg=/[\-:]([a-z])/g;function Kg(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(Hg,Kg);kt[t]=new Vt(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(Hg,Kg);kt[t]=new Vt(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(Hg,Kg);kt[t]=new Vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Vg(e,t,r,n){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vm=Object.prototype.hasOwnProperty,i$=/^[: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]*$/,a0={},o0={};function a$(e){return Vm.call(o0,e)?!0:Vm.call(a0,e)?!1:i$.test(e)?o0[e]=!0:(a0[e]=!0,!1)}function o$(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function s$(e,t,r,n){if(t===null||typeof t>"u"||o$(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Vt(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Vt(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){kt[e]=new Vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kg=/[\-:]([a-z])/g;function Vg(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(Kg,Vg);kt[t]=new Vt(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(Kg,Vg);kt[t]=new Vt(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(Kg,Vg);kt[t]=new Vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gg(e,t,r,n){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Cp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Pl(e):""}function s$(e){switch(e.tag){case 5:return Pl(e.type);case 16:return Pl("Lazy");case 13:return Pl("Suspense");case 19:return Pl("SuspenseList");case 0:case 2:case 15:return e=Mp(e.type,!1),e;case 11:return e=Mp(e.type.render,!1),e;case 1:return e=Mp(e.type,!0),e;default:return""}}function Ym(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 uo:return"Fragment";case lo:return"Portal";case Vm:return"Profiler";case Gg:return"StrictMode";case Gm:return"Suspense";case Qm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $P:return(e.displayName||"Context")+".Consumer";case TP:return(e._context.displayName||"Context")+".Provider";case Qg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yg:return t=e.displayName||null,t!==null?t:Ym(e.type)||"Memo";case si:t=e._payload,e=e._init;try{return Ym(e(t))}catch{}}return null}function l$(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 Ym(t);case 8:return t===Gg?"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 Fi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function MP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function u$(e){var t=MP(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ec(e){e._valueTracker||(e._valueTracker=u$(e))}function RP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=MP(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Of(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 Xm(e,t){var r=t.checked;return qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function s0(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Fi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function DP(e,t){t=t.checked,t!=null&&Vg(e,"checked",t,!1)}function Zm(e,t){DP(e,t);var r=Fi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Jm(e,t.type,r):t.hasOwnProperty("defaultValue")&&Jm(e,t.type,Fi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function l0(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Jm(e,t,r){(t!=="number"||Of(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var _l=Array.isArray;function _o(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Tl={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},c$=["Webkit","ms","Moz","O"];Object.keys(Tl).forEach(function(e){c$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tl[t]=Tl[e]})});function BP(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Tl.hasOwnProperty(e)&&Tl[e]?(""+t).trim():t+"px"}function zP(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=BP(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var f$=qe({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 rv(e,t){if(t){if(f$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function nv(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 iv=null;function Xg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var av=null,ko=null,Ao=null;function f0(e){if(e=uc(e)){if(typeof av!="function")throw Error(K(280));var t=e.stateNode;t&&(t=vh(t),av(e.stateNode,e.type,t))}}function UP(e){ko?Ao?Ao.push(e):Ao=[e]:ko=e}function qP(){if(ko){var e=ko,t=Ao;if(Ao=ko=null,f0(e),t)for(e=0;e>>=0,e===0?32:31-(S$(e)/j$|0)|0}var Tc=64,$c=4194304;function kl(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 Af(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=kl(s):(a&=o,a!==0&&(n=kl(a)))}else o=r&~i,o!==0?n=kl(o):a!==0&&(n=kl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function sc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zr(t),e[t]=r}function k$(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=Cl),b0=" ",w0=!1;function u_(e,t){switch(e){case"keyup":return tC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var co=!1;function nC(e,t){switch(e){case"compositionend":return c_(t);case"keypress":return t.which!==32?null:(w0=!0,b0);case"textInput":return e=t.data,e===b0&&w0?null:e;default:return null}}function iC(e,t){if(co)return e==="compositionend"||!ax&&u_(e,t)?(e=s_(),ff=rx=wi=null,co=!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:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=P0(r)}}function p_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?p_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function m_(){for(var e=window,t=Of();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Of(e.document)}return t}function ox(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 hC(e){var t=m_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&p_(r.ownerDocument.documentElement,r)){if(n!==null&&ox(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=_0(r,a);var o=_0(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,fo=null,fv=null,Rl=null,dv=!1;function k0(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;dv||fo==null||fo!==Of(n)||(n=fo,"selectionStart"in n&&ox(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rl&&nu(Rl,n)||(Rl=n,n=Tf(fv,"onSelect"),0mo||(e.current=gv[mo],gv[mo]=null,mo--)}function Ce(e,t){mo++,gv[mo]=e.current,e.current=t}var Bi={},Rt=Wi(Bi),er=Wi(!1),Da=Bi;function Go(e,t){var r=e.type.contextTypes;if(!r)return Bi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function tr(e){return e=e.childContextTypes,e!=null}function Cf(){Ie(er),Ie(Rt)}function M0(e,t,r){if(Rt.current!==Bi)throw Error(K(168));Ce(Rt,t),Ce(er,r)}function O_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(K(108,l$(e)||"Unknown",i));return qe({},r,n)}function Mf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bi,Da=Rt.current,Ce(Rt,e),Ce(er,er.current),!0}function R0(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=O_(e,t,Da),n.__reactInternalMemoizedMergedChildContext=e,Ie(er),Ie(Rt),Ce(Rt,e)):Ie(er),Ce(er,r)}var En=null,yh=!1,Gp=!1;function P_(e){En===null?En=[e]:En.push(e)}function PC(e){yh=!0,P_(e)}function Hi(){if(!Gp&&En!==null){Gp=!0;var e=0,t=Oe;try{var r=En;for(Oe=1;e>=o,i-=o,Cn=1<<32-Zr(t)+i|r<P?(A=O,O=null):A=O.sibling;var E=h(b,O,x[P],S);if(E===null){O===null&&(O=A);break}e&&O&&E.alternate===null&&t(b,O),g=a(E,g,P),j===null?w=E:j.sibling=E,j=E,O=A}if(P===x.length)return r(b,O),Fe&&aa(b,P),w;if(O===null){for(;PP?(A=O,O=null):A=O.sibling;var N=h(b,O,E.value,S);if(N===null){O===null&&(O=A);break}e&&O&&N.alternate===null&&t(b,O),g=a(N,g,P),j===null?w=N:j.sibling=N,j=N,O=A}if(E.done)return r(b,O),Fe&&aa(b,P),w;if(O===null){for(;!E.done;P++,E=x.next())E=d(b,E.value,S),E!==null&&(g=a(E,g,P),j===null?w=E:j.sibling=E,j=E);return Fe&&aa(b,P),w}for(O=n(b,O);!E.done;P++,E=x.next())E=p(O,b,P,E.value,S),E!==null&&(e&&E.alternate!==null&&O.delete(E.key===null?P:E.key),g=a(E,g,P),j===null?w=E:j.sibling=E,j=E);return e&&O.forEach(function(T){return t(b,T)}),Fe&&aa(b,P),w}function y(b,g,x,S){if(typeof x=="object"&&x!==null&&x.type===uo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ac:e:{for(var w=x.key,j=g;j!==null;){if(j.key===w){if(w=x.type,w===uo){if(j.tag===7){r(b,j.sibling),g=i(j,x.props.children),g.return=b,b=g;break e}}else if(j.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===si&&L0(w)===j.type){r(b,j.sibling),g=i(j,x.props),g.ref=ll(b,j,x),g.return=b,b=g;break e}r(b,j);break}else t(b,j);j=j.sibling}x.type===uo?(g=$a(x.props.children,b.mode,S,x.key),g.return=b,b=g):(S=xf(x.type,x.key,x.props,null,b.mode,S),S.ref=ll(b,g,x),S.return=b,b=S)}return o(b);case lo:e:{for(j=x.key;g!==null;){if(g.key===j)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){r(b,g.sibling),g=i(g,x.children||[]),g.return=b,b=g;break e}else{r(b,g);break}else t(b,g);g=g.sibling}g=rm(x,b.mode,S),g.return=b,b=g}return o(b);case si:return j=x._init,y(b,g,j(x._payload),S)}if(_l(x))return v(b,g,x,S);if(nl(x))return m(b,g,x,S);Fc(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(r(b,g.sibling),g=i(g,x),g.return=b,b=g):(r(b,g),g=tm(x,b.mode,S),g.return=b,b=g),o(b)):r(b,g)}return y}var Yo=E_(!0),N_=E_(!1),If=Wi(null),Lf=null,go=null,cx=null;function fx(){cx=go=Lf=null}function dx(e){var t=If.current;Ie(If),e._currentValue=t}function wv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function No(e,t){Lf=e,cx=go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Zt=!0),e.firstContext=null)}function Rr(e){var t=e._currentValue;if(cx!==e)if(e={context:e,memoizedValue:t,next:null},go===null){if(Lf===null)throw Error(K(308));go=e,Lf.dependencies={lanes:0,firstContext:e}}else go=go.next=e;return t}var ha=null;function hx(e){ha===null?ha=[e]:ha.push(e)}function T_(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,hx(t)):(r.next=i.next,i.next=r),t.interleaved=r,qn(e,n)}function qn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var li=!1;function px(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $_(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 Ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ti(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ve&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,qn(e,r)}return i=n.interleaved,i===null?(t.next=t,hx(n)):(t.next=i.next,i.next=t),n.interleaved=t,qn(e,r)}function hf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Jg(e,r)}}function F0(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ff(e,t,r,n){var i=e.updateQueue;li=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;o=0,f=u=l=null,s=a;do{var h=s.lane,p=s.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,m=s;switch(h=t,p=r,m.tag){case 1:if(v=m.payload,typeof v=="function"){d=v.call(p,d,h);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(p,d,h):v,h==null)break e;d=qe({},d,h);break e;case 2:li=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=p,l=d):f=f.next=p,o|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(f===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Fa|=o,e.lanes=o,e.memoizedState=d}}function B0(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Yp.transition;Yp.transition={};try{e(!1),t()}finally{Oe=r,Yp.transition=n}}function Q_(){return Dr().memoizedState}function EC(e,t,r){var n=Ci(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Y_(e))X_(t,r);else if(r=T_(e,t,r,n),r!==null){var i=qt();Jr(r,e,n,i),Z_(r,t,n)}}function NC(e,t,r){var n=Ci(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Y_(e))X_(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,tn(s,o)){var l=t.interleaved;l===null?(i.next=i,hx(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=T_(e,t,i,n),r!==null&&(i=qt(),Jr(r,e,n,i),Z_(r,t,n))}}function Y_(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function X_(e,t){Dl=zf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Z_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Jg(e,r)}}var Uf={readContext:Rr,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useInsertionEffect:Et,useLayoutEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useMutableSource:Et,useSyncExternalStore:Et,useId:Et,unstable_isNewReconciler:!1},TC={readContext:Rr,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:Rr,useEffect:U0,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mf(4194308,4,W_.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mf(4194308,4,e,t)},useInsertionEffect:function(e,t){return mf(4,2,e,t)},useMemo:function(e,t){var r=ln();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ln();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=EC.bind(null,Ue,e),[n.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:z0,useDebugValue:Sx,useDeferredValue:function(e){return ln().memoizedState=e},useTransition:function(){var e=z0(!1),t=e[0];return e=AC.bind(null,e[1]),ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ue,i=ln();if(Fe){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),wt===null)throw Error(K(349));La&30||D_(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,U0(L_.bind(null,n,a,e),[e]),n.flags|=2048,fu(9,I_.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ln(),t=wt.identifierPrefix;if(Fe){var r=Mn,n=Cn;r=(n&~(1<<32-Zr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=uu++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Cp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Pl(e):""}function l$(e){switch(e.tag){case 5:return Pl(e.type);case 16:return Pl("Lazy");case 13:return Pl("Suspense");case 19:return Pl("SuspenseList");case 0:case 2:case 15:return e=Mp(e.type,!1),e;case 11:return e=Mp(e.type.render,!1),e;case 1:return e=Mp(e.type,!0),e;default:return""}}function Xm(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 uo:return"Fragment";case lo:return"Portal";case Gm:return"Profiler";case Qg:return"StrictMode";case Qm:return"Suspense";case Ym:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case CP:return(e.displayName||"Context")+".Consumer";case $P:return(e._context.displayName||"Context")+".Provider";case Yg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xg:return t=e.displayName||null,t!==null?t:Xm(e.type)||"Memo";case si:t=e._payload,e=e._init;try{return Xm(e(t))}catch{}}return null}function u$(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 Xm(t);case 8:return t===Qg?"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 Fi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function RP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function c$(e){var t=RP(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ec(e){e._valueTracker||(e._valueTracker=c$(e))}function DP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=RP(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Of(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 Zm(e,t){var r=t.checked;return qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function l0(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Fi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function IP(e,t){t=t.checked,t!=null&&Gg(e,"checked",t,!1)}function Jm(e,t){IP(e,t);var r=Fi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ev(e,t.type,r):t.hasOwnProperty("defaultValue")&&ev(e,t.type,Fi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function u0(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function ev(e,t,r){(t!=="number"||Of(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var _l=Array.isArray;function _o(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Tl={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},f$=["Webkit","ms","Moz","O"];Object.keys(Tl).forEach(function(e){f$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tl[t]=Tl[e]})});function zP(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Tl.hasOwnProperty(e)&&Tl[e]?(""+t).trim():t+"px"}function UP(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=zP(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var d$=qe({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 nv(e,t){if(t){if(d$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function iv(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 av=null;function Zg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ov=null,ko=null,Ao=null;function d0(e){if(e=uc(e)){if(typeof ov!="function")throw Error(K(280));var t=e.stateNode;t&&(t=vh(t),ov(e.stateNode,e.type,t))}}function qP(e){ko?Ao?Ao.push(e):Ao=[e]:ko=e}function WP(){if(ko){var e=ko,t=Ao;if(Ao=ko=null,d0(e),t)for(e=0;e>>=0,e===0?32:31-(j$(e)/O$|0)|0}var Tc=64,$c=4194304;function kl(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 Af(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=kl(s):(a&=o,a!==0&&(n=kl(a)))}else o=r&~i,o!==0?n=kl(o):a!==0&&(n=kl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function sc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zr(t),e[t]=r}function A$(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=Cl),w0=" ",S0=!1;function c_(e,t){switch(e){case"keyup":return rC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function f_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var co=!1;function iC(e,t){switch(e){case"compositionend":return f_(t);case"keypress":return t.which!==32?null:(S0=!0,w0);case"textInput":return e=t.data,e===w0&&S0?null:e;default:return null}}function aC(e,t){if(co)return e==="compositionend"||!ox&&c_(e,t)?(e=l_(),ff=nx=wi=null,co=!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:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=_0(r)}}function m_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?m_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function v_(){for(var e=window,t=Of();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Of(e.document)}return t}function sx(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 pC(e){var t=v_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&m_(r.ownerDocument.documentElement,r)){if(n!==null&&sx(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=k0(r,a);var o=k0(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,fo=null,dv=null,Rl=null,hv=!1;function A0(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;hv||fo==null||fo!==Of(n)||(n=fo,"selectionStart"in n&&sx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rl&&nu(Rl,n)||(Rl=n,n=Tf(dv,"onSelect"),0mo||(e.current=xv[mo],xv[mo]=null,mo--)}function Ce(e,t){mo++,xv[mo]=e.current,e.current=t}var Bi={},Rt=Wi(Bi),er=Wi(!1),Da=Bi;function Go(e,t){var r=e.type.contextTypes;if(!r)return Bi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function tr(e){return e=e.childContextTypes,e!=null}function Cf(){Ie(er),Ie(Rt)}function R0(e,t,r){if(Rt.current!==Bi)throw Error(K(168));Ce(Rt,t),Ce(er,r)}function P_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(K(108,u$(e)||"Unknown",i));return qe({},r,n)}function Mf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bi,Da=Rt.current,Ce(Rt,e),Ce(er,er.current),!0}function D0(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=P_(e,t,Da),n.__reactInternalMemoizedMergedChildContext=e,Ie(er),Ie(Rt),Ce(Rt,e)):Ie(er),Ce(er,r)}var En=null,yh=!1,Gp=!1;function __(e){En===null?En=[e]:En.push(e)}function _C(e){yh=!0,__(e)}function Hi(){if(!Gp&&En!==null){Gp=!0;var e=0,t=Oe;try{var r=En;for(Oe=1;e>=o,i-=o,Cn=1<<32-Zr(t)+i|r<P?(A=O,O=null):A=O.sibling;var E=h(b,O,x[P],S);if(E===null){O===null&&(O=A);break}e&&O&&E.alternate===null&&t(b,O),g=a(E,g,P),j===null?w=E:j.sibling=E,j=E,O=A}if(P===x.length)return r(b,O),Fe&&aa(b,P),w;if(O===null){for(;PP?(A=O,O=null):A=O.sibling;var N=h(b,O,E.value,S);if(N===null){O===null&&(O=A);break}e&&O&&N.alternate===null&&t(b,O),g=a(N,g,P),j===null?w=N:j.sibling=N,j=N,O=A}if(E.done)return r(b,O),Fe&&aa(b,P),w;if(O===null){for(;!E.done;P++,E=x.next())E=d(b,E.value,S),E!==null&&(g=a(E,g,P),j===null?w=E:j.sibling=E,j=E);return Fe&&aa(b,P),w}for(O=n(b,O);!E.done;P++,E=x.next())E=p(O,b,P,E.value,S),E!==null&&(e&&E.alternate!==null&&O.delete(E.key===null?P:E.key),g=a(E,g,P),j===null?w=E:j.sibling=E,j=E);return e&&O.forEach(function(T){return t(b,T)}),Fe&&aa(b,P),w}function y(b,g,x,S){if(typeof x=="object"&&x!==null&&x.type===uo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ac:e:{for(var w=x.key,j=g;j!==null;){if(j.key===w){if(w=x.type,w===uo){if(j.tag===7){r(b,j.sibling),g=i(j,x.props.children),g.return=b,b=g;break e}}else if(j.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===si&&F0(w)===j.type){r(b,j.sibling),g=i(j,x.props),g.ref=ll(b,j,x),g.return=b,b=g;break e}r(b,j);break}else t(b,j);j=j.sibling}x.type===uo?(g=$a(x.props.children,b.mode,S,x.key),g.return=b,b=g):(S=xf(x.type,x.key,x.props,null,b.mode,S),S.ref=ll(b,g,x),S.return=b,b=S)}return o(b);case lo:e:{for(j=x.key;g!==null;){if(g.key===j)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){r(b,g.sibling),g=i(g,x.children||[]),g.return=b,b=g;break e}else{r(b,g);break}else t(b,g);g=g.sibling}g=rm(x,b.mode,S),g.return=b,b=g}return o(b);case si:return j=x._init,y(b,g,j(x._payload),S)}if(_l(x))return v(b,g,x,S);if(nl(x))return m(b,g,x,S);Fc(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(r(b,g.sibling),g=i(g,x),g.return=b,b=g):(r(b,g),g=tm(x,b.mode,S),g.return=b,b=g),o(b)):r(b,g)}return y}var Yo=N_(!0),T_=N_(!1),If=Wi(null),Lf=null,go=null,fx=null;function dx(){fx=go=Lf=null}function hx(e){var t=If.current;Ie(If),e._currentValue=t}function Sv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function No(e,t){Lf=e,fx=go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Zt=!0),e.firstContext=null)}function Rr(e){var t=e._currentValue;if(fx!==e)if(e={context:e,memoizedValue:t,next:null},go===null){if(Lf===null)throw Error(K(308));go=e,Lf.dependencies={lanes:0,firstContext:e}}else go=go.next=e;return t}var ha=null;function px(e){ha===null?ha=[e]:ha.push(e)}function $_(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,px(t)):(r.next=i.next,i.next=r),t.interleaved=r,qn(e,n)}function qn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var li=!1;function mx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function C_(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 Ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ti(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ve&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,qn(e,r)}return i=n.interleaved,i===null?(t.next=t,px(n)):(t.next=i.next,i.next=t),n.interleaved=t,qn(e,r)}function hf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ex(e,r)}}function B0(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ff(e,t,r,n){var i=e.updateQueue;li=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;o=0,f=u=l=null,s=a;do{var h=s.lane,p=s.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,m=s;switch(h=t,p=r,m.tag){case 1:if(v=m.payload,typeof v=="function"){d=v.call(p,d,h);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(p,d,h):v,h==null)break e;d=qe({},d,h);break e;case 2:li=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=p,l=d):f=f.next=p,o|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(f===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Fa|=o,e.lanes=o,e.memoizedState=d}}function z0(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Yp.transition;Yp.transition={};try{e(!1),t()}finally{Oe=r,Yp.transition=n}}function Y_(){return Dr().memoizedState}function NC(e,t,r){var n=Ci(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},X_(e))Z_(t,r);else if(r=$_(e,t,r,n),r!==null){var i=qt();Jr(r,e,n,i),J_(r,t,n)}}function TC(e,t,r){var n=Ci(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(X_(e))Z_(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,tn(s,o)){var l=t.interleaved;l===null?(i.next=i,px(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=$_(e,t,i,n),r!==null&&(i=qt(),Jr(r,e,n,i),J_(r,t,n))}}function X_(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Z_(e,t){Dl=zf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function J_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ex(e,r)}}var Uf={readContext:Rr,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useInsertionEffect:Et,useLayoutEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useMutableSource:Et,useSyncExternalStore:Et,useId:Et,unstable_isNewReconciler:!1},$C={readContext:Rr,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:Rr,useEffect:q0,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mf(4194308,4,H_.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mf(4194308,4,e,t)},useInsertionEffect:function(e,t){return mf(4,2,e,t)},useMemo:function(e,t){var r=ln();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ln();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=NC.bind(null,Ue,e),[n.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:U0,useDebugValue:jx,useDeferredValue:function(e){return ln().memoizedState=e},useTransition:function(){var e=U0(!1),t=e[0];return e=EC.bind(null,e[1]),ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ue,i=ln();if(Fe){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),wt===null)throw Error(K(349));La&30||I_(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,q0(F_.bind(null,n,a,e),[e]),n.flags|=2048,fu(9,L_.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ln(),t=wt.identifierPrefix;if(Fe){var r=Mn,n=Cn;r=(n&~(1<<32-Zr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=uu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[dn]=t,e[ou]=n,lk(e,t,!1,!1),t.stateNode=e;e:{switch(o=nv(r,n),r){case"dialog":Me("cancel",e),Me("close",e),i=n;break;case"iframe":case"object":case"embed":Me("load",e),i=n;break;case"video":case"audio":for(i=0;iJo&&(t.flags|=128,n=!0,ul(a,!1),t.lanes=4194304)}else{if(!n)if(e=Bf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ul(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Fe)return Nt(t),null}else 2*Ge()-a.renderingStartTime>Jo&&r!==1073741824&&(t.flags|=128,n=!0,ul(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ge(),t.sibling=null,r=ze.current,Ce(ze,n?r&1|2:r&1),t):(Nt(t),null);case 22:case 23:return Ax(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function FC(e,t){switch(lx(t),t.tag){case 1:return tr(t.type)&&Cf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xo(),Ie(er),Ie(Rt),yx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vx(t),null;case 13:if(Ie(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(ze),null;case 4:return Xo(),null;case 10:return dx(t.type._context),null;case 22:case 23:return Ax(),null;case 24:return null;default:return null}}var zc=!1,$t=!1,BC=typeof WeakSet=="function"?WeakSet:Set,Z=null;function xo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ke(e,t,n)}else r.current=null}function Nv(e,t,r){try{r()}catch(n){Ke(e,t,n)}}var J0=!1;function zC(e,t){if(hv=Ef,e=m_(),ox(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(s=o+i),d!==a||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++u===i&&(s=o),h===a&&++f===n&&(l=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(pv={focusedElem:e,selectionRange:r},Ef=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,y=v.memoizedState,b=t.stateNode,g=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Wr(t.type,m),y);b.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(S){Ke(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return v=J0,J0=!1,v}function Il(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Nv(t,r,a)}i=i.next}while(i!==n)}}function bh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Tv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function fk(e){var t=e.alternate;t!==null&&(e.alternate=null,fk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dn],delete t[ou],delete t[yv],delete t[jC],delete t[OC])),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 dk(e){return e.tag===5||e.tag===3||e.tag===4}function ew(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dk(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 $v(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=$f));else if(n!==4&&(e=e.child,e!==null))for($v(e,t,r),e=e.sibling;e!==null;)$v(e,t,r),e=e.sibling}function Cv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Cv(e,t,r),e=e.sibling;e!==null;)Cv(e,t,r),e=e.sibling}var Ot=null,Vr=!1;function ri(e,t,r){for(r=r.child;r!==null;)hk(e,t,r),r=r.sibling}function hk(e,t,r){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(dh,r)}catch{}switch(r.tag){case 5:$t||xo(r,t);case 6:var n=Ot,i=Vr;Ot=null,ri(e,t,r),Ot=n,Vr=i,Ot!==null&&(Vr?(e=Ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ot.removeChild(r.stateNode));break;case 18:Ot!==null&&(Vr?(e=Ot,r=r.stateNode,e.nodeType===8?Vp(e.parentNode,r):e.nodeType===1&&Vp(e,r),tu(e)):Vp(Ot,r.stateNode));break;case 4:n=Ot,i=Vr,Ot=r.stateNode.containerInfo,Vr=!0,ri(e,t,r),Ot=n,Vr=i;break;case 0:case 11:case 14:case 15:if(!$t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Nv(r,t,o),i=i.next}while(i!==n)}ri(e,t,r);break;case 1:if(!$t&&(xo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Ke(r,t,s)}ri(e,t,r);break;case 21:ri(e,t,r);break;case 22:r.mode&1?($t=(n=$t)||r.memoizedState!==null,ri(e,t,r),$t=n):ri(e,t,r);break;default:ri(e,t,r)}}function tw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new BC),t.forEach(function(n){var i=YC.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Br(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=Ge()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qC(n/1960))-n,10e?16:e,Si===null)var n=!1;else{if(e=Si,Si=null,Hf=0,ve&6)throw Error(K(331));var i=ve;for(ve|=4,Z=e.current;Z!==null;){var a=Z,o=a.child;if(Z.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lGe()-_x?Ta(e,0):Px|=r),rr(e,t)}function wk(e,t){t===0&&(e.mode&1?(t=$c,$c<<=1,!($c&130023424)&&($c=4194304)):t=1);var r=qt();e=qn(e,t),e!==null&&(sc(e,t,r),rr(e,r))}function QC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),wk(e,r)}function YC(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(K(314))}n!==null&&n.delete(t),wk(e,r)}var Sk;Sk=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||er.current)Zt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Zt=!1,IC(e,t,r);Zt=!!(e.flags&131072)}else Zt=!1,Fe&&t.flags&1048576&&__(t,Df,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;vf(e,t),e=t.pendingProps;var i=Go(t,Rt.current);No(t,r),i=xx(null,t,n,e,i,r);var a=bx();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tr(n)?(a=!0,Mf(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,px(t),i.updater=xh,t.stateNode=i,i._reactInternals=t,jv(t,n,e,r),t=_v(null,t,n,!0,a,r)):(t.tag=0,Fe&&a&&sx(t),Ft(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(vf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=ZC(n),e=Wr(n,e),i){case 0:t=Pv(null,t,n,e,r);break e;case 1:t=Y0(null,t,n,e,r);break e;case 11:t=G0(null,t,n,e,r);break e;case 14:t=Q0(null,t,n,Wr(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Pv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Y0(e,t,n,i,r);case 3:e:{if(ak(t),e===null)throw Error(K(387));n=t.pendingProps,a=t.memoizedState,i=a.element,$_(e,t),Ff(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Zo(Error(K(423)),t),t=X0(e,t,n,r,i);break e}else if(n!==i){i=Zo(Error(K(424)),t),t=X0(e,t,n,r,i);break e}else for(hr=Ni(t.stateNode.containerInfo.firstChild),pr=t,Fe=!0,Yr=null,r=N_(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Qo(),n===i){t=Wn(e,t,r);break e}Ft(e,t,n,r)}t=t.child}return t;case 5:return C_(t),e===null&&bv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,mv(n,i)?o=null:a!==null&&mv(n,a)&&(t.flags|=32),ik(e,t),Ft(e,t,o,r),t.child;case 6:return e===null&&bv(t),null;case 13:return ok(e,t,r);case 4:return mx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Yo(t,null,n,r):Ft(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),G0(e,t,n,i,r);case 7:return Ft(e,t,t.pendingProps,r),t.child;case 8:return Ft(e,t,t.pendingProps.children,r),t.child;case 12:return Ft(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Ce(If,n._currentValue),n._currentValue=o,a!==null)if(tn(a.value,o)){if(a.children===i.children&&!er.current){t=Wn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Ln(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),wv(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(K(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),wv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ft(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,No(t,r),i=Rr(i),n=n(i),t.flags|=1,Ft(e,t,n,r),t.child;case 14:return n=t.type,i=Wr(n,t.pendingProps),i=Wr(n.type,i),Q0(e,t,n,i,r);case 15:return rk(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),vf(e,t),t.tag=1,tr(n)?(e=!0,Mf(t)):e=!1,No(t,r),J_(t,n,i),jv(t,n,i,r),_v(null,t,n,!0,e,r);case 19:return sk(e,t,r);case 22:return nk(e,t,r)}throw Error(K(156,t.tag))};function jk(e,t){return YP(e,t)}function XC(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(e,t,r,n){return new XC(e,t,r,n)}function Nx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ZC(e){if(typeof e=="function")return Nx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qg)return 11;if(e===Yg)return 14}return 2}function Mi(e,t){var r=e.alternate;return r===null?(r=Tr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function xf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")Nx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case uo:return $a(r.children,i,a,t);case Gg:o=8,i|=8;break;case Vm:return e=Tr(12,r,t,i|2),e.elementType=Vm,e.lanes=a,e;case Gm:return e=Tr(13,r,t,i),e.elementType=Gm,e.lanes=a,e;case Qm:return e=Tr(19,r,t,i),e.elementType=Qm,e.lanes=a,e;case CP:return Sh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case TP:o=10;break e;case $P:o=9;break e;case Qg:o=11;break e;case Yg:o=14;break e;case si:o=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Tr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function $a(e,t,r,n){return e=Tr(7,e,n,t),e.lanes=r,e}function Sh(e,t,r,n){return e=Tr(22,e,n,t),e.elementType=CP,e.lanes=r,e.stateNode={isHidden:!1},e}function tm(e,t,r){return e=Tr(6,e,null,t),e.lanes=r,e}function rm(e,t,r){return t=Tr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function JC(e,t,r,n,i){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=Dp(0),this.expirationTimes=Dp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dp(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Tx(e,t,r,n,i,a,o,s,l){return e=new JC(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Tr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},px(a),e}function eM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kk)}catch(e){console.error(e)}}kk(),kP.exports=br;var aM=kP.exports,uw=aM;Hm.createRoot=uw.createRoot,Hm.hydrateRoot=uw.hydrateRoot;var fc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},oM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hi,Bg,oP,sM=(oP=class{constructor(){ne(this,hi,oM);ne(this,Bg,!1)}setTimeoutProvider(e){Y(this,hi,e)}setTimeout(e,t){return $(this,hi).setTimeout(e,t)}clearTimeout(e){$(this,hi).clearTimeout(e)}setInterval(e,t){return $(this,hi).setInterval(e,t)}clearInterval(e){$(this,hi).clearInterval(e)}},hi=new WeakMap,Bg=new WeakMap,oP),ma=new sM;function lM(e){setTimeout(e,0)}var za=typeof window>"u"||"Deno"in globalThis;function Yt(){}function uM(e,t){return typeof e=="function"?e(t):e}function Lv(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ak(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ri(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function cw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==Rx(o,t.options))return!1}else if(!pu(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function fw(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(hu(t.options.mutationKey)!==hu(a))return!1}else if(!pu(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Rx(e,t){return((t==null?void 0:t.queryKeyHashFn)||hu)(e)}function hu(e){return JSON.stringify(e,(t,r)=>Bv(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function pu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pu(e[r],t[r])):!1}var cM=Object.prototype.hasOwnProperty;function Ek(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=dw(e)&&dw(t);if(!n&&!(Bv(e)&&Bv(t)))return t;const a=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),s=o.length,l=n?new Array(s):{};let u=0;for(let f=0;f{ma.setTimeout(t,e)})}function zv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Ek(e,t):t}function dM(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function hM(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Dx=Symbol();function Nk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Dx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Tk(e,t){return typeof e=="function"?e(...t):!!e}function pM(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Sa,pi,Ro,sP,mM=(sP=class extends fc{constructor(){super();ne(this,Sa);ne(this,pi);ne(this,Ro);Y(this,Ro,t=>{if(!za&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){$(this,pi)||this.setEventListener($(this,Ro))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,pi))==null||t.call(this),Y(this,pi,void 0))}setEventListener(t){var r;Y(this,Ro,t),(r=$(this,pi))==null||r.call(this),Y(this,pi,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){$(this,Sa)!==t&&(Y(this,Sa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof $(this,Sa)=="boolean"?$(this,Sa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Sa=new WeakMap,pi=new WeakMap,Ro=new WeakMap,sP),Ix=new mM;function Uv(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var vM=lM;function yM(){let e=[],t=0,r=s=>{s()},n=s=>{s()},i=vM;const a=s=>{t?e.push(s):i(()=>{r(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{i=s}}}var Pt=yM(),Do,mi,Io,lP,gM=(lP=class extends fc{constructor(){super();ne(this,Do,!0);ne(this,mi);ne(this,Io);Y(this,Io,t=>{if(!za&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){$(this,mi)||this.setEventListener($(this,Io))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,mi))==null||t.call(this),Y(this,mi,void 0))}setEventListener(t){var r;Y(this,Io,t),(r=$(this,mi))==null||r.call(this),Y(this,mi,t(this.setOnline.bind(this)))}setOnline(t){$(this,Do)!==t&&(Y(this,Do,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return $(this,Do)}},Do=new WeakMap,mi=new WeakMap,Io=new WeakMap,lP),Gf=new gM;function xM(e){return Math.min(1e3*2**e,3e4)}function $k(e){return(e??"online")==="online"?Gf.isOnline():!0}var qv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ck(e){let t=!1,r=0,n;const i=Uv(),a=()=>i.status!=="pending",o=m=>{var y;if(!a()){const b=new qv(m);h(b),(y=e.onCancel)==null||y.call(e,b)}},s=()=>{t=!0},l=()=>{t=!1},u=()=>Ix.isFocused()&&(e.networkMode==="always"||Gf.isOnline())&&e.canRun(),f=()=>$k(e.networkMode)&&e.canRun(),d=m=>{a()||(n==null||n(),i.resolve(m))},h=m=>{a()||(n==null||n(),i.reject(m))},p=()=>new Promise(m=>{var y;n=b=>{(a()||u())&&m(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;n=void 0,a()||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(a())return;let m;const y=r===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{var j;if(a())return;const g=e.retry??(za?0:3),x=e.retryDelay??xM,S=typeof x=="function"?x(r,b):x,w=g===!0||typeof g=="number"&&ru()?void 0:p()).then(()=>{t?h(b):v()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n==null||n(),i),cancelRetry:s,continueRetry:l,canStart:f,start:()=>(f()?v():p().then(v),i)}}var ja,uP,Mk=(uP=class{constructor(){ne(this,ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Lv(this.gcTime)&&Y(this,ja,ma.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(za?1/0:5*60*1e3))}clearGcTimeout(){$(this,ja)&&(ma.clearTimeout($(this,ja)),Y(this,ja,void 0))}},ja=new WeakMap,uP),Oa,Lo,_r,Pa,yt,tc,_a,Hr,_n,cP,bM=(cP=class extends Mk{constructor(t){super();ne(this,Hr);ne(this,Oa);ne(this,Lo);ne(this,_r);ne(this,Pa);ne(this,yt);ne(this,tc);ne(this,_a);Y(this,_a,!1),Y(this,tc,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,Pa,t.client),Y(this,_r,$(this,Pa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,Oa,mw(this.options)),this.state=t.state??$(this,Oa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,yt))==null?void 0:t.promise}setOptions(t){if(this.options={...$(this,tc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=mw(this.options);r.data!==void 0&&(this.setState(pw(r.data,r.dataUpdatedAt)),Y(this,Oa,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,_r).remove(this)}setData(t,r){const n=zv(this.state.data,t,this.options);return he(this,Hr,_n).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){he(this,Hr,_n).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=$(this,yt))==null?void 0:n.promise;return(i=$(this,yt))==null||i.cancel(t),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($(this,Oa))}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dx||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ri(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ak(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=$(this,yt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=$(this,yt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,_r).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||($(this,yt)&&($(this,_a)?$(this,yt).cancel({revert:!0}):$(this,yt).cancelRetry()),this.scheduleGc()),$(this,_r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,Hr,_n).call(this,{type:"invalidate"})}async fetch(t,r){var l,u,f,d,h,p,v,m,y,b,g,x;if(this.state.fetchStatus!=="idle"&&((l=$(this,yt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if($(this,yt))return $(this,yt).continueRetry(),$(this,yt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(w=>w.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Y(this,_a,!0),n.signal)})},a=()=>{const S=Nk(this.options,r),j=(()=>{const O={client:$(this,Pa),queryKey:this.queryKey,meta:this.meta};return i(O),O})();return Y(this,_a,!1),this.options.persister?this.options.persister(S,j,this):S(j)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:$(this,Pa),state:this.state,fetchFn:a};return i(S),S})();(u=this.options.behavior)==null||u.onFetch(s,this),Y(this,Lo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&he(this,Hr,_n).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta}),Y(this,yt,Ck({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof qv&&S.revert&&this.setState({...$(this,Lo),fetchStatus:"idle"}),n.abort()},onFail:(S,w)=>{he(this,Hr,_n).call(this,{type:"failed",failureCount:S,error:w})},onPause:()=>{he(this,Hr,_n).call(this,{type:"pause"})},onContinue:()=>{he(this,Hr,_n).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await $(this,yt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(h=$(this,_r).config).onSuccess)==null||p.call(h,S,this),(m=(v=$(this,_r).config).onSettled)==null||m.call(v,S,this.state.error,this),S}catch(S){if(S instanceof qv){if(S.silent)return $(this,yt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw he(this,Hr,_n).call(this,{type:"error",error:S}),(b=(y=$(this,_r).config).onError)==null||b.call(y,S,this),(x=(g=$(this,_r).config).onSettled)==null||x.call(g,this.state.data,S,this),S}finally{this.scheduleGc()}}},Oa=new WeakMap,Lo=new WeakMap,_r=new WeakMap,Pa=new WeakMap,yt=new WeakMap,tc=new WeakMap,_a=new WeakMap,Hr=new WeakSet,_n=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Rk(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...pw(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,Lo,t.manual?i:void 0),i;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Pt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),$(this,_r).notify({query:this,type:"updated",action:t})})},cP);function Rk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$k(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Qt,pe,rc,Dt,ka,Fo,Nn,vi,nc,Bo,zo,Aa,Ea,yi,Uo,we,El,Wv,Hv,Kv,Vv,Gv,Qv,Yv,Dk,fP,wM=(fP=class extends fc{constructor(t,r){super();ne(this,we);ne(this,Qt);ne(this,pe);ne(this,rc);ne(this,Dt);ne(this,ka);ne(this,Fo);ne(this,Nn);ne(this,vi);ne(this,nc);ne(this,Bo);ne(this,zo);ne(this,Aa);ne(this,Ea);ne(this,yi);ne(this,Uo,new Set);this.options=r,Y(this,Qt,t),Y(this,vi,null),Y(this,Nn,Uv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,pe).addObserver(this),vw($(this,pe),this.options)?he(this,we,El).call(this):this.updateResult(),he(this,we,Vv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xv($(this,pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xv($(this,pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,we,Gv).call(this),he(this,we,Qv).call(this),$(this,pe).removeObserver(this)}setOptions(t){const r=this.options,n=$(this,pe);if(this.options=$(this,Qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,$(this,pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,we,Yv).call(this),$(this,pe).setOptions(this.options),r._defaulted&&!Fv(this.options,r)&&$(this,Qt).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,pe),observer:this});const i=this.hasListeners();i&&yw($(this,pe),n,this.options,r)&&he(this,we,El).call(this),this.updateResult(),i&&($(this,pe)!==n||kr(this.options.enabled,$(this,pe))!==kr(r.enabled,$(this,pe))||Ri(this.options.staleTime,$(this,pe))!==Ri(r.staleTime,$(this,pe)))&&he(this,we,Wv).call(this);const a=he(this,we,Hv).call(this);i&&($(this,pe)!==n||kr(this.options.enabled,$(this,pe))!==kr(r.enabled,$(this,pe))||a!==$(this,yi))&&he(this,we,Kv).call(this,a)}getOptimisticResult(t){const r=$(this,Qt).getQueryCache().build($(this,Qt),t),n=this.createResult(r,t);return jM(this,n)&&(Y(this,Dt,n),Y(this,Fo,this.options),Y(this,ka,$(this,pe).state)),n}getCurrentResult(){return $(this,Dt)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&$(this,Nn).status==="pending"&&$(this,Nn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){$(this,Uo).add(t)}getCurrentQuery(){return $(this,pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=$(this,Qt).defaultQueryOptions(t),n=$(this,Qt).getQueryCache().build($(this,Qt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return he(this,we,El).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,Dt)))}createResult(t,r){var A;const n=$(this,pe),i=this.options,a=$(this,Dt),o=$(this,ka),s=$(this,Fo),u=t!==n?t.state:$(this,rc),{state:f}=t;let d={...f},h=!1,p;if(r._optimisticResults){const E=this.hasListeners(),N=!E&&vw(t,r),T=E&&yw(t,n,r,i);(N||T)&&(d={...d,...Rk(f.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:m,status:y}=d;p=d.data;let b=!1;if(r.placeholderData!==void 0&&p===void 0&&y==="pending"){let E;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(E=a.data,b=!0):E=typeof r.placeholderData=="function"?r.placeholderData((A=$(this,zo))==null?void 0:A.state.data,$(this,zo)):r.placeholderData,E!==void 0&&(y="success",p=zv(a==null?void 0:a.data,E,r),h=!0)}if(r.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&r.select===$(this,nc))p=$(this,Bo);else try{Y(this,nc,r.select),p=r.select(p),p=zv(a==null?void 0:a.data,p,r),Y(this,Bo,p),Y(this,vi,null)}catch(E){Y(this,vi,E)}$(this,vi)&&(v=$(this,vi),p=$(this,Bo),m=Date.now(),y="error");const g=d.fetchStatus==="fetching",x=y==="pending",S=y==="error",w=x&&g,j=p!==void 0,P={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:S,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!x,isLoadingError:S&&!j,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&j,isStale:Lx(t,r),refetch:this.refetch,promise:$(this,Nn),isEnabled:kr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=P.data!==void 0,N=P.status==="error"&&!E,T=D=>{N?D.reject(P.error):E&&D.resolve(P.data)},M=()=>{const D=Y(this,Nn,P.promise=Uv());T(D)},R=$(this,Nn);switch(R.status){case"pending":t.queryHash===n.queryHash&&T(R);break;case"fulfilled":(N||P.data!==R.value)&&M();break;case"rejected":(!N||P.error!==R.reason)&&M();break}}return P}updateResult(){const t=$(this,Dt),r=this.createResult($(this,pe),this.options);if(Y(this,ka,$(this,pe).state),Y(this,Fo,this.options),$(this,ka).data!==void 0&&Y(this,zo,$(this,pe)),Fv(r,t))return;Y(this,Dt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!$(this,Uo).size)return!0;const o=new Set(a??$(this,Uo));return this.options.throwOnError&&o.add("error"),Object.keys($(this,Dt)).some(s=>{const l=s;return $(this,Dt)[l]!==t[l]&&o.has(l)})};he(this,we,Dk).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,we,Vv).call(this)}},Qt=new WeakMap,pe=new WeakMap,rc=new WeakMap,Dt=new WeakMap,ka=new WeakMap,Fo=new WeakMap,Nn=new WeakMap,vi=new WeakMap,nc=new WeakMap,Bo=new WeakMap,zo=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,yi=new WeakMap,Uo=new WeakMap,we=new WeakSet,El=function(t){he(this,we,Yv).call(this);let r=$(this,pe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Yt)),r},Wv=function(){he(this,we,Gv).call(this);const t=Ri(this.options.staleTime,$(this,pe));if(za||$(this,Dt).isStale||!Lv(t))return;const n=Ak($(this,Dt).dataUpdatedAt,t)+1;Y(this,Aa,ma.setTimeout(()=>{$(this,Dt).isStale||this.updateResult()},n))},Hv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,pe)):this.options.refetchInterval)??!1},Kv=function(t){he(this,we,Qv).call(this),Y(this,yi,t),!(za||kr(this.options.enabled,$(this,pe))===!1||!Lv($(this,yi))||$(this,yi)===0)&&Y(this,Ea,ma.setInterval(()=>{(this.options.refetchIntervalInBackground||Ix.isFocused())&&he(this,we,El).call(this)},$(this,yi)))},Vv=function(){he(this,we,Wv).call(this),he(this,we,Kv).call(this,he(this,we,Hv).call(this))},Gv=function(){$(this,Aa)&&(ma.clearTimeout($(this,Aa)),Y(this,Aa,void 0))},Qv=function(){$(this,Ea)&&(ma.clearInterval($(this,Ea)),Y(this,Ea,void 0))},Yv=function(){const t=$(this,Qt).getQueryCache().build($(this,Qt),this.options);if(t===$(this,pe))return;const r=$(this,pe);Y(this,pe,t),Y(this,rc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Dk=function(t){Pt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r($(this,Dt))}),$(this,Qt).getQueryCache().notify({query:$(this,pe),type:"observerResultsUpdated"})})},fP);function SM(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vw(e,t){return SM(e,t)||e.state.data!==void 0&&Xv(e,t,t.refetchOnMount)}function Xv(e,t,r){if(kr(t.enabled,e)!==!1&&Ri(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Lx(e,t)}return!1}function yw(e,t,r,n){return(e!==t||kr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Lx(e,r)}function Lx(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(Ri(t.staleTime,e))}function jM(e,t){return!Fv(e.getCurrentResult(),t)}function gw(e){return{onFetch:(t,r)=>{var f,d,h,p,v;const n=t.options,i=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const y=x=>{pM(x,()=>t.signal,()=>m=!0)},b=Nk(t.options,t.fetchOptions),g=async(x,S,w)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const O=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};return y(N),N})(),P=await b(O),{maxPages:A}=t.options,E=w?hM:dM;return{pages:E(x.pages,P,A),pageParams:E(x.pageParams,S,A)}};if(i&&a.length){const x=i==="backward",S=x?OM:xw,w={pages:a,pageParams:o},j=S(n,w);s=await g(w,j,x)}else{const x=e??a.length;do{const S=l===0?o[0]??n.initialPageParam:xw(n,s);if(l>0&&S==null)break;s=await g(s,S),l++}while(l{var m,y;return(y=(m=t.options).persister)==null?void 0:y.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function xw(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function OM(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ic,un,It,Na,cn,ai,dP,PM=(dP=class extends Mk{constructor(t){super();ne(this,cn);ne(this,ic);ne(this,un);ne(this,It);ne(this,Na);Y(this,ic,t.client),this.mutationId=t.mutationId,Y(this,It,t.mutationCache),Y(this,un,[]),this.state=t.state||_M(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,un).includes(t)||($(this,un).push(t),this.clearGcTimeout(),$(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,un,$(this,un).filter(r=>r!==t)),this.scheduleGc(),$(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,un).length||(this.state.status==="pending"?this.scheduleGc():$(this,It).remove(this))}continue(){var t;return((t=$(this,Na))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,l,u,f,d,h,p,v,m,y,b,g,x,S,w,j,O,P,A;const r=()=>{he(this,cn,ai).call(this,{type:"continue"})},n={client:$(this,ic),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,Na,Ck({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(E,N)=>{he(this,cn,ai).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{he(this,cn,ai).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,It).canRun(this)}));const i=this.state.status==="pending",a=!$(this,Na).canStart();try{if(i)r();else{he(this,cn,ai).call(this,{type:"pending",variables:t,isPaused:a}),await((s=(o=$(this,It).config).onMutate)==null?void 0:s.call(o,t,this,n));const N=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,n));N!==this.state.context&&he(this,cn,ai).call(this,{type:"pending",context:N,variables:t,isPaused:a})}const E=await $(this,Na).start();return await((d=(f=$(this,It).config).onSuccess)==null?void 0:d.call(f,E,t,this.state.context,this,n)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,E,t,this.state.context,n)),await((m=(v=$(this,It).config).onSettled)==null?void 0:m.call(v,E,null,this.state.variables,this.state.context,this,n)),await((b=(y=this.options).onSettled)==null?void 0:b.call(y,E,null,t,this.state.context,n)),he(this,cn,ai).call(this,{type:"success",data:E}),E}catch(E){try{await((x=(g=$(this,It).config).onError)==null?void 0:x.call(g,E,t,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((w=(S=this.options).onError)==null?void 0:w.call(S,E,t,this.state.context,n))}catch(N){Promise.reject(N)}try{await((O=(j=$(this,It).config).onSettled)==null?void 0:O.call(j,void 0,E,this.state.variables,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,E,t,this.state.context,n))}catch(N){Promise.reject(N)}throw he(this,cn,ai).call(this,{type:"error",error:E}),E}finally{$(this,It).runNext(this)}}},ic=new WeakMap,un=new WeakMap,It=new WeakMap,Na=new WeakMap,cn=new WeakSet,ai=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Pt.batch(()=>{$(this,un).forEach(n=>{n.onMutationUpdate(t)}),$(this,It).notify({mutation:this,type:"updated",action:t})})},dP);function _M(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tn,Kr,ac,hP,kM=(hP=class extends fc{constructor(t={}){super();ne(this,Tn);ne(this,Kr);ne(this,ac);this.config=t,Y(this,Tn,new Set),Y(this,Kr,new Map),Y(this,ac,0)}build(t,r,n){const i=new PM({client:t,mutationCache:this,mutationId:++Pc(this,ac)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){$(this,Tn).add(t);const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r);n?n.push(t):$(this,Kr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,Tn).delete(t)){const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&$(this,Kr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Wc(t);if(typeof r=="string"){const i=(n=$(this,Kr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Pt.batch(()=>{$(this,Tn).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,Tn).clear(),$(this,Kr).clear()})}getAll(){return Array.from($(this,Tn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>fw(r,n))}findAll(t={}){return this.getAll().filter(r=>fw(t,r))}notify(t){Pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Pt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Yt))))}},Tn=new WeakMap,Kr=new WeakMap,ac=new WeakMap,hP);function Wc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var fn,pP,AM=(pP=class extends fc{constructor(t={}){super();ne(this,fn);this.config=t,Y(this,fn,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??Rx(i,r);let o=this.get(a);return o||(o=new bM({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){$(this,fn).has(t.queryHash)||($(this,fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=$(this,fn).get(t.queryHash);r&&(t.destroy(),r===t&&$(this,fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,fn).get(t)}getAll(){return[...$(this,fn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>cw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>cw(t,n)):r}notify(t){Pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Pt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fn=new WeakMap,pP),He,gi,xi,qo,Wo,bi,Ho,Ko,mP,EM=(mP=class{constructor(e={}){ne(this,He);ne(this,gi);ne(this,xi);ne(this,qo);ne(this,Wo);ne(this,bi);ne(this,Ho);ne(this,Ko);Y(this,He,e.queryCache||new AM),Y(this,gi,e.mutationCache||new kM),Y(this,xi,e.defaultOptions||{}),Y(this,qo,new Map),Y(this,Wo,new Map),Y(this,bi,0)}mount(){Pc(this,bi)._++,$(this,bi)===1&&(Y(this,Ho,Ix.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,He).onFocus())})),Y(this,Ko,Gf.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,He).onOnline())})))}unmount(){var e,t;Pc(this,bi)._--,$(this,bi)===0&&((e=$(this,Ho))==null||e.call(this),Y(this,Ho,void 0),(t=$(this,Ko))==null||t.call(this),Y(this,Ko,void 0))}isFetching(e){return $(this,He).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,gi).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=$(this,He).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=$(this,He).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ri(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return $(this,He).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=$(this,He).get(n.queryHash),a=i==null?void 0:i.state.data,o=uM(t,a);if(o!==void 0)return $(this,He).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Pt.batch(()=>$(this,He).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=$(this,He).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=$(this,He);Pt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=$(this,He);return Pt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Pt.batch(()=>$(this,He).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Yt).catch(Yt)}invalidateQueries(e,t={}){return Pt.batch(()=>($(this,He).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Pt.batch(()=>$(this,He).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Yt)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=$(this,He).build(this,t);return r.isStaleByTime(Ri(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yt).catch(Yt)}fetchInfiniteQuery(e){return e.behavior=gw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yt).catch(Yt)}ensureInfiniteQueryData(e){return e.behavior=gw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Gf.isOnline()?$(this,gi).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,He)}getMutationCache(){return $(this,gi)}getDefaultOptions(){return $(this,xi)}setDefaultOptions(e){Y(this,xi,e)}setQueryDefaults(e,t){$(this,qo).set(hu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,qo).values()],r={};return t.forEach(n=>{pu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){$(this,Wo).set(hu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,Wo).values()],r={};return t.forEach(n=>{pu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,xi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Rx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Dx&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,xi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,He).clear(),$(this,gi).clear()}},He=new WeakMap,gi=new WeakMap,xi=new WeakMap,qo=new WeakMap,Wo=new WeakMap,bi=new WeakMap,Ho=new WeakMap,Ko=new WeakMap,mP),Ik=k.createContext(void 0),NM=e=>{const t=k.useContext(Ik);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TM=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Ik.Provider,{value:e,children:t})),Lk=k.createContext(!1),$M=()=>k.useContext(Lk);Lk.Provider;function CM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var MM=k.createContext(CM()),RM=()=>k.useContext(MM),DM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Tk(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},IM=e=>{k.useEffect(()=>{e.clearReset()},[e])},LM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||Tk(r,[e.error,n])),FM=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},BM=(e,t)=>e.isLoading&&e.isFetching&&!t,zM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function UM(e,t,r){var h,p,v,m;const n=$M(),i=RM(),a=NM(),o=a.defaultQueryOptions(e);(p=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,o);const s=a.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",FM(o),DM(o,i,s),IM(i);const l=!a.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(y=>{const b=d?u.subscribe(Pt.batchCalls(y)):Yt;return u.updateResult(),b},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),zM(o,f))throw bw(o,u,i);if(LM({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;if((m=(v=a.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||m.call(v,o,f),o.experimental_prefetchInRender&&!za&&BM(f,n)){const y=l?bw(o,u,i):s==null?void 0:s.promise;y==null||y.catch(Yt).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?f:u.trackResult(f)}function Qe(e,t){return UM(e,wM)}/** +`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Jp(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Pv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var RC=typeof WeakMap=="function"?WeakMap:Map;function tk(e,t,r){r=Ln(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Wf||(Wf=!0,Rv=n),Pv(e,t)},r}function rk(e,t,r){r=Ln(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Pv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Pv(e,t),typeof n!="function"&&($i===null?$i=new Set([this]):$i.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function K0(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new RC;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=QC.bind(null,e,t,r),t.then(e,e))}function V0(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function G0(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ln(-1,1),t.tag=2,Ti(r,t,1))),r.lanes|=1),e)}var DC=Xn.ReactCurrentOwner,Zt=!1;function Ft(e,t,r,n){t.child=e===null?T_(t,null,r,n):Yo(t,e.child,r,n)}function Q0(e,t,r,n,i){r=r.render;var a=t.ref;return No(t,i),n=bx(e,t,r,n,a,i),r=wx(),e!==null&&!Zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wn(e,t,i)):(Fe&&r&&lx(t),t.flags|=1,Ft(e,t,n,i),t.child)}function Y0(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!Tx(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,nk(e,t,a,n,i)):(e=xf(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:nu,r(o,n)&&e.ref===t.ref)return Wn(e,t,i)}return t.flags|=1,e=Mi(a,n),e.ref=t.ref,e.return=t,t.child=e}function nk(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(nu(a,n)&&e.ref===t.ref)if(Zt=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(Zt=!0);else return t.lanes=e.lanes,Wn(e,t,i)}return _v(e,t,r,n,i)}function ik(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ce(bo,cr),cr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ce(bo,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ce(bo,cr),cr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ce(bo,cr),cr|=n;return Ft(e,t,i,r),t.child}function ak(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function _v(e,t,r,n,i){var a=tr(r)?Da:Rt.current;return a=Go(t,a),No(t,i),r=bx(e,t,r,n,a,i),n=wx(),e!==null&&!Zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wn(e,t,i)):(Fe&&n&&lx(t),t.flags|=1,Ft(e,t,r,i),t.child)}function X0(e,t,r,n,i){if(tr(r)){var a=!0;Mf(t)}else a=!1;if(No(t,i),t.stateNode===null)vf(e,t),ek(t,r,n),Ov(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Rr(u):(u=tr(r)?Da:Rt.current,u=Go(t,u));var f=r.getDerivedStateFromProps,d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==n||l!==u)&&H0(t,o,n,u),li=!1;var h=t.memoizedState;o.state=h,Ff(t,n,o,i),l=t.memoizedState,s!==n||h!==l||er.current||li?(typeof f=="function"&&(jv(t,r,f,n),l=t.memoizedState),(s=li||W0(t,r,s,n,h,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=u,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,C_(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Wr(t.type,s),o.props=u,d=t.pendingProps,h=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Rr(l):(l=tr(r)?Da:Rt.current,l=Go(t,l));var p=r.getDerivedStateFromProps;(f=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==d||h!==l)&&H0(t,o,n,l),li=!1,h=t.memoizedState,o.state=h,Ff(t,n,o,i);var v=t.memoizedState;s!==d||h!==v||er.current||li?(typeof p=="function"&&(jv(t,r,p,n),v=t.memoizedState),(u=li||W0(t,r,u,n,h,v,l)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),o.props=n,o.state=v,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return kv(e,t,r,n,a,i)}function kv(e,t,r,n,i,a){ak(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&D0(t,r,!1),Wn(e,t,a);n=t.stateNode,DC.current=t;var s=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Yo(t,e.child,null,a),t.child=Yo(t,null,s,a)):Ft(e,t,s,a),t.memoizedState=n.state,i&&D0(t,r,!0),t.child}function ok(e){var t=e.stateNode;t.pendingContext?R0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&R0(e,t.context,!1),vx(e,t.containerInfo)}function Z0(e,t,r,n,i){return Qo(),cx(i),t.flags|=256,Ft(e,t,r,n),t.child}var Av={dehydrated:null,treeContext:null,retryLane:0};function Ev(e){return{baseLanes:e,cachePool:null,transitions:null}}function sk(e,t,r){var n=t.pendingProps,i=ze.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ce(ze,i&1),e===null)return wv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Sh(o,n,0,null),e=$a(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ev(r),t.memoizedState=Av,e):Ox(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return IC(e,t,o,n,s,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=Mi(i,l),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=Mi(s,a):(a=$a(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?Ev(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=Av,n}return a=e.child,e=a.sibling,n=Mi(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Ox(e,t){return t=Sh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bc(e,t,r,n){return n!==null&&cx(n),Yo(t,e.child,null,r),e=Ox(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function IC(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=Jp(Error(K(422))),Bc(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Sh({mode:"visible",children:n.children},i,0,null),a=$a(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Yo(t,e.child,null,o),t.child.memoizedState=Ev(o),t.memoizedState=Av,a);if(!(t.mode&1))return Bc(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(K(419)),n=Jp(a,n,void 0),Bc(e,t,o,n)}if(s=(o&e.childLanes)!==0,Zt||s){if(n=wt,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,qn(e,i),Jr(n,e,i,-1))}return Nx(),n=Jp(Error(K(421))),Bc(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=YC.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,hr=Ni(i.nextSibling),pr=t,Fe=!0,Yr=null,e!==null&&(Ar[Er++]=Cn,Ar[Er++]=Mn,Ar[Er++]=Ia,Cn=e.id,Mn=e.overflow,Ia=t),t=Ox(t,n.children),t.flags|=4096,t)}function J0(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Sv(e.return,t,r)}function em(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function lk(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Ft(e,t,n.children,r),n=ze.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&J0(e,r,t);else if(e.tag===19)J0(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ce(ze,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Bf(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),em(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bf(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}em(t,!0,r,null,a);break;case"together":em(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function vf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Fa|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,r=Mi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Mi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function LC(e,t,r){switch(t.tag){case 3:ok(t),Qo();break;case 5:M_(t);break;case 1:tr(t.type)&&Mf(t);break;case 4:vx(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ce(If,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ce(ze,ze.current&1),t.flags|=128,null):r&t.child.childLanes?sk(e,t,r):(Ce(ze,ze.current&1),e=Wn(e,t,r),e!==null?e.sibling:null);Ce(ze,ze.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return lk(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ce(ze,ze.current),n)break;return null;case 22:case 23:return t.lanes=0,ik(e,t,r)}return Wn(e,t,r)}var uk,Nv,ck,fk;uk=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Nv=function(){};ck=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,pa(vn.current);var a=null;switch(r){case"input":i=Zm(e,i),n=Zm(e,n),a=[];break;case"select":i=qe({},i,{value:void 0}),n=qe({},n,{value:void 0}),a=[];break;case"textarea":i=tv(e,i),n=tv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=$f)}nv(r,n);var o;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(o in s)s.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yl.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var l=n[u];if(s=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(a||(a=[]),a.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Yl.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Me("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};fk=function(e,t,r,n){r!==n&&(t.flags|=4)};function ul(e,t){if(!Fe)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function FC(e,t,r){var n=t.pendingProps;switch(ux(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(t),null;case 1:return tr(t.type)&&Cf(),Nt(t),null;case 3:return n=t.stateNode,Xo(),Ie(er),Ie(Rt),gx(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Lc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yr!==null&&(Lv(Yr),Yr=null))),Nv(e,t),Nt(t),null;case 5:yx(t);var i=pa(lu.current);if(r=t.type,e!==null&&t.stateNode!=null)ck(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(K(166));return Nt(t),null}if(e=pa(vn.current),Lc(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[dn]=t,n[ou]=a,e=(t.mode&1)!==0,r){case"dialog":Me("cancel",n),Me("close",n);break;case"iframe":case"object":case"embed":Me("load",n);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[dn]=t,e[ou]=n,uk(e,t,!1,!1),t.stateNode=e;e:{switch(o=iv(r,n),r){case"dialog":Me("cancel",e),Me("close",e),i=n;break;case"iframe":case"object":case"embed":Me("load",e),i=n;break;case"video":case"audio":for(i=0;iJo&&(t.flags|=128,n=!0,ul(a,!1),t.lanes=4194304)}else{if(!n)if(e=Bf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ul(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Fe)return Nt(t),null}else 2*Ge()-a.renderingStartTime>Jo&&r!==1073741824&&(t.flags|=128,n=!0,ul(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ge(),t.sibling=null,r=ze.current,Ce(ze,n?r&1|2:r&1),t):(Nt(t),null);case 22:case 23:return Ex(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function BC(e,t){switch(ux(t),t.tag){case 1:return tr(t.type)&&Cf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xo(),Ie(er),Ie(Rt),gx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yx(t),null;case 13:if(Ie(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(ze),null;case 4:return Xo(),null;case 10:return hx(t.type._context),null;case 22:case 23:return Ex(),null;case 24:return null;default:return null}}var zc=!1,$t=!1,zC=typeof WeakSet=="function"?WeakSet:Set,Z=null;function xo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ke(e,t,n)}else r.current=null}function Tv(e,t,r){try{r()}catch(n){Ke(e,t,n)}}var ew=!1;function UC(e,t){if(pv=Ef,e=v_(),sx(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(s=o+i),d!==a||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++u===i&&(s=o),h===a&&++f===n&&(l=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(mv={focusedElem:e,selectionRange:r},Ef=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,y=v.memoizedState,b=t.stateNode,g=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Wr(t.type,m),y);b.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(S){Ke(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return v=ew,ew=!1,v}function Il(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Tv(t,r,a)}i=i.next}while(i!==n)}}function bh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function $v(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function dk(e){var t=e.alternate;t!==null&&(e.alternate=null,dk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dn],delete t[ou],delete t[gv],delete t[OC],delete t[PC])),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 hk(e){return e.tag===5||e.tag===3||e.tag===4}function tw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hk(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 Cv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=$f));else if(n!==4&&(e=e.child,e!==null))for(Cv(e,t,r),e=e.sibling;e!==null;)Cv(e,t,r),e=e.sibling}function Mv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Mv(e,t,r),e=e.sibling;e!==null;)Mv(e,t,r),e=e.sibling}var Ot=null,Vr=!1;function ri(e,t,r){for(r=r.child;r!==null;)pk(e,t,r),r=r.sibling}function pk(e,t,r){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(dh,r)}catch{}switch(r.tag){case 5:$t||xo(r,t);case 6:var n=Ot,i=Vr;Ot=null,ri(e,t,r),Ot=n,Vr=i,Ot!==null&&(Vr?(e=Ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ot.removeChild(r.stateNode));break;case 18:Ot!==null&&(Vr?(e=Ot,r=r.stateNode,e.nodeType===8?Vp(e.parentNode,r):e.nodeType===1&&Vp(e,r),tu(e)):Vp(Ot,r.stateNode));break;case 4:n=Ot,i=Vr,Ot=r.stateNode.containerInfo,Vr=!0,ri(e,t,r),Ot=n,Vr=i;break;case 0:case 11:case 14:case 15:if(!$t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Tv(r,t,o),i=i.next}while(i!==n)}ri(e,t,r);break;case 1:if(!$t&&(xo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Ke(r,t,s)}ri(e,t,r);break;case 21:ri(e,t,r);break;case 22:r.mode&1?($t=(n=$t)||r.memoizedState!==null,ri(e,t,r),$t=n):ri(e,t,r);break;default:ri(e,t,r)}}function rw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new zC),t.forEach(function(n){var i=XC.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Br(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=Ge()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*WC(n/1960))-n,10e?16:e,Si===null)var n=!1;else{if(e=Si,Si=null,Hf=0,ve&6)throw Error(K(331));var i=ve;for(ve|=4,Z=e.current;Z!==null;){var a=Z,o=a.child;if(Z.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lGe()-kx?Ta(e,0):_x|=r),rr(e,t)}function Sk(e,t){t===0&&(e.mode&1?(t=$c,$c<<=1,!($c&130023424)&&($c=4194304)):t=1);var r=qt();e=qn(e,t),e!==null&&(sc(e,t,r),rr(e,r))}function YC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Sk(e,r)}function XC(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(K(314))}n!==null&&n.delete(t),Sk(e,r)}var jk;jk=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||er.current)Zt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Zt=!1,LC(e,t,r);Zt=!!(e.flags&131072)}else Zt=!1,Fe&&t.flags&1048576&&k_(t,Df,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;vf(e,t),e=t.pendingProps;var i=Go(t,Rt.current);No(t,r),i=bx(null,t,n,e,i,r);var a=wx();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tr(n)?(a=!0,Mf(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,mx(t),i.updater=xh,t.stateNode=i,i._reactInternals=t,Ov(t,n,e,r),t=kv(null,t,n,!0,a,r)):(t.tag=0,Fe&&a&&lx(t),Ft(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(vf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=JC(n),e=Wr(n,e),i){case 0:t=_v(null,t,n,e,r);break e;case 1:t=X0(null,t,n,e,r);break e;case 11:t=Q0(null,t,n,e,r);break e;case 14:t=Y0(null,t,n,Wr(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),_v(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),X0(e,t,n,i,r);case 3:e:{if(ok(t),e===null)throw Error(K(387));n=t.pendingProps,a=t.memoizedState,i=a.element,C_(e,t),Ff(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Zo(Error(K(423)),t),t=Z0(e,t,n,r,i);break e}else if(n!==i){i=Zo(Error(K(424)),t),t=Z0(e,t,n,r,i);break e}else for(hr=Ni(t.stateNode.containerInfo.firstChild),pr=t,Fe=!0,Yr=null,r=T_(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Qo(),n===i){t=Wn(e,t,r);break e}Ft(e,t,n,r)}t=t.child}return t;case 5:return M_(t),e===null&&wv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,vv(n,i)?o=null:a!==null&&vv(n,a)&&(t.flags|=32),ak(e,t),Ft(e,t,o,r),t.child;case 6:return e===null&&wv(t),null;case 13:return sk(e,t,r);case 4:return vx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Yo(t,null,n,r):Ft(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Q0(e,t,n,i,r);case 7:return Ft(e,t,t.pendingProps,r),t.child;case 8:return Ft(e,t,t.pendingProps.children,r),t.child;case 12:return Ft(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Ce(If,n._currentValue),n._currentValue=o,a!==null)if(tn(a.value,o)){if(a.children===i.children&&!er.current){t=Wn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Ln(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Sv(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(K(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Sv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ft(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,No(t,r),i=Rr(i),n=n(i),t.flags|=1,Ft(e,t,n,r),t.child;case 14:return n=t.type,i=Wr(n,t.pendingProps),i=Wr(n.type,i),Y0(e,t,n,i,r);case 15:return nk(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),vf(e,t),t.tag=1,tr(n)?(e=!0,Mf(t)):e=!1,No(t,r),ek(t,n,i),Ov(t,n,i,r),kv(null,t,n,!0,e,r);case 19:return lk(e,t,r);case 22:return ik(e,t,r)}throw Error(K(156,t.tag))};function Ok(e,t){return XP(e,t)}function ZC(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(e,t,r,n){return new ZC(e,t,r,n)}function Tx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JC(e){if(typeof e=="function")return Tx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yg)return 11;if(e===Xg)return 14}return 2}function Mi(e,t){var r=e.alternate;return r===null?(r=Tr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function xf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")Tx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case uo:return $a(r.children,i,a,t);case Qg:o=8,i|=8;break;case Gm:return e=Tr(12,r,t,i|2),e.elementType=Gm,e.lanes=a,e;case Qm:return e=Tr(13,r,t,i),e.elementType=Qm,e.lanes=a,e;case Ym:return e=Tr(19,r,t,i),e.elementType=Ym,e.lanes=a,e;case MP:return Sh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $P:o=10;break e;case CP:o=9;break e;case Yg:o=11;break e;case Xg:o=14;break e;case si:o=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Tr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function $a(e,t,r,n){return e=Tr(7,e,n,t),e.lanes=r,e}function Sh(e,t,r,n){return e=Tr(22,e,n,t),e.elementType=MP,e.lanes=r,e.stateNode={isHidden:!1},e}function tm(e,t,r){return e=Tr(6,e,null,t),e.lanes=r,e}function rm(e,t,r){return t=Tr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function eM(e,t,r,n,i){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=Dp(0),this.expirationTimes=Dp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dp(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $x(e,t,r,n,i,a,o,s,l){return e=new eM(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Tr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},mx(a),e}function tM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ak)}catch(e){console.error(e)}}Ak(),AP.exports=br;var oM=AP.exports,cw=oM;Km.createRoot=cw.createRoot,Km.hydrateRoot=cw.hydrateRoot;var fc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hi,zg,sP,lM=(sP=class{constructor(){ne(this,hi,sM);ne(this,zg,!1)}setTimeoutProvider(e){Y(this,hi,e)}setTimeout(e,t){return $(this,hi).setTimeout(e,t)}clearTimeout(e){$(this,hi).clearTimeout(e)}setInterval(e,t){return $(this,hi).setInterval(e,t)}clearInterval(e){$(this,hi).clearInterval(e)}},hi=new WeakMap,zg=new WeakMap,sP),ma=new lM;function uM(e){setTimeout(e,0)}var za=typeof window>"u"||"Deno"in globalThis;function Yt(){}function cM(e,t){return typeof e=="function"?e(t):e}function Fv(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ek(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ri(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function fw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==Dx(o,t.options))return!1}else if(!pu(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function dw(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(hu(t.options.mutationKey)!==hu(a))return!1}else if(!pu(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Dx(e,t){return((t==null?void 0:t.queryKeyHashFn)||hu)(e)}function hu(e){return JSON.stringify(e,(t,r)=>zv(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function pu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pu(e[r],t[r])):!1}var fM=Object.prototype.hasOwnProperty;function Nk(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=hw(e)&&hw(t);if(!n&&!(zv(e)&&zv(t)))return t;const a=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),s=o.length,l=n?new Array(s):{};let u=0;for(let f=0;f{ma.setTimeout(t,e)})}function Uv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Nk(e,t):t}function hM(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function pM(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ix=Symbol();function Tk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ix?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $k(e,t){return typeof e=="function"?e(...t):!!e}function mM(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Sa,pi,Ro,lP,vM=(lP=class extends fc{constructor(){super();ne(this,Sa);ne(this,pi);ne(this,Ro);Y(this,Ro,t=>{if(!za&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){$(this,pi)||this.setEventListener($(this,Ro))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,pi))==null||t.call(this),Y(this,pi,void 0))}setEventListener(t){var r;Y(this,Ro,t),(r=$(this,pi))==null||r.call(this),Y(this,pi,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){$(this,Sa)!==t&&(Y(this,Sa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof $(this,Sa)=="boolean"?$(this,Sa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Sa=new WeakMap,pi=new WeakMap,Ro=new WeakMap,lP),Lx=new vM;function qv(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var yM=uM;function gM(){let e=[],t=0,r=s=>{s()},n=s=>{s()},i=yM;const a=s=>{t?e.push(s):i(()=>{r(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{i=s}}}var Pt=gM(),Do,mi,Io,uP,xM=(uP=class extends fc{constructor(){super();ne(this,Do,!0);ne(this,mi);ne(this,Io);Y(this,Io,t=>{if(!za&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){$(this,mi)||this.setEventListener($(this,Io))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,mi))==null||t.call(this),Y(this,mi,void 0))}setEventListener(t){var r;Y(this,Io,t),(r=$(this,mi))==null||r.call(this),Y(this,mi,t(this.setOnline.bind(this)))}setOnline(t){$(this,Do)!==t&&(Y(this,Do,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return $(this,Do)}},Do=new WeakMap,mi=new WeakMap,Io=new WeakMap,uP),Gf=new xM;function bM(e){return Math.min(1e3*2**e,3e4)}function Ck(e){return(e??"online")==="online"?Gf.isOnline():!0}var Wv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Mk(e){let t=!1,r=0,n;const i=qv(),a=()=>i.status!=="pending",o=m=>{var y;if(!a()){const b=new Wv(m);h(b),(y=e.onCancel)==null||y.call(e,b)}},s=()=>{t=!0},l=()=>{t=!1},u=()=>Lx.isFocused()&&(e.networkMode==="always"||Gf.isOnline())&&e.canRun(),f=()=>Ck(e.networkMode)&&e.canRun(),d=m=>{a()||(n==null||n(),i.resolve(m))},h=m=>{a()||(n==null||n(),i.reject(m))},p=()=>new Promise(m=>{var y;n=b=>{(a()||u())&&m(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;n=void 0,a()||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(a())return;let m;const y=r===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{var j;if(a())return;const g=e.retry??(za?0:3),x=e.retryDelay??bM,S=typeof x=="function"?x(r,b):x,w=g===!0||typeof g=="number"&&ru()?void 0:p()).then(()=>{t?h(b):v()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n==null||n(),i),cancelRetry:s,continueRetry:l,canStart:f,start:()=>(f()?v():p().then(v),i)}}var ja,cP,Rk=(cP=class{constructor(){ne(this,ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fv(this.gcTime)&&Y(this,ja,ma.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(za?1/0:5*60*1e3))}clearGcTimeout(){$(this,ja)&&(ma.clearTimeout($(this,ja)),Y(this,ja,void 0))}},ja=new WeakMap,cP),Oa,Lo,_r,Pa,yt,tc,_a,Hr,_n,fP,wM=(fP=class extends Rk{constructor(t){super();ne(this,Hr);ne(this,Oa);ne(this,Lo);ne(this,_r);ne(this,Pa);ne(this,yt);ne(this,tc);ne(this,_a);Y(this,_a,!1),Y(this,tc,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,Pa,t.client),Y(this,_r,$(this,Pa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,Oa,vw(this.options)),this.state=t.state??$(this,Oa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,yt))==null?void 0:t.promise}setOptions(t){if(this.options={...$(this,tc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=vw(this.options);r.data!==void 0&&(this.setState(mw(r.data,r.dataUpdatedAt)),Y(this,Oa,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,_r).remove(this)}setData(t,r){const n=Uv(this.state.data,t,this.options);return he(this,Hr,_n).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){he(this,Hr,_n).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=$(this,yt))==null?void 0:n.promise;return(i=$(this,yt))==null||i.cancel(t),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($(this,Oa))}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ix||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ri(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ek(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=$(this,yt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=$(this,yt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,_r).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||($(this,yt)&&($(this,_a)?$(this,yt).cancel({revert:!0}):$(this,yt).cancelRetry()),this.scheduleGc()),$(this,_r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,Hr,_n).call(this,{type:"invalidate"})}async fetch(t,r){var l,u,f,d,h,p,v,m,y,b,g,x;if(this.state.fetchStatus!=="idle"&&((l=$(this,yt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if($(this,yt))return $(this,yt).continueRetry(),$(this,yt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(w=>w.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Y(this,_a,!0),n.signal)})},a=()=>{const S=Tk(this.options,r),j=(()=>{const O={client:$(this,Pa),queryKey:this.queryKey,meta:this.meta};return i(O),O})();return Y(this,_a,!1),this.options.persister?this.options.persister(S,j,this):S(j)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:$(this,Pa),state:this.state,fetchFn:a};return i(S),S})();(u=this.options.behavior)==null||u.onFetch(s,this),Y(this,Lo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&he(this,Hr,_n).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta}),Y(this,yt,Mk({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof Wv&&S.revert&&this.setState({...$(this,Lo),fetchStatus:"idle"}),n.abort()},onFail:(S,w)=>{he(this,Hr,_n).call(this,{type:"failed",failureCount:S,error:w})},onPause:()=>{he(this,Hr,_n).call(this,{type:"pause"})},onContinue:()=>{he(this,Hr,_n).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await $(this,yt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(h=$(this,_r).config).onSuccess)==null||p.call(h,S,this),(m=(v=$(this,_r).config).onSettled)==null||m.call(v,S,this.state.error,this),S}catch(S){if(S instanceof Wv){if(S.silent)return $(this,yt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw he(this,Hr,_n).call(this,{type:"error",error:S}),(b=(y=$(this,_r).config).onError)==null||b.call(y,S,this),(x=(g=$(this,_r).config).onSettled)==null||x.call(g,this.state.data,S,this),S}finally{this.scheduleGc()}}},Oa=new WeakMap,Lo=new WeakMap,_r=new WeakMap,Pa=new WeakMap,yt=new WeakMap,tc=new WeakMap,_a=new WeakMap,Hr=new WeakSet,_n=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Dk(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...mw(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,Lo,t.manual?i:void 0),i;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Pt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),$(this,_r).notify({query:this,type:"updated",action:t})})},fP);function Dk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ck(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function mw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Qt,pe,rc,Dt,ka,Fo,Nn,vi,nc,Bo,zo,Aa,Ea,yi,Uo,we,El,Hv,Kv,Vv,Gv,Qv,Yv,Xv,Ik,dP,SM=(dP=class extends fc{constructor(t,r){super();ne(this,we);ne(this,Qt);ne(this,pe);ne(this,rc);ne(this,Dt);ne(this,ka);ne(this,Fo);ne(this,Nn);ne(this,vi);ne(this,nc);ne(this,Bo);ne(this,zo);ne(this,Aa);ne(this,Ea);ne(this,yi);ne(this,Uo,new Set);this.options=r,Y(this,Qt,t),Y(this,vi,null),Y(this,Nn,qv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,pe).addObserver(this),yw($(this,pe),this.options)?he(this,we,El).call(this):this.updateResult(),he(this,we,Gv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zv($(this,pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zv($(this,pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,we,Qv).call(this),he(this,we,Yv).call(this),$(this,pe).removeObserver(this)}setOptions(t){const r=this.options,n=$(this,pe);if(this.options=$(this,Qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,$(this,pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,we,Xv).call(this),$(this,pe).setOptions(this.options),r._defaulted&&!Bv(this.options,r)&&$(this,Qt).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,pe),observer:this});const i=this.hasListeners();i&&gw($(this,pe),n,this.options,r)&&he(this,we,El).call(this),this.updateResult(),i&&($(this,pe)!==n||kr(this.options.enabled,$(this,pe))!==kr(r.enabled,$(this,pe))||Ri(this.options.staleTime,$(this,pe))!==Ri(r.staleTime,$(this,pe)))&&he(this,we,Hv).call(this);const a=he(this,we,Kv).call(this);i&&($(this,pe)!==n||kr(this.options.enabled,$(this,pe))!==kr(r.enabled,$(this,pe))||a!==$(this,yi))&&he(this,we,Vv).call(this,a)}getOptimisticResult(t){const r=$(this,Qt).getQueryCache().build($(this,Qt),t),n=this.createResult(r,t);return OM(this,n)&&(Y(this,Dt,n),Y(this,Fo,this.options),Y(this,ka,$(this,pe).state)),n}getCurrentResult(){return $(this,Dt)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&$(this,Nn).status==="pending"&&$(this,Nn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){$(this,Uo).add(t)}getCurrentQuery(){return $(this,pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=$(this,Qt).defaultQueryOptions(t),n=$(this,Qt).getQueryCache().build($(this,Qt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return he(this,we,El).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,Dt)))}createResult(t,r){var A;const n=$(this,pe),i=this.options,a=$(this,Dt),o=$(this,ka),s=$(this,Fo),u=t!==n?t.state:$(this,rc),{state:f}=t;let d={...f},h=!1,p;if(r._optimisticResults){const E=this.hasListeners(),N=!E&&yw(t,r),T=E&&gw(t,n,r,i);(N||T)&&(d={...d,...Dk(f.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:m,status:y}=d;p=d.data;let b=!1;if(r.placeholderData!==void 0&&p===void 0&&y==="pending"){let E;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(E=a.data,b=!0):E=typeof r.placeholderData=="function"?r.placeholderData((A=$(this,zo))==null?void 0:A.state.data,$(this,zo)):r.placeholderData,E!==void 0&&(y="success",p=Uv(a==null?void 0:a.data,E,r),h=!0)}if(r.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&r.select===$(this,nc))p=$(this,Bo);else try{Y(this,nc,r.select),p=r.select(p),p=Uv(a==null?void 0:a.data,p,r),Y(this,Bo,p),Y(this,vi,null)}catch(E){Y(this,vi,E)}$(this,vi)&&(v=$(this,vi),p=$(this,Bo),m=Date.now(),y="error");const g=d.fetchStatus==="fetching",x=y==="pending",S=y==="error",w=x&&g,j=p!==void 0,P={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:S,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!x,isLoadingError:S&&!j,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&j,isStale:Fx(t,r),refetch:this.refetch,promise:$(this,Nn),isEnabled:kr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=P.data!==void 0,N=P.status==="error"&&!E,T=D=>{N?D.reject(P.error):E&&D.resolve(P.data)},M=()=>{const D=Y(this,Nn,P.promise=qv());T(D)},R=$(this,Nn);switch(R.status){case"pending":t.queryHash===n.queryHash&&T(R);break;case"fulfilled":(N||P.data!==R.value)&&M();break;case"rejected":(!N||P.error!==R.reason)&&M();break}}return P}updateResult(){const t=$(this,Dt),r=this.createResult($(this,pe),this.options);if(Y(this,ka,$(this,pe).state),Y(this,Fo,this.options),$(this,ka).data!==void 0&&Y(this,zo,$(this,pe)),Bv(r,t))return;Y(this,Dt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!$(this,Uo).size)return!0;const o=new Set(a??$(this,Uo));return this.options.throwOnError&&o.add("error"),Object.keys($(this,Dt)).some(s=>{const l=s;return $(this,Dt)[l]!==t[l]&&o.has(l)})};he(this,we,Ik).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,we,Gv).call(this)}},Qt=new WeakMap,pe=new WeakMap,rc=new WeakMap,Dt=new WeakMap,ka=new WeakMap,Fo=new WeakMap,Nn=new WeakMap,vi=new WeakMap,nc=new WeakMap,Bo=new WeakMap,zo=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,yi=new WeakMap,Uo=new WeakMap,we=new WeakSet,El=function(t){he(this,we,Xv).call(this);let r=$(this,pe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Yt)),r},Hv=function(){he(this,we,Qv).call(this);const t=Ri(this.options.staleTime,$(this,pe));if(za||$(this,Dt).isStale||!Fv(t))return;const n=Ek($(this,Dt).dataUpdatedAt,t)+1;Y(this,Aa,ma.setTimeout(()=>{$(this,Dt).isStale||this.updateResult()},n))},Kv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,pe)):this.options.refetchInterval)??!1},Vv=function(t){he(this,we,Yv).call(this),Y(this,yi,t),!(za||kr(this.options.enabled,$(this,pe))===!1||!Fv($(this,yi))||$(this,yi)===0)&&Y(this,Ea,ma.setInterval(()=>{(this.options.refetchIntervalInBackground||Lx.isFocused())&&he(this,we,El).call(this)},$(this,yi)))},Gv=function(){he(this,we,Hv).call(this),he(this,we,Vv).call(this,he(this,we,Kv).call(this))},Qv=function(){$(this,Aa)&&(ma.clearTimeout($(this,Aa)),Y(this,Aa,void 0))},Yv=function(){$(this,Ea)&&(ma.clearInterval($(this,Ea)),Y(this,Ea,void 0))},Xv=function(){const t=$(this,Qt).getQueryCache().build($(this,Qt),this.options);if(t===$(this,pe))return;const r=$(this,pe);Y(this,pe,t),Y(this,rc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Ik=function(t){Pt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r($(this,Dt))}),$(this,Qt).getQueryCache().notify({query:$(this,pe),type:"observerResultsUpdated"})})},dP);function jM(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function yw(e,t){return jM(e,t)||e.state.data!==void 0&&Zv(e,t,t.refetchOnMount)}function Zv(e,t,r){if(kr(t.enabled,e)!==!1&&Ri(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Fx(e,t)}return!1}function gw(e,t,r,n){return(e!==t||kr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Fx(e,r)}function Fx(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(Ri(t.staleTime,e))}function OM(e,t){return!Bv(e.getCurrentResult(),t)}function xw(e){return{onFetch:(t,r)=>{var f,d,h,p,v;const n=t.options,i=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const y=x=>{mM(x,()=>t.signal,()=>m=!0)},b=Tk(t.options,t.fetchOptions),g=async(x,S,w)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const O=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};return y(N),N})(),P=await b(O),{maxPages:A}=t.options,E=w?pM:hM;return{pages:E(x.pages,P,A),pageParams:E(x.pageParams,S,A)}};if(i&&a.length){const x=i==="backward",S=x?PM:bw,w={pages:a,pageParams:o},j=S(n,w);s=await g(w,j,x)}else{const x=e??a.length;do{const S=l===0?o[0]??n.initialPageParam:bw(n,s);if(l>0&&S==null)break;s=await g(s,S),l++}while(l{var m,y;return(y=(m=t.options).persister)==null?void 0:y.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function bw(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function PM(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ic,un,It,Na,cn,ai,hP,_M=(hP=class extends Rk{constructor(t){super();ne(this,cn);ne(this,ic);ne(this,un);ne(this,It);ne(this,Na);Y(this,ic,t.client),this.mutationId=t.mutationId,Y(this,It,t.mutationCache),Y(this,un,[]),this.state=t.state||kM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,un).includes(t)||($(this,un).push(t),this.clearGcTimeout(),$(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,un,$(this,un).filter(r=>r!==t)),this.scheduleGc(),$(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,un).length||(this.state.status==="pending"?this.scheduleGc():$(this,It).remove(this))}continue(){var t;return((t=$(this,Na))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,l,u,f,d,h,p,v,m,y,b,g,x,S,w,j,O,P,A;const r=()=>{he(this,cn,ai).call(this,{type:"continue"})},n={client:$(this,ic),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,Na,Mk({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(E,N)=>{he(this,cn,ai).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{he(this,cn,ai).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,It).canRun(this)}));const i=this.state.status==="pending",a=!$(this,Na).canStart();try{if(i)r();else{he(this,cn,ai).call(this,{type:"pending",variables:t,isPaused:a}),await((s=(o=$(this,It).config).onMutate)==null?void 0:s.call(o,t,this,n));const N=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,n));N!==this.state.context&&he(this,cn,ai).call(this,{type:"pending",context:N,variables:t,isPaused:a})}const E=await $(this,Na).start();return await((d=(f=$(this,It).config).onSuccess)==null?void 0:d.call(f,E,t,this.state.context,this,n)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,E,t,this.state.context,n)),await((m=(v=$(this,It).config).onSettled)==null?void 0:m.call(v,E,null,this.state.variables,this.state.context,this,n)),await((b=(y=this.options).onSettled)==null?void 0:b.call(y,E,null,t,this.state.context,n)),he(this,cn,ai).call(this,{type:"success",data:E}),E}catch(E){try{await((x=(g=$(this,It).config).onError)==null?void 0:x.call(g,E,t,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((w=(S=this.options).onError)==null?void 0:w.call(S,E,t,this.state.context,n))}catch(N){Promise.reject(N)}try{await((O=(j=$(this,It).config).onSettled)==null?void 0:O.call(j,void 0,E,this.state.variables,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,E,t,this.state.context,n))}catch(N){Promise.reject(N)}throw he(this,cn,ai).call(this,{type:"error",error:E}),E}finally{$(this,It).runNext(this)}}},ic=new WeakMap,un=new WeakMap,It=new WeakMap,Na=new WeakMap,cn=new WeakSet,ai=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Pt.batch(()=>{$(this,un).forEach(n=>{n.onMutationUpdate(t)}),$(this,It).notify({mutation:this,type:"updated",action:t})})},hP);function kM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tn,Kr,ac,pP,AM=(pP=class extends fc{constructor(t={}){super();ne(this,Tn);ne(this,Kr);ne(this,ac);this.config=t,Y(this,Tn,new Set),Y(this,Kr,new Map),Y(this,ac,0)}build(t,r,n){const i=new _M({client:t,mutationCache:this,mutationId:++Pc(this,ac)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){$(this,Tn).add(t);const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r);n?n.push(t):$(this,Kr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,Tn).delete(t)){const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&$(this,Kr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Wc(t);if(typeof r=="string"){const i=(n=$(this,Kr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Pt.batch(()=>{$(this,Tn).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,Tn).clear(),$(this,Kr).clear()})}getAll(){return Array.from($(this,Tn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>dw(r,n))}findAll(t={}){return this.getAll().filter(r=>dw(t,r))}notify(t){Pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Pt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Yt))))}},Tn=new WeakMap,Kr=new WeakMap,ac=new WeakMap,pP);function Wc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var fn,mP,EM=(mP=class extends fc{constructor(t={}){super();ne(this,fn);this.config=t,Y(this,fn,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??Dx(i,r);let o=this.get(a);return o||(o=new wM({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){$(this,fn).has(t.queryHash)||($(this,fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=$(this,fn).get(t.queryHash);r&&(t.destroy(),r===t&&$(this,fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,fn).get(t)}getAll(){return[...$(this,fn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>fw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>fw(t,n)):r}notify(t){Pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Pt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fn=new WeakMap,mP),He,gi,xi,qo,Wo,bi,Ho,Ko,vP,NM=(vP=class{constructor(e={}){ne(this,He);ne(this,gi);ne(this,xi);ne(this,qo);ne(this,Wo);ne(this,bi);ne(this,Ho);ne(this,Ko);Y(this,He,e.queryCache||new EM),Y(this,gi,e.mutationCache||new AM),Y(this,xi,e.defaultOptions||{}),Y(this,qo,new Map),Y(this,Wo,new Map),Y(this,bi,0)}mount(){Pc(this,bi)._++,$(this,bi)===1&&(Y(this,Ho,Lx.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,He).onFocus())})),Y(this,Ko,Gf.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,He).onOnline())})))}unmount(){var e,t;Pc(this,bi)._--,$(this,bi)===0&&((e=$(this,Ho))==null||e.call(this),Y(this,Ho,void 0),(t=$(this,Ko))==null||t.call(this),Y(this,Ko,void 0))}isFetching(e){return $(this,He).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,gi).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=$(this,He).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=$(this,He).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ri(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return $(this,He).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=$(this,He).get(n.queryHash),a=i==null?void 0:i.state.data,o=cM(t,a);if(o!==void 0)return $(this,He).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Pt.batch(()=>$(this,He).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=$(this,He).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=$(this,He);Pt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=$(this,He);return Pt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Pt.batch(()=>$(this,He).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Yt).catch(Yt)}invalidateQueries(e,t={}){return Pt.batch(()=>($(this,He).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Pt.batch(()=>$(this,He).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Yt)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=$(this,He).build(this,t);return r.isStaleByTime(Ri(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yt).catch(Yt)}fetchInfiniteQuery(e){return e.behavior=xw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yt).catch(Yt)}ensureInfiniteQueryData(e){return e.behavior=xw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Gf.isOnline()?$(this,gi).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,He)}getMutationCache(){return $(this,gi)}getDefaultOptions(){return $(this,xi)}setDefaultOptions(e){Y(this,xi,e)}setQueryDefaults(e,t){$(this,qo).set(hu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,qo).values()],r={};return t.forEach(n=>{pu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){$(this,Wo).set(hu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,Wo).values()],r={};return t.forEach(n=>{pu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,xi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Dx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ix&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,xi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,He).clear(),$(this,gi).clear()}},He=new WeakMap,gi=new WeakMap,xi=new WeakMap,qo=new WeakMap,Wo=new WeakMap,bi=new WeakMap,Ho=new WeakMap,Ko=new WeakMap,vP),Lk=k.createContext(void 0),TM=e=>{const t=k.useContext(Lk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$M=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Lk.Provider,{value:e,children:t})),Fk=k.createContext(!1),CM=()=>k.useContext(Fk);Fk.Provider;function MM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var RM=k.createContext(MM()),DM=()=>k.useContext(RM),IM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?$k(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},LM=e=>{k.useEffect(()=>{e.clearReset()},[e])},FM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||$k(r,[e.error,n])),BM=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},zM=(e,t)=>e.isLoading&&e.isFetching&&!t,UM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ww=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function qM(e,t,r){var h,p,v,m;const n=CM(),i=DM(),a=TM(),o=a.defaultQueryOptions(e);(p=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,o);const s=a.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",BM(o),IM(o,i,s),LM(i);const l=!a.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(y=>{const b=d?u.subscribe(Pt.batchCalls(y)):Yt;return u.updateResult(),b},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),UM(o,f))throw ww(o,u,i);if(FM({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;if((m=(v=a.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||m.call(v,o,f),o.experimental_prefetchInRender&&!za&&zM(f,n)){const y=l?ww(o,u,i):s==null?void 0:s.promise;y==null||y.catch(Yt).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?f:u.trackResult(f)}function Qe(e,t){return qM(e,SM)}/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Fx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function WM(){return Math.random().toString(36).substr(2,8)}function Sw(e,t){return{usr:e.state,key:e.key,idx:t}}function Zv(e,t,r,n){return r===void 0&&(r=null),mu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rs(t):t,{state:r,key:t&&t.key||n||WM()})}function Qf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Rs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function HM(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=ji.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(mu({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){s=ji.Pop;let y=f(),b=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:b})}function h(y,b){s=ji.Push;let g=Zv(m.location,y,b);u=f()+1;let x=Sw(g,u),S=m.createHref(g);try{o.pushState(x,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function p(y,b){s=ji.Replace;let g=Zv(m.location,y,b);u=f();let x=Sw(g,u),S=m.createHref(g);o.replaceState(x,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function v(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,g=typeof y=="string"?y:Qf(y);return g=g.replace(/ $/,"%20"),rt(b,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,b)}let m={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(ww,d),l=y,()=>{i.removeEventListener(ww,d),l=null}},createHref(y){return t(i,y)},createURL:v,encodeLocation(y){let b=v(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var jw;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(jw||(jw={}));function KM(e,t,r){return r===void 0&&(r="/"),VM(e,t,r)}function VM(e,t,r,n){let i=typeof t=="string"?Rs(t):t,a=Bx(i.pathname||"/",r);if(a==null)return null;let o=Fk(e);GM(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(rt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Di([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(rt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Fk(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:tR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of Bk(a.path))i(a,o,l)}),t}function Bk(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=Bk(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function GM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:rR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const QM=/^:[\w-]+$/,YM=3,XM=2,ZM=1,JM=10,eR=-2,Ow=e=>e==="*";function tR(e,t){let r=e.split("/"),n=r.length;return r.some(Ow)&&(n+=eR),t&&(n+=XM),r.filter(i=>!Ow(i)).reduce((i,a)=>i+(QM.test(a)?YM:a===""?ZM:JM),n)}function rR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function nR(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:h,isOptional:p}=f;if(h==="*"){let m=s[d]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const v=s[d];return p&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function aR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Fx(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function oR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fx(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Bx(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const sR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lR=e=>sR.test(e);function uR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Rs(e):e,a;if(r)if(lR(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),Fx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=Pw(r.substring(1),"/"):a=Pw(r,t)}else a=t;return{pathname:a,search:dR(n),hash:hR(i)}}function Pw(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function nm(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function cR(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function zk(e,t){let r=cR(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Uk(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Rs(e):(i=mu({},e),rt(!i.pathname||!i.pathname.includes("?"),nm("?","pathname","search",i)),rt(!i.pathname||!i.pathname.includes("#"),nm("#","pathname","hash",i)),rt(!i.search||!i.search.includes("#"),nm("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=uR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Di=e=>e.join("/").replace(/\/\/+/g,"/"),fR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),dR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function pR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qk=["post","put","patch","delete"];new Set(qk);const mR=["get",...qk];new Set(mR);/** + */function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Bx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function HM(){return Math.random().toString(36).substr(2,8)}function jw(e,t){return{usr:e.state,key:e.key,idx:t}}function Jv(e,t,r,n){return r===void 0&&(r=null),mu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rs(t):t,{state:r,key:t&&t.key||n||HM()})}function Qf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Rs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function KM(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=ji.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(mu({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){s=ji.Pop;let y=f(),b=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:b})}function h(y,b){s=ji.Push;let g=Jv(m.location,y,b);u=f()+1;let x=jw(g,u),S=m.createHref(g);try{o.pushState(x,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function p(y,b){s=ji.Replace;let g=Jv(m.location,y,b);u=f();let x=jw(g,u),S=m.createHref(g);o.replaceState(x,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function v(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,g=typeof y=="string"?y:Qf(y);return g=g.replace(/ $/,"%20"),rt(b,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,b)}let m={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Sw,d),l=y,()=>{i.removeEventListener(Sw,d),l=null}},createHref(y){return t(i,y)},createURL:v,encodeLocation(y){let b=v(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var Ow;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ow||(Ow={}));function VM(e,t,r){return r===void 0&&(r="/"),GM(e,t,r)}function GM(e,t,r,n){let i=typeof t=="string"?Rs(t):t,a=zx(i.pathname||"/",r);if(a==null)return null;let o=Bk(e);QM(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(rt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Di([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(rt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Bk(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:rR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of zk(a.path))i(a,o,l)}),t}function zk(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=zk(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function QM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:nR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const YM=/^:[\w-]+$/,XM=3,ZM=2,JM=1,eR=10,tR=-2,Pw=e=>e==="*";function rR(e,t){let r=e.split("/"),n=r.length;return r.some(Pw)&&(n+=tR),t&&(n+=ZM),r.filter(i=>!Pw(i)).reduce((i,a)=>i+(YM.test(a)?XM:a===""?JM:eR),n)}function nR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function iR(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:h,isOptional:p}=f;if(h==="*"){let m=s[d]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const v=s[d];return p&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function oR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Bx(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function sR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bx(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function zx(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const lR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uR=e=>lR.test(e);function cR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Rs(e):e,a;if(r)if(uR(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),Bx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=_w(r.substring(1),"/"):a=_w(r,t)}else a=t;return{pathname:a,search:hR(n),hash:pR(i)}}function _w(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function nm(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function fR(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Uk(e,t){let r=fR(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function qk(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Rs(e):(i=mu({},e),rt(!i.pathname||!i.pathname.includes("?"),nm("?","pathname","search",i)),rt(!i.pathname||!i.pathname.includes("#"),nm("#","pathname","hash",i)),rt(!i.search||!i.search.includes("#"),nm("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=cR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Di=e=>e.join("/").replace(/\/\/+/g,"/"),dR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function mR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Wk=["post","put","patch","delete"];new Set(Wk);const vR=["get",...Wk];new Set(vR);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),k.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let d=Uk(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Di([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,o,a,e])}function xR(){let{matches:e}=k.useContext(Ki),t=e[e.length-1];return t?t.params:{}}function Kk(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=k.useContext(Ya),{matches:i}=k.useContext(Ki),{pathname:a}=Vi(),o=JSON.stringify(zk(i,n.v7_relativeSplatPath));return k.useMemo(()=>Uk(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function bR(e,t){return wR(e,t)}function wR(e,t,r,n){dc()||rt(!1);let{navigator:i}=k.useContext(Ya),{matches:a}=k.useContext(Ki),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Vi(),f;if(t){var d;let y=typeof t=="string"?Rs(t):t;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||rt(!1),f=y}else f=u;let h=f.pathname||"/",p=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=KM(e,{pathname:p}),m=_R(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Di([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Di([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?k.createElement(kh.Provider,{value:{location:vu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:ji.Pop}},m):m}function SR(){let e=NR(),t=pR(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),r?k.createElement("pre",{style:i},r):null,null)}const jR=k.createElement(SR,null);class OR extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?k.createElement(Ki.Provider,{value:this.props.routeContext},k.createElement(Wk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function PR(e){let{routeContext:t,match:r,children:n}=e,i=k.useContext(zx);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),k.createElement(Ki.Provider,{value:t},n)}function _R(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||rt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,h)=>{let p,v=!1,m=null,y=null;r&&(p=s&&d.route.id?s[d.route.id]:void 0,m=d.route.errorElement||jR,l&&(u<0&&h===0?($R("route-fallback"),v=!0,y=null):u===h&&(v=!0,y=d.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,h+1)),g=()=>{let x;return p?x=m:v?x=y:d.route.Component?x=k.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,k.createElement(PR,{match:d,routeContext:{outlet:f,matches:b,isDataRoute:r!=null},children:x})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?k.createElement(OR,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):g()},null)}var Vk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Vk||{}),Gk=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Gk||{});function kR(e){let t=k.useContext(zx);return t||rt(!1),t}function AR(e){let t=k.useContext(vR);return t||rt(!1),t}function ER(e){let t=k.useContext(Ki);return t||rt(!1),t}function Qk(e){let t=ER(),r=t.matches[t.matches.length-1];return r.route.id||rt(!1),r.route.id}function NR(){var e;let t=k.useContext(Wk),r=AR(),n=Qk();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function TR(){let{router:e}=kR(Vk.UseNavigateStable),t=Qk(Gk.UseNavigateStable),r=k.useRef(!1);return Hk(()=>{r.current=!0}),k.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,vu({fromRouteId:t},a)))},[e,t])}const _w={};function $R(e,t,r){_w[e]||(_w[e]=!0)}function CR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function qr(e){rt(!1)}function MR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=ji.Pop,navigator:a,static:o=!1,future:s}=e;dc()&&rt(!1);let l=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:a,static:o,future:vu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=Rs(n));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:v="default"}=n,m=k.useMemo(()=>{let y=Bx(f,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:p,key:v},navigationType:i}},[l,f,d,h,p,v,i]);return m==null?null:k.createElement(Ya.Provider,{value:u},k.createElement(kh.Provider,{children:r,value:m}))}function RR(e){let{children:t,location:r}=e;return bR(Jv(t),r)}new Promise(()=>{});function Jv(e,t){t===void 0&&(t=[]);let r=[];return k.Children.forEach(e,(n,i)=>{if(!k.isValidElement(n))return;let a=[...t,i];if(n.type===k.Fragment){r.push.apply(r,Jv(n.props.children,a));return}n.type!==qr&&rt(!1),!n.props.index||!n.props.children||rt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Jv(n.props.children,a)),r.push(o)}),r}/** + */function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),k.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let d=qk(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Di([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,o,a,e])}function bR(){let{matches:e}=k.useContext(Ki),t=e[e.length-1];return t?t.params:{}}function Vk(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=k.useContext(Ya),{matches:i}=k.useContext(Ki),{pathname:a}=Vi(),o=JSON.stringify(Uk(i,n.v7_relativeSplatPath));return k.useMemo(()=>qk(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function wR(e,t){return SR(e,t)}function SR(e,t,r,n){dc()||rt(!1);let{navigator:i}=k.useContext(Ya),{matches:a}=k.useContext(Ki),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Vi(),f;if(t){var d;let y=typeof t=="string"?Rs(t):t;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||rt(!1),f=y}else f=u;let h=f.pathname||"/",p=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=VM(e,{pathname:p}),m=kR(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Di([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Di([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?k.createElement(kh.Provider,{value:{location:vu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:ji.Pop}},m):m}function jR(){let e=TR(),t=mR(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),r?k.createElement("pre",{style:i},r):null,null)}const OR=k.createElement(jR,null);class PR extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?k.createElement(Ki.Provider,{value:this.props.routeContext},k.createElement(Hk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _R(e){let{routeContext:t,match:r,children:n}=e,i=k.useContext(Ux);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),k.createElement(Ki.Provider,{value:t},n)}function kR(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||rt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,h)=>{let p,v=!1,m=null,y=null;r&&(p=s&&d.route.id?s[d.route.id]:void 0,m=d.route.errorElement||OR,l&&(u<0&&h===0?(CR("route-fallback"),v=!0,y=null):u===h&&(v=!0,y=d.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,h+1)),g=()=>{let x;return p?x=m:v?x=y:d.route.Component?x=k.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,k.createElement(_R,{match:d,routeContext:{outlet:f,matches:b,isDataRoute:r!=null},children:x})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?k.createElement(PR,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):g()},null)}var Gk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Gk||{}),Qk=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Qk||{});function AR(e){let t=k.useContext(Ux);return t||rt(!1),t}function ER(e){let t=k.useContext(yR);return t||rt(!1),t}function NR(e){let t=k.useContext(Ki);return t||rt(!1),t}function Yk(e){let t=NR(),r=t.matches[t.matches.length-1];return r.route.id||rt(!1),r.route.id}function TR(){var e;let t=k.useContext(Hk),r=ER(),n=Yk();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function $R(){let{router:e}=AR(Gk.UseNavigateStable),t=Yk(Qk.UseNavigateStable),r=k.useRef(!1);return Kk(()=>{r.current=!0}),k.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,vu({fromRouteId:t},a)))},[e,t])}const kw={};function CR(e,t,r){kw[e]||(kw[e]=!0)}function MR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function qr(e){rt(!1)}function RR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=ji.Pop,navigator:a,static:o=!1,future:s}=e;dc()&&rt(!1);let l=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:a,static:o,future:vu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=Rs(n));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:v="default"}=n,m=k.useMemo(()=>{let y=zx(f,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:p,key:v},navigationType:i}},[l,f,d,h,p,v,i]);return m==null?null:k.createElement(Ya.Provider,{value:u},k.createElement(kh.Provider,{children:r,value:m}))}function DR(e){let{children:t,location:r}=e;return wR(ey(t),r)}new Promise(()=>{});function ey(e,t){t===void 0&&(t=[]);let r=[];return k.Children.forEach(e,(n,i)=>{if(!k.isValidElement(n))return;let a=[...t,i];if(n.type===k.Fragment){r.push.apply(r,ey(n.props.children,a));return}n.type!==qr&&rt(!1),!n.props.index||!n.props.children||rt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=ey(n.props.children,a)),r.push(o)}),r}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. @@ -64,22 +64,22 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ey(){return ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function IR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function LR(e,t){return e.button===0&&(!t||t==="_self")&&!IR(e)}function ty(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function FR(e,t){let r=ty(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(a=>{r.append(i,a)})}),r}const BR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],zR="6";try{window.__reactRouterVersion=zR}catch{}const UR="startTransition",kw=GT[UR];function qR(e){let{basename:t,children:r,future:n,window:i}=e,a=k.useRef();a.current==null&&(a.current=qM({window:i,v5Compat:!0}));let o=a.current,[s,l]=k.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=k.useCallback(d=>{u&&kw?kw(()=>l(d)):l(d)},[l,u]);return k.useLayoutEffect(()=>o.listen(f),[o,f]),k.useEffect(()=>CR(n),[n]),k.createElement(MR,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const WR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",HR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,KR=k.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:d}=t,h=DR(t,BR),{basename:p}=k.useContext(Ya),v,m=!1;if(typeof u=="string"&&HR.test(u)&&(v=u,WR))try{let x=new URL(window.location.href),S=u.startsWith("//")?new URL(x.protocol+u):new URL(u),w=Bx(S.pathname,p);S.origin===x.origin&&w!=null?u=w+S.search+S.hash:m=!0}catch{}let y=yR(u,{relative:i}),b=VR(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:d});function g(x){n&&n(x),x.defaultPrevented||b(x)}return k.createElement("a",ey({},h,{href:v||y,onClick:m||a?n:g,ref:r,target:l}))});var Aw;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Aw||(Aw={}));var Ew;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ew||(Ew={}));function VR(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=mt(),u=Vi(),f=Kk(e,{relative:o});return k.useCallback(d=>{if(LR(d,r)){d.preventDefault();let h=n!==void 0?n:Qf(u)===Qf(f);l(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function Ah(e){let t=k.useRef(ty(e)),r=k.useRef(!1),n=Vi(),i=k.useMemo(()=>FR(n.search,r.current?null:t.current),[n.search]),a=mt(),o=k.useCallback((s,l)=>{const u=ty(typeof s=="function"?s(i):s);r.current=!0,a("?"+u,l)},[a,i]);return[i,o]}/** + */function ty(){return ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function LR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function FR(e,t){return e.button===0&&(!t||t==="_self")&&!LR(e)}function ry(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function BR(e,t){let r=ry(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(a=>{r.append(i,a)})}),r}const zR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],UR="6";try{window.__reactRouterVersion=UR}catch{}const qR="startTransition",Aw=QT[qR];function WR(e){let{basename:t,children:r,future:n,window:i}=e,a=k.useRef();a.current==null&&(a.current=WM({window:i,v5Compat:!0}));let o=a.current,[s,l]=k.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=k.useCallback(d=>{u&&Aw?Aw(()=>l(d)):l(d)},[l,u]);return k.useLayoutEffect(()=>o.listen(f),[o,f]),k.useEffect(()=>MR(n),[n]),k.createElement(RR,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const HR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",KR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,VR=k.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:d}=t,h=IR(t,zR),{basename:p}=k.useContext(Ya),v,m=!1;if(typeof u=="string"&&KR.test(u)&&(v=u,HR))try{let x=new URL(window.location.href),S=u.startsWith("//")?new URL(x.protocol+u):new URL(u),w=zx(S.pathname,p);S.origin===x.origin&&w!=null?u=w+S.search+S.hash:m=!0}catch{}let y=gR(u,{relative:i}),b=GR(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:d});function g(x){n&&n(x),x.defaultPrevented||b(x)}return k.createElement("a",ty({},h,{href:v||y,onClick:m||a?n:g,ref:r,target:l}))});var Ew;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ew||(Ew={}));var Nw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Nw||(Nw={}));function GR(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=mt(),u=Vi(),f=Vk(e,{relative:o});return k.useCallback(d=>{if(FR(d,r)){d.preventDefault();let h=n!==void 0?n:Qf(u)===Qf(f);l(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function Ah(e){let t=k.useRef(ry(e)),r=k.useRef(!1),n=Vi(),i=k.useMemo(()=>BR(n.search,r.current?null:t.current),[n.search]),a=mt(),o=k.useCallback((s,l)=>{const u=ry(typeof s=="function"?s(i):s);r.current=!0,a("?"+u,l)},[a,i]);return[i,o]}/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var GR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var QR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ze=(e,t)=>{const r=k.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>k.createElement("svg",{ref:f,...GR,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:["lucide",`lucide-${QR(e)}`,s].join(" "),...u},[...t.map(([d,h])=>k.createElement(d,h)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** + */const YR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ze=(e,t)=>{const r=k.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>k.createElement("svg",{ref:f,...QR,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:["lucide",`lucide-${YR(e)}`,s].join(" "),...u},[...t.map(([d,h])=>k.createElement(d,h)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YR=Ze("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const XR=Ze("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. @@ -89,22 +89,22 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XR=Ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const ZR=Ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZR=Ze("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + */const JR=Ze("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JR=Ze("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/** + */const eD=Ze("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eD=Ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const tD=Ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. @@ -119,12 +119,12 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tD=Ze("Code2",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const rD=Ze("Code2",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rD=Ze("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const nD=Ze("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. @@ -134,37 +134,37 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nD=Ze("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** + */const iD=Ze("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iD=Ze("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** + */const aD=Ze("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aD=Ze("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + */const oD=Ze("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oD=Ze("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/** + */const sD=Ze("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sD=Ze("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/** + */const lD=Ze("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yk=Ze("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const Xk=Ze("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lD=Ze("Printer",[["polyline",{points:"6 9 6 2 18 2 18 9",key:"1306q4"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["rect",{width:"12",height:"8",x:"6",y:"14",key:"5ipwut"}]]);/** + */const uD=Ze("Printer",[["polyline",{points:"6 9 6 2 18 2 18 9",key:"1306q4"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["rect",{width:"12",height:"8",x:"6",y:"14",key:"5ipwut"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. @@ -174,19 +174,19 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uD=Ze("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const cD=Ze("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xk=Ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Zk(e,t){return function(){return e.apply(t,arguments)}}const{toString:cD}=Object.prototype,{getPrototypeOf:Ux}=Object,{iterator:Nh,toStringTag:Jk}=Symbol,Th=(e=>t=>{const r=cD.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),rn=e=>(e=e.toLowerCase(),t=>Th(t)===e),$h=e=>t=>typeof t===e,{isArray:Ds}=Array,es=$h("undefined");function hc(e){return e!==null&&!es(e)&&e.constructor!==null&&!es(e.constructor)&&nr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const eA=rn("ArrayBuffer");function fD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&eA(e.buffer),t}const dD=$h("string"),nr=$h("function"),tA=$h("number"),pc=e=>e!==null&&typeof e=="object",hD=e=>e===!0||e===!1,bf=e=>{if(Th(e)!=="object")return!1;const t=Ux(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Jk in e)&&!(Nh in e)},pD=e=>{if(!pc(e)||hc(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},mD=rn("Date"),vD=rn("File"),yD=rn("Blob"),gD=rn("FileList"),xD=e=>pc(e)&&nr(e.pipe),bD=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||nr(e.append)&&((t=Th(e))==="formdata"||t==="object"&&nr(e.toString)&&e.toString()==="[object FormData]"))},wD=rn("URLSearchParams"),[SD,jD,OD,PD]=["ReadableStream","Request","Response","Headers"].map(rn),_D=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mc(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Ds(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const va=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nA=e=>!es(e)&&e!==va;function ry(){const{caseless:e,skipUndefined:t}=nA(this)&&this||{},r={},n=(i,a)=>{const o=e&&rA(r,a)||a;bf(r[o])&&bf(i)?r[o]=ry(r[o],i):bf(i)?r[o]=ry({},i):Ds(i)?r[o]=i.slice():(!t||!es(i))&&(r[o]=i)};for(let i=0,a=arguments.length;i(mc(t,(i,a)=>{r&&nr(i)?e[a]=Zk(i,r):e[a]=i},{allOwnKeys:n}),e),AD=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ED=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},ND=(e,t,r,n)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=r!==!1&&Ux(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},TD=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},$D=e=>{if(!e)return null;if(Ds(e))return e;let t=e.length;if(!tA(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},CD=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ux(Uint8Array)),MD=(e,t)=>{const n=(e&&e[Nh]).call(e);let i;for(;(i=n.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},RD=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},DD=rn("HTMLFormElement"),ID=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Nw=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),LD=rn("RegExp"),iA=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};mc(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},FD=e=>{iA(e,(t,r)=>{if(nr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(nr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},BD=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Ds(e)?n(e):n(String(e).split(t)),r},zD=()=>{},UD=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qD(e){return!!(e&&nr(e.append)&&e[Jk]==="FormData"&&e[Nh])}const WD=e=>{const t=new Array(10),r=(n,i)=>{if(pc(n)){if(t.indexOf(n)>=0)return;if(hc(n))return n;if(!("toJSON"in n)){t[i]=n;const a=Ds(n)?[]:{};return mc(n,(o,s)=>{const l=r(o,i+1);!es(l)&&(a[s]=l)}),t[i]=void 0,a}}return n};return r(e,0)},HD=rn("AsyncFunction"),KD=e=>e&&(pc(e)||nr(e))&&nr(e.then)&&nr(e.catch),aA=((e,t)=>e?setImmediate:t?((r,n)=>(va.addEventListener("message",({source:i,data:a})=>{i===va&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),va.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",nr(va.postMessage)),VD=typeof queueMicrotask<"u"?queueMicrotask.bind(va):typeof process<"u"&&process.nextTick||aA,GD=e=>e!=null&&nr(e[Nh]),I={isArray:Ds,isArrayBuffer:eA,isBuffer:hc,isFormData:bD,isArrayBufferView:fD,isString:dD,isNumber:tA,isBoolean:hD,isObject:pc,isPlainObject:bf,isEmptyObject:pD,isReadableStream:SD,isRequest:jD,isResponse:OD,isHeaders:PD,isUndefined:es,isDate:mD,isFile:vD,isBlob:yD,isRegExp:LD,isFunction:nr,isStream:xD,isURLSearchParams:wD,isTypedArray:CD,isFileList:gD,forEach:mc,merge:ry,extend:kD,trim:_D,stripBOM:AD,inherits:ED,toFlatObject:ND,kindOf:Th,kindOfTest:rn,endsWith:TD,toArray:$D,forEachEntry:MD,matchAll:RD,isHTMLForm:DD,hasOwnProperty:Nw,hasOwnProp:Nw,reduceDescriptors:iA,freezeMethods:FD,toObjectSet:BD,toCamelCase:ID,noop:zD,toFiniteNumber:UD,findKey:rA,global:va,isContextDefined:nA,isSpecCompliantForm:qD,toJSONObject:WD,isAsyncFn:HD,isThenable:KD,setImmediate:aA,asap:VD,isIterable:GD};function ue(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}I.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.status}}});const oA=ue.prototype,sA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{sA[e]={value:e}});Object.defineProperties(ue,sA);Object.defineProperty(oA,"isAxiosError",{value:!0});ue.from=(e,t,r,n,i,a)=>{const o=Object.create(oA);I.toFlatObject(e,o,function(f){return f!==Error.prototype},u=>u!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return ue.call(o,s,l,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};const QD=null;function ny(e){return I.isPlainObject(e)||I.isArray(e)}function lA(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function Tw(e,t,r){return e?e.concat(t).map(function(i,a){return i=lA(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function YD(e){return I.isArray(e)&&!e.some(ny)}const XD=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function Ch(e,t,r){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=I.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!I.isUndefined(y[m])});const n=r.metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(I.isDate(v))return v.toISOString();if(I.isBoolean(v))return v.toString();if(!l&&I.isBlob(v))throw new ue("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(v)||I.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,m,y){let b=v;if(v&&!y&&typeof v=="object"){if(I.endsWith(m,"{}"))m=n?m:m.slice(0,-2),v=JSON.stringify(v);else if(I.isArray(v)&&YD(v)||(I.isFileList(v)||I.endsWith(m,"[]"))&&(b=I.toArray(v)))return m=lA(m),b.forEach(function(x,S){!(I.isUndefined(x)||x===null)&&t.append(o===!0?Tw([m],S,a):o===null?m:m+"[]",u(x))}),!1}return ny(v)?!0:(t.append(Tw(y,m,a),u(v)),!1)}const d=[],h=Object.assign(XD,{defaultVisitor:f,convertValue:u,isVisitable:ny});function p(v,m){if(!I.isUndefined(v)){if(d.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(v),I.forEach(v,function(b,g){(!(I.isUndefined(b)||b===null)&&i.call(t,b,I.isString(g)?g.trim():g,m,h))===!0&&p(b,m?m.concat(g):[g])}),d.pop()}}if(!I.isObject(e))throw new TypeError("data must be an object");return p(e),t}function $w(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function qx(e,t){this._pairs=[],e&&Ch(e,this,t)}const uA=qx.prototype;uA.append=function(t,r){this._pairs.push([t,r])};uA.toString=function(t){const r=t?function(n){return t.call(this,n,$w)}:$w;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function ZD(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function cA(e,t,r){if(!t)return e;const n=r&&r.encode||ZD;I.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let a;if(i?a=i(t,r):a=I.isURLSearchParams(t)?t.toString():new qx(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Cw{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){I.forEach(this.handlers,function(n){n!==null&&t(n)})}}const fA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},JD=typeof URLSearchParams<"u"?URLSearchParams:qx,eI=typeof FormData<"u"?FormData:null,tI=typeof Blob<"u"?Blob:null,rI={isBrowser:!0,classes:{URLSearchParams:JD,FormData:eI,Blob:tI},protocols:["http","https","file","blob","url","data"]},Wx=typeof window<"u"&&typeof document<"u",iy=typeof navigator=="object"&&navigator||void 0,nI=Wx&&(!iy||["ReactNative","NativeScript","NS"].indexOf(iy.product)<0),iI=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",aI=Wx&&window.location.href||"http://localhost",oI=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wx,hasStandardBrowserEnv:nI,hasStandardBrowserWebWorkerEnv:iI,navigator:iy,origin:aI},Symbol.toStringTag,{value:"Module"})),Mt={...oI,...rI};function sI(e,t){return Ch(e,new Mt.classes.URLSearchParams,{visitor:function(r,n,i,a){return Mt.isNode&&I.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function lI(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function uI(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n=r.length;return o=!o&&I.isArray(i)?i.length:o,l?(I.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!I.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&I.isArray(i[o])&&(i[o]=uI(i[o])),!s)}if(I.isFormData(e)&&I.isFunction(e.entries)){const r={};return I.forEachEntry(e,(n,i)=>{t(lI(n),i,r,0)}),r}return null}function cI(e,t,r){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const vc={transitional:fA,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=I.isObject(t);if(a&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return i?JSON.stringify(dA(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return sI(t,this.formSerializer).toString();if((s=I.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ch(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),cI(t)):t}],transformResponse:[function(t){const r=this.transitional||vc.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(s){if(o)throw s.name==="SyntaxError"?ue.from(s,ue.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],e=>{vc.headers[e]={}});const fI=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),dI=e=>{const t={};let r,n,i;return e&&e.split(` -`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&fI[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Mw=Symbol("internals");function fl(e){return e&&String(e).trim().toLowerCase()}function wf(e){return e===!1||e==null?e:I.isArray(e)?e.map(wf):String(e)}function hI(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const pI=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sm(e,t,r,n,i){if(I.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!I.isString(t)){if(I.isString(n))return t.indexOf(n)!==-1;if(I.isRegExp(n))return n.test(t)}}function mI(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function vI(e,t){const r=I.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}let ir=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(s,l,u){const f=fl(l);if(!f)throw new Error("header name must be a non-empty string");const d=I.findKey(i,f);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=wf(s))}const o=(s,l)=>I.forEach(s,(u,f)=>a(u,f,l));if(I.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(I.isString(t)&&(t=t.trim())&&!pI(t))o(dI(t),r);else if(I.isObject(t)&&I.isIterable(t)){let s={},l,u;for(const f of t){if(!I.isArray(f))throw TypeError("Object iterator must return a key-value pair");s[u=f[0]]=(l=s[u])?I.isArray(l)?[...l,f[1]]:[l,f[1]]:f[1]}o(s,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=fl(t),t){const n=I.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return hI(i);if(I.isFunction(r))return r.call(this,i,n);if(I.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=fl(t),t){const n=I.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||sm(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(o){if(o=fl(o),o){const s=I.findKey(n,o);s&&(!r||sm(n,n[s],s,r))&&(delete n[s],i=!0)}}return I.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||sm(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return I.forEach(this,(i,a)=>{const o=I.findKey(n,a);if(o){r[o]=wf(i),delete r[a];return}const s=t?mI(a):String(a).trim();s!==a&&delete r[a],r[s]=wf(i),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return I.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&I.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Mw]=this[Mw]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=fl(o);n[s]||(vI(i,o),n[s]=!0)}return I.isArray(t)?t.forEach(a):a(t),this}};ir.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(ir.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});I.freezeMethods(ir);function lm(e,t){const r=this||vc,n=t||r,i=ir.from(n.headers);let a=n.data;return I.forEach(e,function(s){a=s.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function hA(e){return!!(e&&e.__CANCEL__)}function Is(e,t,r){ue.call(this,e??"canceled",ue.ERR_CANCELED,t,r),this.name="CanceledError"}I.inherits(Is,ue,{__CANCEL__:!0});function pA(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ue("Request failed with status code "+r.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function yI(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function gI(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),f=n[a];o||(o=u),r[i]=l,n[i]=u;let d=a,h=0;for(;d!==i;)h+=r[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o{r=f,i=null,a&&(clearTimeout(a),a=null),e(...u)};return[(...u)=>{const f=Date.now(),d=f-r;d>=n?o(u,f):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-d)))},()=>i&&o(i)]}const Xf=(e,t,r=3)=>{let n=0;const i=gI(50,250);return xI(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,l=o-n,u=i(l),f=o<=s;n=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&f?(s-o)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},r)},Rw=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Dw=e=>(...t)=>I.asap(()=>e(...t)),bI=Mt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Mt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,wI=Mt.hasStandardBrowserEnv?{write(e,t,r,n,i,a,o){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];I.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),I.isString(n)&&s.push(`path=${n}`),I.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push("secure"),I.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function SI(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function jI(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mA(e,t,r){let n=!SI(t);return e&&(n||r==!1)?jI(e,t):t}const Iw=e=>e instanceof ir?{...e}:e;function Ua(e,t){t=t||{};const r={};function n(u,f,d,h){return I.isPlainObject(u)&&I.isPlainObject(f)?I.merge.call({caseless:h},u,f):I.isPlainObject(f)?I.merge({},f):I.isArray(f)?f.slice():f}function i(u,f,d,h){if(I.isUndefined(f)){if(!I.isUndefined(u))return n(void 0,u,d,h)}else return n(u,f,d,h)}function a(u,f){if(!I.isUndefined(f))return n(void 0,f)}function o(u,f){if(I.isUndefined(f)){if(!I.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function s(u,f,d){if(d in t)return n(u,f);if(d in e)return n(void 0,u)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,f,d)=>i(Iw(u),Iw(f),d,!0)};return I.forEach(Object.keys({...e,...t}),function(f){const d=l[f]||i,h=d(e[f],t[f],f);I.isUndefined(h)&&d!==s||(r[f]=h)}),r}const vA=e=>{const t=Ua({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=ir.from(o),t.url=cA(mA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),I.isFormData(r)){if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(I.isFunction(r.getHeaders)){const l=r.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([f,d])=>{u.includes(f.toLowerCase())&&o.set(f,d)})}}if(Mt.hasStandardBrowserEnv&&(n&&I.isFunction(n)&&(n=n(t)),n||n!==!1&&bI(t.url))){const l=i&&a&&wI.read(a);l&&o.set(i,l)}return t},OI=typeof XMLHttpRequest<"u",PI=OI&&function(e){return new Promise(function(r,n){const i=vA(e);let a=i.data;const o=ir.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,f,d,h,p,v;function m(){p&&p(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function b(){if(!y)return;const x=ir.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:e,request:y};pA(function(O){r(O),m()},function(O){n(O),m()},w),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(n(new ue("Request aborted",ue.ECONNABORTED,e,y)),y=null)},y.onerror=function(S){const w=S&&S.message?S.message:"Network Error",j=new ue(w,ue.ERR_NETWORK,e,y);j.event=S||null,n(j),y=null},y.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||fA;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),n(new ue(S,w.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,e,y)),y=null},a===void 0&&o.setContentType(null),"setRequestHeader"in y&&I.forEach(o.toJSON(),function(S,w){y.setRequestHeader(w,S)}),I.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),s&&s!=="json"&&(y.responseType=i.responseType),u&&([h,v]=Xf(u,!0),y.addEventListener("progress",h)),l&&y.upload&&([d,p]=Xf(l),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(f=x=>{y&&(n(!x||x.type?new Is(null,e,y):x),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const g=yI(i.url);if(g&&Mt.protocols.indexOf(g)===-1){n(new ue("Unsupported protocol "+g+":",ue.ERR_BAD_REQUEST,e));return}y.send(a||null)})},_I=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const a=function(u){if(!i){i=!0,s();const f=u instanceof Error?u:this.reason;n.abort(f instanceof ue?f:new Is(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,a(new ue(`timeout ${t} of ms exceeded`,ue.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:l}=n;return l.unsubscribe=()=>I.asap(s),l}},kI=function*(e,t){let r=e.byteLength;if(r{const i=AI(e,t);let a=0,o,s=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:f}=await i.next();if(u){s(),l.close();return}let d=f.byteLength;if(r){let h=a+=d;r(h)}l.enqueue(new Uint8Array(f))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},Fw=64*1024,{isFunction:Hc}=I,NI=(({Request:e,Response:t})=>({Request:e,Response:t}))(I.global),{ReadableStream:Bw,TextEncoder:zw}=I.global,Uw=(e,...t)=>{try{return!!e(...t)}catch{return!1}},TI=e=>{e=I.merge.call({skipUndefined:!0},NI,e);const{fetch:t,Request:r,Response:n}=e,i=t?Hc(t):typeof fetch=="function",a=Hc(r),o=Hc(n);if(!i)return!1;const s=i&&Hc(Bw),l=i&&(typeof zw=="function"?(v=>m=>v.encode(m))(new zw):async v=>new Uint8Array(await new r(v).arrayBuffer())),u=a&&s&&Uw(()=>{let v=!1;const m=new r(Mt.origin,{body:new Bw,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!m}),f=o&&s&&Uw(()=>I.isReadableStream(new n("").body)),d={stream:f&&(v=>v.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!d[v]&&(d[v]=(m,y)=>{let b=m&&m[v];if(b)return b.call(m);throw new ue(`Response type '${v}' is not supported`,ue.ERR_NOT_SUPPORT,y)})});const h=async v=>{if(v==null)return 0;if(I.isBlob(v))return v.size;if(I.isSpecCompliantForm(v))return(await new r(Mt.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(I.isArrayBufferView(v)||I.isArrayBuffer(v))return v.byteLength;if(I.isURLSearchParams(v)&&(v=v+""),I.isString(v))return(await l(v)).byteLength},p=async(v,m)=>{const y=I.toFiniteNumber(v.getContentLength());return y??h(m)};return async v=>{let{url:m,method:y,data:b,signal:g,cancelToken:x,timeout:S,onDownloadProgress:w,onUploadProgress:j,responseType:O,headers:P,withCredentials:A="same-origin",fetchOptions:E}=vA(v),N=t||fetch;O=O?(O+"").toLowerCase():"text";let T=_I([g,x&&x.toAbortSignal()],S),M=null;const R=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let D;try{if(j&&u&&y!=="get"&&y!=="head"&&(D=await p(P,b))!==0){let G=new r(m,{method:"POST",body:b,duplex:"half"}),q;if(I.isFormData(b)&&(q=G.headers.get("content-type"))&&P.setContentType(q),G.body){const[ee,ce]=Rw(D,Xf(Dw(j)));b=Lw(G.body,Fw,ee,ce)}}I.isString(A)||(A=A?"include":"omit");const L=a&&"credentials"in r.prototype,z={...E,signal:T,method:y.toUpperCase(),headers:P.normalize().toJSON(),body:b,duplex:"half",credentials:L?A:void 0};M=a&&new r(m,z);let C=await(a?N(M,E):N(m,z));const B=f&&(O==="stream"||O==="response");if(f&&(w||B&&R)){const G={};["status","statusText","headers"].forEach(V=>{G[V]=C[V]});const q=I.toFiniteNumber(C.headers.get("content-length")),[ee,ce]=w&&Rw(q,Xf(Dw(w),!0))||[];C=new n(Lw(C.body,Fw,ee,()=>{ce&&ce(),R&&R()}),G)}O=O||"text";let U=await d[I.findKey(d,O)||"text"](C,v);return!B&&R&&R(),await new Promise((G,q)=>{pA(G,q,{data:U,headers:ir.from(C.headers),status:C.status,statusText:C.statusText,config:v,request:M})})}catch(L){throw R&&R(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,v,M),{cause:L.cause||L}):ue.from(L,L&&L.code,v,M)}}},$I=new Map,yA=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,a=[n,i,r];let o=a.length,s=o,l,u,f=$I;for(;s--;)l=a[s],u=f.get(l),u===void 0&&f.set(l,u=s?new Map:TI(t)),f=u;return u};yA();const Hx={http:QD,xhr:PI,fetch:{get:yA}};I.forEach(Hx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qw=e=>`- ${e}`,CI=e=>I.isFunction(e)||e===null||e===!1;function MI(e,t){e=I.isArray(e)?e:[e];const{length:r}=e;let n,i;const a={};for(let o=0;o`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=r?o.length>1?`since : -`+o.map(qw).join(` -`):" "+qw(o[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const gA={getAdapter:MI,adapters:Hx};function um(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Is(null,e)}function Ww(e){return um(e),e.headers=ir.from(e.headers),e.data=lm.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),gA.getAdapter(e.adapter||vc.adapter,e)(e).then(function(n){return um(e),n.data=lm.call(e,e.transformResponse,n),n.headers=ir.from(n.headers),n},function(n){return hA(n)||(um(e),n&&n.response&&(n.response.data=lm.call(e,e.transformResponse,n.response),n.response.headers=ir.from(n.response.headers))),Promise.reject(n)})}const xA="1.13.2",Mh={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Mh[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Hw={};Mh.transitional=function(t,r,n){function i(a,o){return"[Axios v"+xA+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(t===!1)throw new ue(i(o," has been removed"+(r?" in "+r:"")),ue.ERR_DEPRECATED);return r&&!Hw[o]&&(Hw[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,o,s):!0}};Mh.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function RI(e,t,r){if(typeof e!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const s=e[a],l=s===void 0||o(s,a,e);if(l!==!0)throw new ue("option "+a+" must be "+l,ue.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ue("Unknown option "+a,ue.ERR_BAD_OPTION)}}const Sf={assertOptions:RI,validators:Mh},sn=Sf.validators;let Ca=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Cw,response:new Cw}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` -`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ua(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&Sf.assertOptions(n,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean)},!1),i!=null&&(I.isFunction(i)?r.paramsSerializer={serialize:i}:Sf.assertOptions(i,{encode:sn.function,serialize:sn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Sf.assertOptions(r,{baseUrl:sn.spelling("baseURL"),withXsrfToken:sn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=a&&I.merge(a.common,a[r.method]);a&&I.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),r.headers=ir.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(l=l&&m.synchronous,s.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let f,d=0,h;if(!l){const v=[Ww.bind(this),void 0];for(v.unshift(...s),v.push(...u),h=v.length,f=Promise.resolve(r);d{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},t(function(a,o,s){n.reason||(n.reason=new Is(a,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new bA(function(i){t=i}),cancel:t}}};function II(e){return function(r){return e.apply(null,r)}}function LI(e){return I.isObject(e)&&e.isAxiosError===!0}const ay={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ay).forEach(([e,t])=>{ay[t]=e});function wA(e){const t=new Ca(e),r=Zk(Ca.prototype.request,t);return I.extend(r,Ca.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return wA(Ua(e,i))},r}const Xe=wA(vc);Xe.Axios=Ca;Xe.CanceledError=Is;Xe.CancelToken=DI;Xe.isCancel=hA;Xe.VERSION=xA;Xe.toFormData=Ch;Xe.AxiosError=ue;Xe.Cancel=Xe.CanceledError;Xe.all=function(t){return Promise.all(t)};Xe.spread=II;Xe.isAxiosError=LI;Xe.mergeConfig=Ua;Xe.AxiosHeaders=ir;Xe.formToJSON=e=>dA(I.isHTMLForm(e)?new FormData(e):e);Xe.getAdapter=gA.getAdapter;Xe.HttpStatusCode=ay;Xe.default=Xe;const{Axios:Mle,AxiosError:Rle,CanceledError:Dle,isCancel:Ile,CancelToken:Lle,VERSION:Fle,all:Ble,Cancel:zle,isAxiosError:Ule,spread:qle,toFormData:Wle,AxiosHeaders:Hle,HttpStatusCode:Kle,formToJSON:Vle,getAdapter:Gle,mergeConfig:Qle}=Xe,ni=Xe.create({baseURL:"/api",headers:{"Content-Type":"application/json"}}),Ye={getRuns:async e=>{const t={};return e!=null&&e.project&&(t.project=e.project),e!=null&&e.provider&&(t.provider=e.provider),e!=null&&e.status&&(t.status=e.status),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),e!=null&&e.algorithm&&(t.algorithm=e.algorithm),e!=null&&e.limit&&(t.limit=e.limit),console.log("API params:",JSON.stringify(t,null,2)),(await ni.get("/runs",{params:t})).data},getAlgorithms:async()=>(await ni.get("/algorithms")).data.algorithms||[],getRun:async(e,t)=>{try{const[r,n]=await Promise.all([ni.get(`/runs/${e}/${t}/event`),ni.get(`/runs/${e}/${t}/analysis`)]);return{event:r.data,analysis:n.data}}catch{const[n,i]=await Promise.all([ni.get(`/runs/${t}`),ni.get(`/runs/${t}/analysis`)]);return{event:n.data,analysis:i.data}}},health:async()=>(await ni.get("/health")).data,getSettings:async()=>(await ni.get("/settings")).data};function FI({onDateRangeChange:e,initialStartDate:t,initialEndDate:r}){const[n,i]=k.useState(!0),[a,o]=k.useState(t||""),[s,l]=k.useState(r||""),u=k.useRef(null);k.useEffect(()=>{t!==void 0&&o(t),r!==void 0&&l(r)},[t,r]),k.useEffect(()=>{const p=v=>{u.current&&!u.current.contains(v.target)&&i(!1)};if(n)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const f=()=>{a&&s?new Date(s)>=new Date(a)?(e==null||e(a,s),i(!1)):alert("End date must be after start date"):(a||s)&&alert("Please select both start and end dates")},d=()=>{o(""),l(""),e==null||e(void 0,void 0),i(!1)},h=new Date().toISOString().split("T")[0];return c.jsxs("div",{className:"relative",ref:u,children:[c.jsxs("button",{onClick:()=>i(!n),className:"bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm flex items-center gap-2 hover:border-primary/50 transition-colors",children:[c.jsx(JR,{size:16}),a&&s?c.jsxs("span",{className:"text-xs",children:[new Date(a).toLocaleDateString()," - ",new Date(s).toLocaleDateString()]}):c.jsx("span",{children:"Select Dates"})]}),n&&c.jsxs("div",{className:"absolute top-full mt-2 right-0 bg-dark-surface border border-dark-border rounded-lg p-4 shadow-xl z-50 min-w-[320px]",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-sm font-semibold text-white",children:"Select Date Range"}),c.jsx("button",{onClick:()=>i(!1),className:"text-dark-text-muted hover:text-dark-text transition-colors",children:c.jsx(Xk,{size:18})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:"Start Date"}),c.jsx("input",{type:"date",value:a,onChange:p=>o(p.target.value),max:s||h,className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50 transition-colors"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:"End Date"}),c.jsx("input",{type:"date",value:s,onChange:p=>l(p.target.value),min:a||void 0,max:h,className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50 transition-colors"})]}),c.jsxs("div",{className:"flex gap-2 pt-2",children:[c.jsx("button",{onClick:f,className:"flex-1 bg-primary hover:bg-primary/90 text-white text-sm py-2 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!a||!s,children:"Apply"}),c.jsx("button",{onClick:d,className:"px-4 py-2 bg-dark-bg border border-dark-border hover:bg-dark-bg/80 text-dark-text text-sm rounded-lg transition-colors",children:"Clear"})]})]})]})]})}function SA(e,t){if(e.length===0){alert("No data to export");return}const r=Object.keys(e[0]),n=[r.join(","),...e.map(s=>r.map(l=>{const u=s[l];if(u==null)return"";const f=String(u);return f.includes(",")||f.includes('"')||f.includes(` + */const Zk=Ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Jk(e,t){return function(){return e.apply(t,arguments)}}const{toString:fD}=Object.prototype,{getPrototypeOf:qx}=Object,{iterator:Nh,toStringTag:eA}=Symbol,Th=(e=>t=>{const r=fD.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),rn=e=>(e=e.toLowerCase(),t=>Th(t)===e),$h=e=>t=>typeof t===e,{isArray:Ds}=Array,es=$h("undefined");function hc(e){return e!==null&&!es(e)&&e.constructor!==null&&!es(e.constructor)&&nr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tA=rn("ArrayBuffer");function dD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&tA(e.buffer),t}const hD=$h("string"),nr=$h("function"),rA=$h("number"),pc=e=>e!==null&&typeof e=="object",pD=e=>e===!0||e===!1,bf=e=>{if(Th(e)!=="object")return!1;const t=qx(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(eA in e)&&!(Nh in e)},mD=e=>{if(!pc(e)||hc(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},vD=rn("Date"),yD=rn("File"),gD=rn("Blob"),xD=rn("FileList"),bD=e=>pc(e)&&nr(e.pipe),wD=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||nr(e.append)&&((t=Th(e))==="formdata"||t==="object"&&nr(e.toString)&&e.toString()==="[object FormData]"))},SD=rn("URLSearchParams"),[jD,OD,PD,_D]=["ReadableStream","Request","Response","Headers"].map(rn),kD=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mc(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Ds(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const va=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,iA=e=>!es(e)&&e!==va;function ny(){const{caseless:e,skipUndefined:t}=iA(this)&&this||{},r={},n=(i,a)=>{const o=e&&nA(r,a)||a;bf(r[o])&&bf(i)?r[o]=ny(r[o],i):bf(i)?r[o]=ny({},i):Ds(i)?r[o]=i.slice():(!t||!es(i))&&(r[o]=i)};for(let i=0,a=arguments.length;i(mc(t,(i,a)=>{r&&nr(i)?e[a]=Jk(i,r):e[a]=i},{allOwnKeys:n}),e),ED=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ND=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},TD=(e,t,r,n)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=r!==!1&&qx(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},$D=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},CD=e=>{if(!e)return null;if(Ds(e))return e;let t=e.length;if(!rA(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},MD=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qx(Uint8Array)),RD=(e,t)=>{const n=(e&&e[Nh]).call(e);let i;for(;(i=n.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},DD=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ID=rn("HTMLFormElement"),LD=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Tw=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),FD=rn("RegExp"),aA=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};mc(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},BD=e=>{aA(e,(t,r)=>{if(nr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(nr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},zD=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Ds(e)?n(e):n(String(e).split(t)),r},UD=()=>{},qD=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function WD(e){return!!(e&&nr(e.append)&&e[eA]==="FormData"&&e[Nh])}const HD=e=>{const t=new Array(10),r=(n,i)=>{if(pc(n)){if(t.indexOf(n)>=0)return;if(hc(n))return n;if(!("toJSON"in n)){t[i]=n;const a=Ds(n)?[]:{};return mc(n,(o,s)=>{const l=r(o,i+1);!es(l)&&(a[s]=l)}),t[i]=void 0,a}}return n};return r(e,0)},KD=rn("AsyncFunction"),VD=e=>e&&(pc(e)||nr(e))&&nr(e.then)&&nr(e.catch),oA=((e,t)=>e?setImmediate:t?((r,n)=>(va.addEventListener("message",({source:i,data:a})=>{i===va&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),va.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",nr(va.postMessage)),GD=typeof queueMicrotask<"u"?queueMicrotask.bind(va):typeof process<"u"&&process.nextTick||oA,QD=e=>e!=null&&nr(e[Nh]),I={isArray:Ds,isArrayBuffer:tA,isBuffer:hc,isFormData:wD,isArrayBufferView:dD,isString:hD,isNumber:rA,isBoolean:pD,isObject:pc,isPlainObject:bf,isEmptyObject:mD,isReadableStream:jD,isRequest:OD,isResponse:PD,isHeaders:_D,isUndefined:es,isDate:vD,isFile:yD,isBlob:gD,isRegExp:FD,isFunction:nr,isStream:bD,isURLSearchParams:SD,isTypedArray:MD,isFileList:xD,forEach:mc,merge:ny,extend:AD,trim:kD,stripBOM:ED,inherits:ND,toFlatObject:TD,kindOf:Th,kindOfTest:rn,endsWith:$D,toArray:CD,forEachEntry:RD,matchAll:DD,isHTMLForm:ID,hasOwnProperty:Tw,hasOwnProp:Tw,reduceDescriptors:aA,freezeMethods:BD,toObjectSet:zD,toCamelCase:LD,noop:UD,toFiniteNumber:qD,findKey:nA,global:va,isContextDefined:iA,isSpecCompliantForm:WD,toJSONObject:HD,isAsyncFn:KD,isThenable:VD,setImmediate:oA,asap:GD,isIterable:QD};function ue(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}I.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.status}}});const sA=ue.prototype,lA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{lA[e]={value:e}});Object.defineProperties(ue,lA);Object.defineProperty(sA,"isAxiosError",{value:!0});ue.from=(e,t,r,n,i,a)=>{const o=Object.create(sA);I.toFlatObject(e,o,function(f){return f!==Error.prototype},u=>u!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return ue.call(o,s,l,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};const YD=null;function iy(e){return I.isPlainObject(e)||I.isArray(e)}function uA(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function $w(e,t,r){return e?e.concat(t).map(function(i,a){return i=uA(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function XD(e){return I.isArray(e)&&!e.some(iy)}const ZD=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function Ch(e,t,r){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=I.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!I.isUndefined(y[m])});const n=r.metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(I.isDate(v))return v.toISOString();if(I.isBoolean(v))return v.toString();if(!l&&I.isBlob(v))throw new ue("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(v)||I.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,m,y){let b=v;if(v&&!y&&typeof v=="object"){if(I.endsWith(m,"{}"))m=n?m:m.slice(0,-2),v=JSON.stringify(v);else if(I.isArray(v)&&XD(v)||(I.isFileList(v)||I.endsWith(m,"[]"))&&(b=I.toArray(v)))return m=uA(m),b.forEach(function(x,S){!(I.isUndefined(x)||x===null)&&t.append(o===!0?$w([m],S,a):o===null?m:m+"[]",u(x))}),!1}return iy(v)?!0:(t.append($w(y,m,a),u(v)),!1)}const d=[],h=Object.assign(ZD,{defaultVisitor:f,convertValue:u,isVisitable:iy});function p(v,m){if(!I.isUndefined(v)){if(d.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(v),I.forEach(v,function(b,g){(!(I.isUndefined(b)||b===null)&&i.call(t,b,I.isString(g)?g.trim():g,m,h))===!0&&p(b,m?m.concat(g):[g])}),d.pop()}}if(!I.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Cw(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Wx(e,t){this._pairs=[],e&&Ch(e,this,t)}const cA=Wx.prototype;cA.append=function(t,r){this._pairs.push([t,r])};cA.toString=function(t){const r=t?function(n){return t.call(this,n,Cw)}:Cw;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function JD(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function fA(e,t,r){if(!t)return e;const n=r&&r.encode||JD;I.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let a;if(i?a=i(t,r):a=I.isURLSearchParams(t)?t.toString():new Wx(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Mw{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){I.forEach(this.handlers,function(n){n!==null&&t(n)})}}const dA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eI=typeof URLSearchParams<"u"?URLSearchParams:Wx,tI=typeof FormData<"u"?FormData:null,rI=typeof Blob<"u"?Blob:null,nI={isBrowser:!0,classes:{URLSearchParams:eI,FormData:tI,Blob:rI},protocols:["http","https","file","blob","url","data"]},Hx=typeof window<"u"&&typeof document<"u",ay=typeof navigator=="object"&&navigator||void 0,iI=Hx&&(!ay||["ReactNative","NativeScript","NS"].indexOf(ay.product)<0),aI=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",oI=Hx&&window.location.href||"http://localhost",sI=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Hx,hasStandardBrowserEnv:iI,hasStandardBrowserWebWorkerEnv:aI,navigator:ay,origin:oI},Symbol.toStringTag,{value:"Module"})),Mt={...sI,...nI};function lI(e,t){return Ch(e,new Mt.classes.URLSearchParams,{visitor:function(r,n,i,a){return Mt.isNode&&I.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function uI(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cI(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n=r.length;return o=!o&&I.isArray(i)?i.length:o,l?(I.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!I.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&I.isArray(i[o])&&(i[o]=cI(i[o])),!s)}if(I.isFormData(e)&&I.isFunction(e.entries)){const r={};return I.forEachEntry(e,(n,i)=>{t(uI(n),i,r,0)}),r}return null}function fI(e,t,r){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const vc={transitional:dA,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=I.isObject(t);if(a&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return i?JSON.stringify(hA(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return lI(t,this.formSerializer).toString();if((s=I.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ch(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),fI(t)):t}],transformResponse:[function(t){const r=this.transitional||vc.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(s){if(o)throw s.name==="SyntaxError"?ue.from(s,ue.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],e=>{vc.headers[e]={}});const dI=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hI=e=>{const t={};let r,n,i;return e&&e.split(` +`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&dI[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Rw=Symbol("internals");function fl(e){return e&&String(e).trim().toLowerCase()}function wf(e){return e===!1||e==null?e:I.isArray(e)?e.map(wf):String(e)}function pI(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const mI=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sm(e,t,r,n,i){if(I.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!I.isString(t)){if(I.isString(n))return t.indexOf(n)!==-1;if(I.isRegExp(n))return n.test(t)}}function vI(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function yI(e,t){const r=I.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}let ir=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(s,l,u){const f=fl(l);if(!f)throw new Error("header name must be a non-empty string");const d=I.findKey(i,f);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=wf(s))}const o=(s,l)=>I.forEach(s,(u,f)=>a(u,f,l));if(I.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(I.isString(t)&&(t=t.trim())&&!mI(t))o(hI(t),r);else if(I.isObject(t)&&I.isIterable(t)){let s={},l,u;for(const f of t){if(!I.isArray(f))throw TypeError("Object iterator must return a key-value pair");s[u=f[0]]=(l=s[u])?I.isArray(l)?[...l,f[1]]:[l,f[1]]:f[1]}o(s,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=fl(t),t){const n=I.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return pI(i);if(I.isFunction(r))return r.call(this,i,n);if(I.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=fl(t),t){const n=I.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||sm(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(o){if(o=fl(o),o){const s=I.findKey(n,o);s&&(!r||sm(n,n[s],s,r))&&(delete n[s],i=!0)}}return I.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||sm(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return I.forEach(this,(i,a)=>{const o=I.findKey(n,a);if(o){r[o]=wf(i),delete r[a];return}const s=t?vI(a):String(a).trim();s!==a&&delete r[a],r[s]=wf(i),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return I.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&I.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Rw]=this[Rw]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=fl(o);n[s]||(yI(i,o),n[s]=!0)}return I.isArray(t)?t.forEach(a):a(t),this}};ir.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(ir.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});I.freezeMethods(ir);function lm(e,t){const r=this||vc,n=t||r,i=ir.from(n.headers);let a=n.data;return I.forEach(e,function(s){a=s.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function pA(e){return!!(e&&e.__CANCEL__)}function Is(e,t,r){ue.call(this,e??"canceled",ue.ERR_CANCELED,t,r),this.name="CanceledError"}I.inherits(Is,ue,{__CANCEL__:!0});function mA(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ue("Request failed with status code "+r.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function gI(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xI(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),f=n[a];o||(o=u),r[i]=l,n[i]=u;let d=a,h=0;for(;d!==i;)h+=r[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o{r=f,i=null,a&&(clearTimeout(a),a=null),e(...u)};return[(...u)=>{const f=Date.now(),d=f-r;d>=n?o(u,f):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-d)))},()=>i&&o(i)]}const Xf=(e,t,r=3)=>{let n=0;const i=xI(50,250);return bI(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,l=o-n,u=i(l),f=o<=s;n=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&f?(s-o)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},r)},Dw=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Iw=e=>(...t)=>I.asap(()=>e(...t)),wI=Mt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Mt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,SI=Mt.hasStandardBrowserEnv?{write(e,t,r,n,i,a,o){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];I.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),I.isString(n)&&s.push(`path=${n}`),I.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push("secure"),I.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function jI(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function OI(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function vA(e,t,r){let n=!jI(t);return e&&(n||r==!1)?OI(e,t):t}const Lw=e=>e instanceof ir?{...e}:e;function Ua(e,t){t=t||{};const r={};function n(u,f,d,h){return I.isPlainObject(u)&&I.isPlainObject(f)?I.merge.call({caseless:h},u,f):I.isPlainObject(f)?I.merge({},f):I.isArray(f)?f.slice():f}function i(u,f,d,h){if(I.isUndefined(f)){if(!I.isUndefined(u))return n(void 0,u,d,h)}else return n(u,f,d,h)}function a(u,f){if(!I.isUndefined(f))return n(void 0,f)}function o(u,f){if(I.isUndefined(f)){if(!I.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function s(u,f,d){if(d in t)return n(u,f);if(d in e)return n(void 0,u)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,f,d)=>i(Lw(u),Lw(f),d,!0)};return I.forEach(Object.keys({...e,...t}),function(f){const d=l[f]||i,h=d(e[f],t[f],f);I.isUndefined(h)&&d!==s||(r[f]=h)}),r}const yA=e=>{const t=Ua({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=ir.from(o),t.url=fA(vA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),I.isFormData(r)){if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(I.isFunction(r.getHeaders)){const l=r.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([f,d])=>{u.includes(f.toLowerCase())&&o.set(f,d)})}}if(Mt.hasStandardBrowserEnv&&(n&&I.isFunction(n)&&(n=n(t)),n||n!==!1&&wI(t.url))){const l=i&&a&&SI.read(a);l&&o.set(i,l)}return t},PI=typeof XMLHttpRequest<"u",_I=PI&&function(e){return new Promise(function(r,n){const i=yA(e);let a=i.data;const o=ir.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,f,d,h,p,v;function m(){p&&p(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function b(){if(!y)return;const x=ir.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:e,request:y};mA(function(O){r(O),m()},function(O){n(O),m()},w),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(n(new ue("Request aborted",ue.ECONNABORTED,e,y)),y=null)},y.onerror=function(S){const w=S&&S.message?S.message:"Network Error",j=new ue(w,ue.ERR_NETWORK,e,y);j.event=S||null,n(j),y=null},y.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||dA;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),n(new ue(S,w.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,e,y)),y=null},a===void 0&&o.setContentType(null),"setRequestHeader"in y&&I.forEach(o.toJSON(),function(S,w){y.setRequestHeader(w,S)}),I.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),s&&s!=="json"&&(y.responseType=i.responseType),u&&([h,v]=Xf(u,!0),y.addEventListener("progress",h)),l&&y.upload&&([d,p]=Xf(l),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(f=x=>{y&&(n(!x||x.type?new Is(null,e,y):x),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const g=gI(i.url);if(g&&Mt.protocols.indexOf(g)===-1){n(new ue("Unsupported protocol "+g+":",ue.ERR_BAD_REQUEST,e));return}y.send(a||null)})},kI=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const a=function(u){if(!i){i=!0,s();const f=u instanceof Error?u:this.reason;n.abort(f instanceof ue?f:new Is(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,a(new ue(`timeout ${t} of ms exceeded`,ue.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:l}=n;return l.unsubscribe=()=>I.asap(s),l}},AI=function*(e,t){let r=e.byteLength;if(r{const i=EI(e,t);let a=0,o,s=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:f}=await i.next();if(u){s(),l.close();return}let d=f.byteLength;if(r){let h=a+=d;r(h)}l.enqueue(new Uint8Array(f))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},Bw=64*1024,{isFunction:Hc}=I,TI=(({Request:e,Response:t})=>({Request:e,Response:t}))(I.global),{ReadableStream:zw,TextEncoder:Uw}=I.global,qw=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$I=e=>{e=I.merge.call({skipUndefined:!0},TI,e);const{fetch:t,Request:r,Response:n}=e,i=t?Hc(t):typeof fetch=="function",a=Hc(r),o=Hc(n);if(!i)return!1;const s=i&&Hc(zw),l=i&&(typeof Uw=="function"?(v=>m=>v.encode(m))(new Uw):async v=>new Uint8Array(await new r(v).arrayBuffer())),u=a&&s&&qw(()=>{let v=!1;const m=new r(Mt.origin,{body:new zw,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!m}),f=o&&s&&qw(()=>I.isReadableStream(new n("").body)),d={stream:f&&(v=>v.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!d[v]&&(d[v]=(m,y)=>{let b=m&&m[v];if(b)return b.call(m);throw new ue(`Response type '${v}' is not supported`,ue.ERR_NOT_SUPPORT,y)})});const h=async v=>{if(v==null)return 0;if(I.isBlob(v))return v.size;if(I.isSpecCompliantForm(v))return(await new r(Mt.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(I.isArrayBufferView(v)||I.isArrayBuffer(v))return v.byteLength;if(I.isURLSearchParams(v)&&(v=v+""),I.isString(v))return(await l(v)).byteLength},p=async(v,m)=>{const y=I.toFiniteNumber(v.getContentLength());return y??h(m)};return async v=>{let{url:m,method:y,data:b,signal:g,cancelToken:x,timeout:S,onDownloadProgress:w,onUploadProgress:j,responseType:O,headers:P,withCredentials:A="same-origin",fetchOptions:E}=yA(v),N=t||fetch;O=O?(O+"").toLowerCase():"text";let T=kI([g,x&&x.toAbortSignal()],S),M=null;const R=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let D;try{if(j&&u&&y!=="get"&&y!=="head"&&(D=await p(P,b))!==0){let G=new r(m,{method:"POST",body:b,duplex:"half"}),q;if(I.isFormData(b)&&(q=G.headers.get("content-type"))&&P.setContentType(q),G.body){const[ee,ce]=Dw(D,Xf(Iw(j)));b=Fw(G.body,Bw,ee,ce)}}I.isString(A)||(A=A?"include":"omit");const L=a&&"credentials"in r.prototype,U={...E,signal:T,method:y.toUpperCase(),headers:P.normalize().toJSON(),body:b,duplex:"half",credentials:L?A:void 0};M=a&&new r(m,U);let C=await(a?N(M,E):N(m,U));const F=f&&(O==="stream"||O==="response");if(f&&(w||F&&R)){const G={};["status","statusText","headers"].forEach(V=>{G[V]=C[V]});const q=I.toFiniteNumber(C.headers.get("content-length")),[ee,ce]=w&&Dw(q,Xf(Iw(w),!0))||[];C=new n(Fw(C.body,Bw,ee,()=>{ce&&ce(),R&&R()}),G)}O=O||"text";let z=await d[I.findKey(d,O)||"text"](C,v);return!F&&R&&R(),await new Promise((G,q)=>{mA(G,q,{data:z,headers:ir.from(C.headers),status:C.status,statusText:C.statusText,config:v,request:M})})}catch(L){throw R&&R(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,v,M),{cause:L.cause||L}):ue.from(L,L&&L.code,v,M)}}},CI=new Map,gA=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,a=[n,i,r];let o=a.length,s=o,l,u,f=CI;for(;s--;)l=a[s],u=f.get(l),u===void 0&&f.set(l,u=s?new Map:$I(t)),f=u;return u};gA();const Kx={http:YD,xhr:_I,fetch:{get:gA}};I.forEach(Kx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ww=e=>`- ${e}`,MI=e=>I.isFunction(e)||e===null||e===!1;function RI(e,t){e=I.isArray(e)?e:[e];const{length:r}=e;let n,i;const a={};for(let o=0;o`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=r?o.length>1?`since : +`+o.map(Ww).join(` +`):" "+Ww(o[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const xA={getAdapter:RI,adapters:Kx};function um(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Is(null,e)}function Hw(e){return um(e),e.headers=ir.from(e.headers),e.data=lm.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xA.getAdapter(e.adapter||vc.adapter,e)(e).then(function(n){return um(e),n.data=lm.call(e,e.transformResponse,n),n.headers=ir.from(n.headers),n},function(n){return pA(n)||(um(e),n&&n.response&&(n.response.data=lm.call(e,e.transformResponse,n.response),n.response.headers=ir.from(n.response.headers))),Promise.reject(n)})}const bA="1.13.2",Mh={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Mh[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Kw={};Mh.transitional=function(t,r,n){function i(a,o){return"[Axios v"+bA+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(t===!1)throw new ue(i(o," has been removed"+(r?" in "+r:"")),ue.ERR_DEPRECATED);return r&&!Kw[o]&&(Kw[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,o,s):!0}};Mh.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function DI(e,t,r){if(typeof e!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const s=e[a],l=s===void 0||o(s,a,e);if(l!==!0)throw new ue("option "+a+" must be "+l,ue.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ue("Unknown option "+a,ue.ERR_BAD_OPTION)}}const Sf={assertOptions:DI,validators:Mh},sn=Sf.validators;let Ca=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Mw,response:new Mw}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ua(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&Sf.assertOptions(n,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean)},!1),i!=null&&(I.isFunction(i)?r.paramsSerializer={serialize:i}:Sf.assertOptions(i,{encode:sn.function,serialize:sn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Sf.assertOptions(r,{baseUrl:sn.spelling("baseURL"),withXsrfToken:sn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=a&&I.merge(a.common,a[r.method]);a&&I.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),r.headers=ir.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(l=l&&m.synchronous,s.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let f,d=0,h;if(!l){const v=[Hw.bind(this),void 0];for(v.unshift(...s),v.push(...u),h=v.length,f=Promise.resolve(r);d{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},t(function(a,o,s){n.reason||(n.reason=new Is(a,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new wA(function(i){t=i}),cancel:t}}};function LI(e){return function(r){return e.apply(null,r)}}function FI(e){return I.isObject(e)&&e.isAxiosError===!0}const oy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(oy).forEach(([e,t])=>{oy[t]=e});function SA(e){const t=new Ca(e),r=Jk(Ca.prototype.request,t);return I.extend(r,Ca.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return SA(Ua(e,i))},r}const Xe=SA(vc);Xe.Axios=Ca;Xe.CanceledError=Is;Xe.CancelToken=II;Xe.isCancel=pA;Xe.VERSION=bA;Xe.toFormData=Ch;Xe.AxiosError=ue;Xe.Cancel=Xe.CanceledError;Xe.all=function(t){return Promise.all(t)};Xe.spread=LI;Xe.isAxiosError=FI;Xe.mergeConfig=Ua;Xe.AxiosHeaders=ir;Xe.formToJSON=e=>hA(I.isHTMLForm(e)?new FormData(e):e);Xe.getAdapter=xA.getAdapter;Xe.HttpStatusCode=oy;Xe.default=Xe;const{Axios:Rle,AxiosError:Dle,CanceledError:Ile,isCancel:Lle,CancelToken:Fle,VERSION:Ble,all:zle,Cancel:Ule,isAxiosError:qle,spread:Wle,toFormData:Hle,AxiosHeaders:Kle,HttpStatusCode:Vle,formToJSON:Gle,getAdapter:Qle,mergeConfig:Yle}=Xe,ni=Xe.create({baseURL:"/api",headers:{"Content-Type":"application/json"}}),Ye={getRuns:async e=>{const t={};return e!=null&&e.project&&(t.project=e.project),e!=null&&e.provider&&(t.provider=e.provider),e!=null&&e.status&&(t.status=e.status),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),e!=null&&e.algorithm&&(t.algorithm=e.algorithm),e!=null&&e.limit&&(t.limit=e.limit),(await ni.get("/runs",{params:t})).data},getAlgorithms:async()=>(await ni.get("/algorithms")).data.algorithms||[],getRun:async(e,t)=>{try{const[r,n]=await Promise.all([ni.get(`/runs/${e}/${t}/event`),ni.get(`/runs/${e}/${t}/analysis`)]);return{event:r.data,analysis:n.data}}catch{const[n,i]=await Promise.all([ni.get(`/runs/${t}`),ni.get(`/runs/${t}/analysis`)]);return{event:n.data,analysis:i.data}}},health:async()=>(await ni.get("/health")).data,getSettings:async()=>(await ni.get("/settings")).data};function BI({onDateRangeChange:e,initialStartDate:t,initialEndDate:r}){const[n,i]=k.useState(!0),[a,o]=k.useState(t||""),[s,l]=k.useState(r||""),u=k.useRef(null);k.useEffect(()=>{t!==void 0&&o(t),r!==void 0&&l(r)},[t,r]),k.useEffect(()=>{const p=v=>{u.current&&!u.current.contains(v.target)&&i(!1)};if(n)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const f=()=>{a&&s?new Date(s)>=new Date(a)?(e==null||e(a,s),i(!1)):alert("End date must be after start date"):(a||s)&&alert("Please select both start and end dates")},d=()=>{o(""),l(""),e==null||e(void 0,void 0),i(!1)},h=new Date().toISOString().split("T")[0];return c.jsxs("div",{className:"relative",ref:u,children:[c.jsxs("button",{onClick:()=>i(!n),className:"bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm flex items-center gap-2 hover:border-primary/50 transition-colors",children:[c.jsx(eD,{size:16}),a&&s?c.jsxs("span",{className:"text-xs",children:[new Date(a).toLocaleDateString()," - ",new Date(s).toLocaleDateString()]}):c.jsx("span",{children:"Select Dates"})]}),n&&c.jsxs("div",{className:"absolute top-full mt-2 right-0 bg-dark-surface border border-dark-border rounded-lg p-4 shadow-xl z-50 min-w-[320px]",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-sm font-semibold text-white",children:"Select Date Range"}),c.jsx("button",{onClick:()=>i(!1),className:"text-dark-text-muted hover:text-dark-text transition-colors",children:c.jsx(Zk,{size:18})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:"Start Date"}),c.jsx("input",{type:"date",value:a,onChange:p=>o(p.target.value),max:s||h,className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50 transition-colors"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:"End Date"}),c.jsx("input",{type:"date",value:s,onChange:p=>l(p.target.value),min:a||void 0,max:h,className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50 transition-colors"})]}),c.jsxs("div",{className:"flex gap-2 pt-2",children:[c.jsx("button",{onClick:f,className:"flex-1 bg-primary hover:bg-primary/90 text-white text-sm py-2 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!a||!s,children:"Apply"}),c.jsx("button",{onClick:d,className:"px-4 py-2 bg-dark-bg border border-dark-border hover:bg-dark-bg/80 text-dark-text text-sm rounded-lg transition-colors",children:"Clear"})]})]})]})]})}function jA(e,t){if(e.length===0){alert("No data to export");return}const r=Object.keys(e[0]),n=[r.join(","),...e.map(s=>r.map(l=>{const u=s[l];if(u==null)return"";const f=String(u);return f.includes(",")||f.includes('"')||f.includes(` `)?`"${f.replace(/"/g,'""')}"`:f}).join(","))].join(` -`),i=new Blob([n],{type:"text/csv;charset=utf-8;"}),a=document.createElement("a"),o=URL.createObjectURL(i);a.setAttribute("href",o),a.setAttribute("download",`${t}.csv`),a.style.visibility="hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}function Kx(e,t="qobserva-runs"){const r=e.map(n=>({"Run ID":n.run_id,Time:new Date(n.created_at).toISOString(),Project:n.project,Provider:n.provider,Backend:n.backend_name,Status:n.status,Shots:n.shots}));SA(r,t)}function BI(e,t="qobserva-backends"){const r=e.map(n=>({"Backend Name":n.backend_name,Provider:n.provider,"Total Runs":n.total,Success:n.success,Failed:n.failed,Cancelled:n.cancelled,"Success Rate (%)":n.total>0?(n.success/n.total*100).toFixed(2):"0.00"}));SA(r,t)}function zI({onFilterChange:e,disabled:t=!1,disabledMessage:r="Filters are not available for individual run details or comparisons",visible:n={project:!0,provider:!0,status:!0,time:!0,algorithm:!1},showExport:i=!0}){const[a]=Ah(),o=Vi(),s=mt(),{data:l=[]}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3})}),{data:u=[]}=Qe({queryKey:["algorithms"],queryFn:()=>Ye.getAlgorithms(),enabled:n.algorithm===!0}),f=o.pathname==="/runs-filtered",d=a.get("project"),h=a.get("provider"),p=a.get("status"),v=a.get("startDate"),m=a.get("endDate"),y=a.get("algorithm"),[b,g]=k.useState(d||"All"),[x,S]=k.useState(h||"All"),[w,j]=k.useState(p||"All"),[O,P]=k.useState(y||"All"),[A,E]=k.useState("All Time"),[N,T]=k.useState(v||void 0),[M,R]=k.useState(m||void 0);k.useEffect(()=>{n.provider===!1&&x!=="All"&&S("All"),n.status===!1&&w!=="All"&&j("All"),n.algorithm===!1&&O!=="All"&&P("All")},[n.provider,n.status,n.algorithm]),k.useEffect(()=>{h?h!==x&&S(h):x!=="All"&&S("All"),d?d!==b&&g(d):b!=="All"&&g("All"),p?p!==w&&j(p):w!=="All"&&j("All"),v!==N&&T(v||void 0),m!==M&&R(m||void 0),!v&&!m&&A!=="All Time"?E("All Time"):(v||m)&&A==="All Time"&&E("Custom")},[h,d,p,v,m,f]);const D=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.project))).sort(),[l]),L=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.provider))).sort(),[l]),z=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.status))).sort(),[l]),C=()=>{const V={project:n.project===!1||b==="All"?void 0:b,provider:n.provider===!1||x==="All"?void 0:x,status:n.status===!1||w==="All"?void 0:w,algorithm:n.algorithm===!1||O==="All"?void 0:O,startDate:n.time===!1?void 0:N,endDate:n.time===!1?void 0:M};if(console.log("FilterRibbon: Calling onFilterChange with",V),e==null||e(V),f){const ie=new URLSearchParams(a),Le=a.get("type");Le&&ie.set("type",Le),V.project?ie.set("project",V.project):ie.delete("project"),V.provider?ie.set("provider",V.provider):ie.delete("provider"),V.status?ie.set("status",V.status):ie.delete("status"),V.startDate?ie.set("startDate",V.startDate):ie.delete("startDate"),V.endDate?ie.set("endDate",V.endDate):ie.delete("endDate"),V.algorithm?ie.set("algorithm",V.algorithm):ie.delete("algorithm"),s(`/runs-filtered?${ie.toString()}`,{replace:!0})}},B=V=>{g(V)},U=V=>{S(V)},G=V=>{j(V)},q=V=>{P(V)},ee=V=>{if(E(V),V==="All Time")T(void 0),R(void 0);else if(V!=="Custom"){const ie=new Date;let Le=null;switch(V){case"Last 24 Hours":Le=new Date(ie.getTime()-24*60*60*1e3);break;case"Last 7 Days":Le=new Date(ie.getTime()-7*24*60*60*1e3);break;case"Last 30 Days":Le=new Date(ie.getTime()-30*24*60*60*1e3);break}const ot=Le?Le.toISOString().replace(/\.\d{3}Z$/,"Z").replace("+00:00","Z"):void 0,Q=ie.toISOString().replace("+00:00","Z");T(ot),R(Q)}},ce=(V,ie)=>{let Le,ot;V&&(Le=new Date(V+"T00:00:00.000Z").toISOString().replace(/\.\d{3}Z$/,"Z").replace("+00:00","Z")),ie&&(ot=new Date(ie+"T23:59:59.999Z").toISOString().replace("+00:00","Z")),T(Le),R(ot),E("Custom")};return k.useEffect(()=>{console.log("FilterRibbon: Filter state changed",{project:b,provider:x,status:w,algorithm:O,startDate:N,endDate:M}),C()},[b,x,w,O,N,M]),c.jsxs("div",{className:"bg-dark-surface border-b border-dark-border px-6 py-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-4 flex-1",title:t?r:void 0,children:[n.project!==!1&&c.jsxs("select",{value:b,onChange:V=>B(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Projects"}),D.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.provider!==!1&&c.jsxs("select",{value:x,onChange:V=>U(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Providers"}),L.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.status!==!1&&c.jsxs("select",{value:w,onChange:V=>G(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Statuses"}),z.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.algorithm===!0&&u.length>0&&c.jsxs("select",{value:O,onChange:V=>q(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Algorithms"}),u.map(V=>c.jsxs("option",{value:V.name,children:[V.name," (",V.count,")"]},V.name))]}),n.time!==!1&&c.jsxs("select",{value:A,onChange:V=>ee(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All Time",children:"All Time"}),c.jsx("option",{value:"Last 24 Hours",children:"Last 24 Hours"}),c.jsx("option",{value:"Last 7 Days",children:"Last 7 Days"}),c.jsx("option",{value:"Last 30 Days",children:"Last 30 Days"}),c.jsx("option",{value:"Custom",children:"Custom"})]}),n.time!==!1&&A==="Custom"&&!t&&c.jsx(FI,{onDateRangeChange:ce,initialStartDate:N?new Date(N).toISOString().split("T")[0]:void 0,initialEndDate:M?new Date(M).toISOString().split("T")[0]:void 0})]}),c.jsx("div",{className:"flex-1"}),!t&&i&&c.jsx(UI,{filters:{project:n.project===!1||b==="All"?void 0:b,provider:n.provider===!1||x==="All"?void 0:x,status:n.status===!1||w==="All"?void 0:w,algorithm:n.algorithm===!1||O==="All"?void 0:O,startDate:n.time===!1?void 0:N,endDate:n.time===!1?void 0:M}})]})}function UI({filters:e}){const[t,r]=k.useState(!1),i=Vi().pathname==="/",a=()=>{const l=new URLSearchParams;l.set("type","home"),e.project&&l.set("project",e.project),e.startDate&&l.set("startDate",e.startDate),e.endDate&&l.set("endDate",e.endDate);const u=`/report?${l.toString()}`;window.open(u,"_blank","noopener,noreferrer")},{refetch:o}=Qe({queryKey:["runs-export",e],queryFn:()=>Ye.getRuns({limit:1e4,...e}),enabled:!1}),s=async()=>{r(!0);try{const u=(await o()).data||[];if(u.length===0){alert("No data to export with current filters"),r(!1);return}const f=[];e.project&&f.push(e.project),e.provider&&f.push(e.provider),e.status&&f.push(e.status);const d=f.length>0?`qobserva-${f.join("-")}`:"qobserva-all-runs";Kx(u,d)}catch(l){console.error("Export failed:",l),alert("Failed to export data. Please try again.")}finally{r(!1)}};return i?c.jsxs("button",{onClick:a,className:"btn-secondary flex items-center gap-2",title:"Export dashboard via browser print (Save as PDF)",children:[c.jsx(lD,{size:16}),"Export PDF"]}):c.jsxs("button",{onClick:s,disabled:t,className:"btn-secondary flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Export filtered runs to CSV",children:[c.jsx(Eh,{size:16}),t?"Exporting...":"Export"]})}const xn="/assets/qoblogo-E43t-2-U.png",qI=[{path:"/",icon:sD,label:"Home"},{path:"/search",icon:Yf,label:"Search Runs"},{path:"/compare",icon:oD,label:"Compare"},{path:"/analytics",icon:ZR,label:"Run Analytics"},{path:"/algorithms",icon:tD,label:"Algorithm Analytics"},{path:"/reports",icon:iD,label:"Generate Report"},{path:"/settings",icon:uD,label:"Settings"}];function WI({children:e,onFilterChange:t}){const r=Vi(),n=r.pathname==="/report",i=r.pathname.startsWith("/runs/"),a=r.pathname==="/compare",o=r.pathname==="/search",s=r.pathname==="/analytics",l=r.pathname==="/algorithms",u=r.pathname==="/reports",f=r.pathname==="/settings",d=i||a||o||u||f;return n?c.jsx("div",{className:"min-h-screen bg-white text-black",children:e}):c.jsxs("div",{className:"min-h-screen bg-dark-bg",children:[c.jsxs("aside",{className:"fixed left-0 top-0 h-screen w-80 bg-dark-surface border-r border-dark-border flex flex-col",children:[c.jsx("div",{className:"p-6 border-b border-dark-border relative",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 min-w-0 pr-3",children:[c.jsx("h1",{className:"text-2xl font-bold text-white leading-tight",children:"QObserva"}),c.jsx("p",{className:"text-sm text-dark-text-muted leading-tight mt-0.5 whitespace-nowrap",children:"Quantum Observability"})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-16 w-16 sm:h-20 sm:w-20 md:h-24 md:w-24 object-contain flex-shrink-0"})]})}),c.jsx("nav",{className:"flex-1 p-4 space-y-2",children:qI.map(h=>{const p=h.icon,v=r.pathname===h.path;return c.jsxs(KR,{to:h.path,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${v?"bg-primary/20 text-primary border border-primary/30":"text-dark-text-muted hover:bg-dark-bg hover:text-dark-text"}`,children:[c.jsx(p,{size:20}),c.jsx("span",{className:"font-medium",children:h.label})]},h.path)})})]}),c.jsxs("div",{className:"ml-80",children:[c.jsx(zI,{onFilterChange:t,disabled:d,visible:s?{project:!0,provider:!1,status:!1,time:!0,algorithm:!1}:l?{project:!0,provider:!0,status:!0,time:!0,algorithm:!1}:void 0,showExport:!(u||f||s||l),disabledMessage:i?"Filters are not available for individual run details":u?"Filters are not used on Generate Report (use the report inputs instead)":f?"Filters are not used on Settings":"Filters are not available for run comparisons"}),c.jsx("main",{className:"p-8",children:e})]})]})}function be({label:e,value:t,change:r,onClick:n,clickable:i=!1}){const a=()=>{i&&n&&n()};return c.jsxs("div",{className:`metric-card ${i?"cursor-pointer hover:border-primary/50 transition-colors":""}`,onClick:a,children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:e}),c.jsx("div",{className:"text-3xl font-bold text-white",children:t}),r&&c.jsx("div",{className:"text-xs text-dark-text-muted mt-2",children:r})]})}function jA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var qL=UL,WL=Dh;function HL(e,t){var r=this.__data__,n=WL(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var KL=HL,VL=EL,GL=IL,QL=BL,YL=qL,XL=KL;function zs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t({"Run ID":n.run_id,Time:new Date(n.created_at).toISOString(),Project:n.project,Provider:n.provider,Backend:n.backend_name,Status:n.status,Shots:n.shots}));jA(r,t)}function zI(e,t="qobserva-backends"){const r=e.map(n=>({"Backend Name":n.backend_name,Provider:n.provider,"Total Runs":n.total,Success:n.success,Failed:n.failed,Cancelled:n.cancelled,"Success Rate (%)":n.total>0?(n.success/n.total*100).toFixed(2):"0.00"}));jA(r,t)}function UI({onFilterChange:e,disabled:t=!1,disabledMessage:r="Filters are not available for individual run details or comparisons",visible:n={project:!0,provider:!0,status:!0,time:!0,algorithm:!1},showExport:i=!0}){const[a]=Ah(),o=Vi(),s=mt(),{data:l=[]}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3})}),{data:u=[]}=Qe({queryKey:["algorithms"],queryFn:()=>Ye.getAlgorithms(),enabled:n.algorithm===!0}),f=o.pathname==="/runs-filtered",d=a.get("project"),h=a.get("provider"),p=a.get("status"),v=a.get("startDate"),m=a.get("endDate"),y=a.get("algorithm"),[b,g]=k.useState(d||"All"),[x,S]=k.useState(h||"All"),[w,j]=k.useState(p||"All"),[O,P]=k.useState(y||"All"),[A,E]=k.useState("All Time"),[N,T]=k.useState(v||void 0),[M,R]=k.useState(m||void 0);k.useEffect(()=>{n.provider===!1&&x!=="All"&&S("All"),n.status===!1&&w!=="All"&&j("All"),n.algorithm===!1&&O!=="All"&&P("All")},[n.provider,n.status,n.algorithm]),k.useEffect(()=>{h?h!==x&&S(h):x!=="All"&&S("All"),d?d!==b&&g(d):b!=="All"&&g("All"),p?p!==w&&j(p):w!=="All"&&j("All"),v!==N&&T(v||void 0),m!==M&&R(m||void 0),!v&&!m&&A!=="All Time"?E("All Time"):(v||m)&&A==="All Time"&&E("Custom")},[h,d,p,v,m,f]);const D=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.project))).sort(),[l]),L=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.provider))).sort(),[l]),U=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.status))).sort(),[l]),C=()=>{const V={project:n.project===!1||b==="All"?void 0:b,provider:n.provider===!1||x==="All"?void 0:x,status:n.status===!1||w==="All"?void 0:w,algorithm:n.algorithm===!1||O==="All"?void 0:O,startDate:n.time===!1?void 0:N,endDate:n.time===!1?void 0:M};if(e==null||e(V),f){const ie=new URLSearchParams(a),Le=a.get("type");Le&&ie.set("type",Le),V.project?ie.set("project",V.project):ie.delete("project"),V.provider?ie.set("provider",V.provider):ie.delete("provider"),V.status?ie.set("status",V.status):ie.delete("status"),V.startDate?ie.set("startDate",V.startDate):ie.delete("startDate"),V.endDate?ie.set("endDate",V.endDate):ie.delete("endDate"),V.algorithm?ie.set("algorithm",V.algorithm):ie.delete("algorithm"),s(`/runs-filtered?${ie.toString()}`,{replace:!0})}},F=V=>{g(V)},z=V=>{S(V)},G=V=>{j(V)},q=V=>{P(V)},ee=V=>{if(E(V),V==="All Time")T(void 0),R(void 0);else if(V!=="Custom"){const ie=new Date;let Le=null;switch(V){case"Last 24 Hours":Le=new Date(ie.getTime()-24*60*60*1e3);break;case"Last 7 Days":Le=new Date(ie.getTime()-7*24*60*60*1e3);break;case"Last 30 Days":Le=new Date(ie.getTime()-30*24*60*60*1e3);break}const ot=Le?Le.toISOString().replace(/\.\d{3}Z$/,"Z").replace("+00:00","Z"):void 0,Q=ie.toISOString().replace("+00:00","Z");T(ot),R(Q)}},ce=(V,ie)=>{let Le,ot;V&&(Le=new Date(V+"T00:00:00.000Z").toISOString().replace(/\.\d{3}Z$/,"Z").replace("+00:00","Z")),ie&&(ot=new Date(ie+"T23:59:59.999Z").toISOString().replace("+00:00","Z")),T(Le),R(ot),E("Custom")};return k.useEffect(()=>{C()},[b,x,w,O,N,M]),c.jsxs("div",{className:"bg-dark-surface border-b border-dark-border px-6 py-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-4 flex-1",title:t?r:void 0,children:[n.project!==!1&&c.jsxs("select",{value:b,onChange:V=>F(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Projects"}),D.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.provider!==!1&&c.jsxs("select",{value:x,onChange:V=>z(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Providers"}),L.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.status!==!1&&c.jsxs("select",{value:w,onChange:V=>G(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Statuses"}),U.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.algorithm===!0&&u.length>0&&c.jsxs("select",{value:O,onChange:V=>q(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Algorithms"}),u.map(V=>c.jsxs("option",{value:V.name,children:[V.name," (",V.count,")"]},V.name))]}),n.time!==!1&&c.jsxs("select",{value:A,onChange:V=>ee(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All Time",children:"All Time"}),c.jsx("option",{value:"Last 24 Hours",children:"Last 24 Hours"}),c.jsx("option",{value:"Last 7 Days",children:"Last 7 Days"}),c.jsx("option",{value:"Last 30 Days",children:"Last 30 Days"}),c.jsx("option",{value:"Custom",children:"Custom"})]}),n.time!==!1&&A==="Custom"&&!t&&c.jsx(BI,{onDateRangeChange:ce,initialStartDate:N?new Date(N).toISOString().split("T")[0]:void 0,initialEndDate:M?new Date(M).toISOString().split("T")[0]:void 0})]}),c.jsx("div",{className:"flex-1"}),!t&&i&&c.jsx(qI,{filters:{project:n.project===!1||b==="All"?void 0:b,provider:n.provider===!1||x==="All"?void 0:x,status:n.status===!1||w==="All"?void 0:w,algorithm:n.algorithm===!1||O==="All"?void 0:O,startDate:n.time===!1?void 0:N,endDate:n.time===!1?void 0:M}})]})}function qI({filters:e}){const[t,r]=k.useState(!1),i=Vi().pathname==="/",a=()=>{const l=new URLSearchParams;l.set("type","home"),e.project&&l.set("project",e.project),e.startDate&&l.set("startDate",e.startDate),e.endDate&&l.set("endDate",e.endDate);const u=`/report?${l.toString()}`;window.open(u,"_blank","noopener,noreferrer")},{refetch:o}=Qe({queryKey:["runs-export",e],queryFn:()=>Ye.getRuns({limit:1e4,...e}),enabled:!1}),s=async()=>{r(!0);try{const u=(await o()).data||[];if(u.length===0){alert("No data to export with current filters"),r(!1);return}const f=[];e.project&&f.push(e.project),e.provider&&f.push(e.provider),e.status&&f.push(e.status);const d=f.length>0?`qobserva-${f.join("-")}`:"qobserva-all-runs";Vx(u,d)}catch(l){console.error("Export failed:",l),alert("Failed to export data. Please try again.")}finally{r(!1)}};return i?c.jsxs("button",{onClick:a,className:"btn-secondary flex items-center gap-2",title:"Export dashboard via browser print (Save as PDF)",children:[c.jsx(uD,{size:16}),"Export PDF"]}):c.jsxs("button",{onClick:s,disabled:t,className:"btn-secondary flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Export filtered runs to CSV",children:[c.jsx(Eh,{size:16}),t?"Exporting...":"Export"]})}const xn="/assets/qoblogo-E43t-2-U.png",WI=[{path:"/",icon:lD,label:"Home"},{path:"/search",icon:Yf,label:"Search Runs"},{path:"/compare",icon:sD,label:"Compare"},{path:"/analytics",icon:JR,label:"Run Analytics"},{path:"/algorithms",icon:rD,label:"Algorithm Analytics"},{path:"/reports",icon:aD,label:"Generate Report"},{path:"/settings",icon:cD,label:"Settings"}];function HI({children:e,onFilterChange:t}){const r=Vi(),n=r.pathname==="/report",i=r.pathname.startsWith("/runs/"),a=r.pathname==="/compare",o=r.pathname==="/search",s=r.pathname==="/analytics",l=r.pathname==="/algorithms",u=r.pathname==="/reports",f=r.pathname==="/settings",d=i||a||o||u||f;return n?c.jsx("div",{className:"min-h-screen bg-white text-black",children:e}):c.jsxs("div",{className:"min-h-screen bg-dark-bg",children:[c.jsxs("aside",{className:"fixed left-0 top-0 h-screen w-80 bg-dark-surface border-r border-dark-border flex flex-col",children:[c.jsx("div",{className:"p-6 border-b border-dark-border relative",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 min-w-0 pr-3",children:[c.jsx("h1",{className:"text-2xl font-bold text-white leading-tight",children:"QObserva"}),c.jsx("p",{className:"text-sm text-dark-text-muted leading-tight mt-0.5 whitespace-nowrap",children:"Quantum Observability"})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-16 w-16 sm:h-20 sm:w-20 md:h-24 md:w-24 object-contain flex-shrink-0"})]})}),c.jsx("nav",{className:"flex-1 p-4 space-y-2",children:WI.map(h=>{const p=h.icon,v=r.pathname===h.path;return c.jsxs(VR,{to:h.path,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${v?"bg-primary/20 text-primary border border-primary/30":"text-dark-text-muted hover:bg-dark-bg hover:text-dark-text"}`,children:[c.jsx(p,{size:20}),c.jsx("span",{className:"font-medium",children:h.label})]},h.path)})})]}),c.jsxs("div",{className:"ml-80",children:[c.jsx(UI,{onFilterChange:t,disabled:d,visible:s?{project:!0,provider:!1,status:!1,time:!0,algorithm:!1}:l?{project:!0,provider:!0,status:!0,time:!0,algorithm:!1}:void 0,showExport:!(u||f||s||l),disabledMessage:i?"Filters are not available for individual run details":u?"Filters are not used on Generate Report (use the report inputs instead)":f?"Filters are not used on Settings":"Filters are not available for run comparisons"}),c.jsx("main",{className:"p-8",children:e})]})]})}function be({label:e,value:t,change:r,onClick:n,clickable:i=!1}){const a=()=>{i&&n&&n()};return c.jsxs("div",{className:`metric-card ${i?"cursor-pointer hover:border-primary/50 transition-colors":""}`,onClick:a,children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:e}),c.jsx("div",{className:"text-3xl font-bold text-white",children:t}),r&&c.jsx("div",{className:"text-xs text-dark-text-muted mt-2",children:r})]})}function OA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var WL=qL,HL=Dh;function KL(e,t){var r=this.__data__,n=HL(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var VL=KL,GL=NL,QL=LL,YL=zL,XL=WL,ZL=VL;function zs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},ya=function(t){return qa(t)&&t.indexOf("%")===t.length-1},H=function(t){return yF(t)&&!qs(t)},wF=function(t){return re(t)},pt=function(t){return H(t)||qa(t)},SF=0,Qi=function(t){var r=++SF;return"".concat(t||"").concat(r)},zt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!H(t)&&!qa(t))return n;var a;if(ya(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return qs(a)&&(a=n),i&&a>r&&(a=r),a},di=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},jF=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sy(e){"@babel/helpers - typeof";return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}var n1={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Fn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},i1=null,dm=null,ib=function e(t){if(t===i1&&Array.isArray(dm))return dm;var r=[];return k.Children.forEach(t,function(n){re(n)||(dF.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),dm=r,i1=t,r};function Wt(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Fn(i)}):n=[Fn(t)],ib(e).forEach(function(i){var a=mr(i,"type.displayName")||mr(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function fr(e,t){var r=Wt(e,t);return r&&r[0]}var a1=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!H(n)||n<=0||!H(i)||i<=0)},$F=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],CF=function(t){return t&&t.type&&qa(t.type)&&$F.indexOf(t.type)>=0},DA=function(t){return t&&sy(t)==="object"&&"clipDot"in t},MF=function(t,r,n,i){var a,o=(a=fm==null?void 0:fm[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!te(t)&&(i&&o.includes(r)||kF.includes(r))||n&&nb.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(k.isValidElement(t)&&(i=t.props),!Fs(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;MF((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},ly=function e(t,r){if(t===r)return!0;var n=k.Children.count(t);if(n!==k.Children.count(r))return!1;if(n===0)return!0;if(n===1)return o1(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cy(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=LF(e,IF),f=i||{width:r,height:n,x:0,y:0},d=oe("recharts-surface",a);return _.createElement("svg",uy({},X(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),_.createElement("title",null,s),_.createElement("desc",null,l),t)}var BF=["children","className"];function fy(){return fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function UF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var se=_.forwardRef(function(e,t){var r=e.children,n=e.className,i=zF(e,BF),a=oe("recharts-layer",n);return _.createElement("g",fy({className:a},X(i,!0),{ref:t}),r)}),en=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:HF(e,t,r)}var VF=KF,GF="\\ud800-\\udfff",QF="\\u0300-\\u036f",YF="\\ufe20-\\ufe2f",XF="\\u20d0-\\u20ff",ZF=QF+YF+XF,JF="\\ufe0e\\ufe0f",eB="\\u200d",tB=RegExp("["+eB+GF+ZF+JF+"]");function rB(e){return tB.test(e)}var IA=rB;function nB(e){return e.split("")}var iB=nB,LA="\\ud800-\\udfff",aB="\\u0300-\\u036f",oB="\\ufe20-\\ufe2f",sB="\\u20d0-\\u20ff",lB=aB+oB+sB,uB="\\ufe0e\\ufe0f",cB="["+LA+"]",dy="["+lB+"]",hy="\\ud83c[\\udffb-\\udfff]",fB="(?:"+dy+"|"+hy+")",FA="[^"+LA+"]",BA="(?:\\ud83c[\\udde6-\\uddff]){2}",zA="[\\ud800-\\udbff][\\udc00-\\udfff]",dB="\\u200d",UA=fB+"?",qA="["+uB+"]?",hB="(?:"+dB+"(?:"+[FA,BA,zA].join("|")+")"+qA+UA+")*",pB=qA+UA+hB,mB="(?:"+[FA+dy+"?",dy,BA,zA,cB].join("|")+")",vB=RegExp(hy+"(?="+hy+")|"+mB+pB,"g");function yB(e){return e.match(vB)||[]}var gB=yB,xB=iB,bB=IA,wB=gB;function SB(e){return bB(e)?wB(e):xB(e)}var jB=SB,OB=VF,PB=IA,_B=jB,kB=NA;function AB(e){return function(t){t=kB(t);var r=PB(t)?_B(t):void 0,n=r?r[0]:t.charAt(0),i=r?OB(r,1).join(""):t.slice(1);return n[e]()+i}}var EB=AB,NB=EB,TB=NB("toUpperCase"),$B=TB;const Yh=Se($B);function Te(e){return function(){return e}}const WA=Math.cos,ed=Math.sin,nn=Math.sqrt,td=Math.PI,Xh=2*td,py=Math.PI,my=2*py,sa=1e-6,CB=my-sa;function HA(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return HA;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;isa)if(!(Math.abs(d*l-u*f)>sa)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,v=i-s,m=l*l+u*u,y=p*p+v*v,b=Math.sqrt(m),g=Math.sqrt(h),x=a*Math.tan((py-Math.acos((m+h-y)/(2*b*g)))/2),S=x/g,w=x/b;Math.abs(S-1)>sa&&this._append`L${t+S*f},${r+S*d}`,this._append`A${a},${a},0,0,${+(d*p>f*v)},${this._x1=t+w*l},${this._y1=r+w*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,f=r+l,d=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>sa||Math.abs(this._y1-f)>sa)&&this._append`L${u},${f}`,n&&(h<0&&(h=h%my+my),h>CB?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:h>sa&&this._append`A${n},${n},0,${+(h>=py)},${d},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ab(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new RB(t)}function ob(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function KA(e){this._context=e}KA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Zh(e){return new KA(e)}function VA(e){return e[0]}function GA(e){return e[1]}function QA(e,t){var r=Te(!0),n=null,i=Zh,a=null,o=ab(s);e=typeof e=="function"?e:e===void 0?VA:Te(e),t=typeof t=="function"?t:t===void 0?GA:Te(t);function s(l){var u,f=(l=ob(l)).length,d,h=!1,p;for(n==null&&(a=i(p=o())),u=0;u<=f;++u)!(u=p;--v)s.point(x[v],S[v]);s.lineEnd(),s.areaEnd()}b&&(x[h]=+e(y,h,d),S[h]=+t(y,h,d),s.point(n?+n(y,h,d):x[h],r?+r(y,h,d):S[h]))}if(g)return s=null,g+""||null}function f(){return QA().defined(i).curve(o).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Te(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Te(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Te(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Te(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Te(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Te(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Te(!!d),u):i},u.curve=function(d){return arguments.length?(o=d,a!=null&&(s=o(a)),u):o},u.context=function(d){return arguments.length?(d==null?a=s=null:s=o(a=d),u):a},u}class YA{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function DB(e){return new YA(e,!0)}function IB(e){return new YA(e,!1)}const sb={draw(e,t){const r=nn(t/td);e.moveTo(r,0),e.arc(0,0,r,0,Xh)}},LB={draw(e,t){const r=nn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},XA=nn(1/3),FB=XA*2,BB={draw(e,t){const r=nn(t/FB),n=r*XA;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},zB={draw(e,t){const r=nn(t),n=-r/2;e.rect(n,n,r,r)}},UB=.8908130915292852,ZA=ed(td/10)/ed(7*td/10),qB=ed(Xh/10)*ZA,WB=-WA(Xh/10)*ZA,HB={draw(e,t){const r=nn(t*UB),n=qB*r,i=WB*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Xh*a/5,s=WA(o),l=ed(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},hm=nn(3),KB={draw(e,t){const r=-nn(t/(hm*3));e.moveTo(0,r*2),e.lineTo(-hm*r,-r),e.lineTo(hm*r,-r),e.closePath()}},Sr=-.5,jr=nn(3)/2,vy=1/nn(12),VB=(vy/2+1)*3,GB={draw(e,t){const r=nn(t/VB),n=r/2,i=r*vy,a=n,o=r*vy+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Sr*n-jr*i,jr*n+Sr*i),e.lineTo(Sr*a-jr*o,jr*a+Sr*o),e.lineTo(Sr*s-jr*l,jr*s+Sr*l),e.lineTo(Sr*n+jr*i,Sr*i-jr*n),e.lineTo(Sr*a+jr*o,Sr*o-jr*a),e.lineTo(Sr*s+jr*l,Sr*l-jr*s),e.closePath()}};function QB(e,t){let r=null,n=ab(i);e=typeof e=="function"?e:Te(e||sb),t=typeof t=="function"?t:Te(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Te(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Te(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function rd(){}function nd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function JA(e){this._context=e}JA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YB(e){return new JA(e)}function eE(e){this._context=e}eE.prototype={areaStart:rd,areaEnd:rd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XB(e){return new eE(e)}function tE(e){this._context=e}tE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZB(e){return new tE(e)}function rE(e){this._context=e}rE.prototype={areaStart:rd,areaEnd:rd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function JB(e){return new rE(e)}function l1(e){return e<0?-1:1}function u1(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(l1(a)+l1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function c1(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function pm(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function id(e){this._context=e}id.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:pm(this,this._t0,c1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,pm(this,c1(this,r=u1(this,e,t)),r);break;default:pm(this,this._t0,r=u1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function nE(e){this._context=new iE(e)}(nE.prototype=Object.create(id.prototype)).point=function(e,t){id.prototype.point.call(this,t,e)};function iE(e){this._context=e}iE.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function e8(e){return new id(e)}function t8(e){return new nE(e)}function aE(e){this._context=e}aE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=f1(e),i=f1(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function n8(e){return new Jh(e,.5)}function i8(e){return new Jh(e,0)}function a8(e){return new Jh(e,1)}function ts(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function o8(e,t){return e[t]}function s8(e){const t=[];return t.key=e,t}function l8(){var e=Te([]),t=yy,r=ts,n=o8;function i(a){var o=Array.from(e.apply(this,arguments),s8),s,l=o.length,u=-1,f;for(const d of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function y8(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var oE={symbolCircle:sb,symbolCross:LB,symbolDiamond:BB,symbolSquare:zB,symbolStar:HB,symbolTriangle:KB,symbolWye:GB},g8=Math.PI/180,x8=function(t){var r="symbol".concat(Yh(t));return oE[r]||sb},b8=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*g8;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},w8=function(t,r){oE["symbol".concat(Yh(t))]=r},ep=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=v8(t,d8),u=h1(h1({},l),{},{type:n,size:a,sizeType:s}),f=function(){var y=x8(n),b=QB().type(y).size(b8(a,s,n));return b()},d=u.className,h=u.cx,p=u.cy,v=X(u,!0);return h===+h&&p===+p&&a===+a?_.createElement("path",gy({},v,{className:oe("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};ep.registerSymbol=w8;function rs(e){"@babel/helpers - typeof";return rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(e)}function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},ya=function(t){return qa(t)&&t.indexOf("%")===t.length-1},H=function(t){return gF(t)&&!qs(t)},SF=function(t){return re(t)},pt=function(t){return H(t)||qa(t)},jF=0,Qi=function(t){var r=++jF;return"".concat(t||"").concat(r)},zt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!H(t)&&!qa(t))return n;var a;if(ya(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return qs(a)&&(a=n),i&&a>r&&(a=r),a},di=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},OF=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $F(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ly(e){"@babel/helpers - typeof";return ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ly(e)}var i1={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Fn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},a1=null,dm=null,ab=function e(t){if(t===a1&&Array.isArray(dm))return dm;var r=[];return k.Children.forEach(t,function(n){re(n)||(hF.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),dm=r,a1=t,r};function Wt(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Fn(i)}):n=[Fn(t)],ab(e).forEach(function(i){var a=mr(i,"type.displayName")||mr(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function fr(e,t){var r=Wt(e,t);return r&&r[0]}var o1=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!H(n)||n<=0||!H(i)||i<=0)},CF=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],MF=function(t){return t&&t.type&&qa(t.type)&&CF.indexOf(t.type)>=0},IA=function(t){return t&&ly(t)==="object"&&"clipDot"in t},RF=function(t,r,n,i){var a,o=(a=fm==null?void 0:fm[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!te(t)&&(i&&o.includes(r)||AF.includes(r))||n&&ib.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(k.isValidElement(t)&&(i=t.props),!Fs(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;RF((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},uy=function e(t,r){if(t===r)return!0;var n=k.Children.count(t);if(n!==k.Children.count(r))return!1;if(n===0)return!0;if(n===1)return s1(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function fy(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=FF(e,LF),f=i||{width:r,height:n,x:0,y:0},d=oe("recharts-surface",a);return _.createElement("svg",cy({},X(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),_.createElement("title",null,s),_.createElement("desc",null,l),t)}var zF=["children","className"];function dy(){return dy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var se=_.forwardRef(function(e,t){var r=e.children,n=e.className,i=UF(e,zF),a=oe("recharts-layer",n);return _.createElement("g",dy({className:a},X(i,!0),{ref:t}),r)}),en=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:KF(e,t,r)}var GF=VF,QF="\\ud800-\\udfff",YF="\\u0300-\\u036f",XF="\\ufe20-\\ufe2f",ZF="\\u20d0-\\u20ff",JF=YF+XF+ZF,eB="\\ufe0e\\ufe0f",tB="\\u200d",rB=RegExp("["+tB+QF+JF+eB+"]");function nB(e){return rB.test(e)}var LA=nB;function iB(e){return e.split("")}var aB=iB,FA="\\ud800-\\udfff",oB="\\u0300-\\u036f",sB="\\ufe20-\\ufe2f",lB="\\u20d0-\\u20ff",uB=oB+sB+lB,cB="\\ufe0e\\ufe0f",fB="["+FA+"]",hy="["+uB+"]",py="\\ud83c[\\udffb-\\udfff]",dB="(?:"+hy+"|"+py+")",BA="[^"+FA+"]",zA="(?:\\ud83c[\\udde6-\\uddff]){2}",UA="[\\ud800-\\udbff][\\udc00-\\udfff]",hB="\\u200d",qA=dB+"?",WA="["+cB+"]?",pB="(?:"+hB+"(?:"+[BA,zA,UA].join("|")+")"+WA+qA+")*",mB=WA+qA+pB,vB="(?:"+[BA+hy+"?",hy,zA,UA,fB].join("|")+")",yB=RegExp(py+"(?="+py+")|"+vB+mB,"g");function gB(e){return e.match(yB)||[]}var xB=gB,bB=aB,wB=LA,SB=xB;function jB(e){return wB(e)?SB(e):bB(e)}var OB=jB,PB=GF,_B=LA,kB=OB,AB=TA;function EB(e){return function(t){t=AB(t);var r=_B(t)?kB(t):void 0,n=r?r[0]:t.charAt(0),i=r?PB(r,1).join(""):t.slice(1);return n[e]()+i}}var NB=EB,TB=NB,$B=TB("toUpperCase"),CB=$B;const Yh=Se(CB);function Te(e){return function(){return e}}const HA=Math.cos,ed=Math.sin,nn=Math.sqrt,td=Math.PI,Xh=2*td,my=Math.PI,vy=2*my,sa=1e-6,MB=vy-sa;function KA(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return KA;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;isa)if(!(Math.abs(d*l-u*f)>sa)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,v=i-s,m=l*l+u*u,y=p*p+v*v,b=Math.sqrt(m),g=Math.sqrt(h),x=a*Math.tan((my-Math.acos((m+h-y)/(2*b*g)))/2),S=x/g,w=x/b;Math.abs(S-1)>sa&&this._append`L${t+S*f},${r+S*d}`,this._append`A${a},${a},0,0,${+(d*p>f*v)},${this._x1=t+w*l},${this._y1=r+w*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,f=r+l,d=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>sa||Math.abs(this._y1-f)>sa)&&this._append`L${u},${f}`,n&&(h<0&&(h=h%vy+vy),h>MB?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:h>sa&&this._append`A${n},${n},0,${+(h>=my)},${d},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ob(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new DB(t)}function sb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function VA(e){this._context=e}VA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Zh(e){return new VA(e)}function GA(e){return e[0]}function QA(e){return e[1]}function YA(e,t){var r=Te(!0),n=null,i=Zh,a=null,o=ob(s);e=typeof e=="function"?e:e===void 0?GA:Te(e),t=typeof t=="function"?t:t===void 0?QA:Te(t);function s(l){var u,f=(l=sb(l)).length,d,h=!1,p;for(n==null&&(a=i(p=o())),u=0;u<=f;++u)!(u=p;--v)s.point(x[v],S[v]);s.lineEnd(),s.areaEnd()}b&&(x[h]=+e(y,h,d),S[h]=+t(y,h,d),s.point(n?+n(y,h,d):x[h],r?+r(y,h,d):S[h]))}if(g)return s=null,g+""||null}function f(){return YA().defined(i).curve(o).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Te(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Te(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Te(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Te(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Te(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Te(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Te(!!d),u):i},u.curve=function(d){return arguments.length?(o=d,a!=null&&(s=o(a)),u):o},u.context=function(d){return arguments.length?(d==null?a=s=null:s=o(a=d),u):a},u}class XA{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function IB(e){return new XA(e,!0)}function LB(e){return new XA(e,!1)}const lb={draw(e,t){const r=nn(t/td);e.moveTo(r,0),e.arc(0,0,r,0,Xh)}},FB={draw(e,t){const r=nn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},ZA=nn(1/3),BB=ZA*2,zB={draw(e,t){const r=nn(t/BB),n=r*ZA;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},UB={draw(e,t){const r=nn(t),n=-r/2;e.rect(n,n,r,r)}},qB=.8908130915292852,JA=ed(td/10)/ed(7*td/10),WB=ed(Xh/10)*JA,HB=-HA(Xh/10)*JA,KB={draw(e,t){const r=nn(t*qB),n=WB*r,i=HB*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Xh*a/5,s=HA(o),l=ed(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},hm=nn(3),VB={draw(e,t){const r=-nn(t/(hm*3));e.moveTo(0,r*2),e.lineTo(-hm*r,-r),e.lineTo(hm*r,-r),e.closePath()}},Sr=-.5,jr=nn(3)/2,yy=1/nn(12),GB=(yy/2+1)*3,QB={draw(e,t){const r=nn(t/GB),n=r/2,i=r*yy,a=n,o=r*yy+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Sr*n-jr*i,jr*n+Sr*i),e.lineTo(Sr*a-jr*o,jr*a+Sr*o),e.lineTo(Sr*s-jr*l,jr*s+Sr*l),e.lineTo(Sr*n+jr*i,Sr*i-jr*n),e.lineTo(Sr*a+jr*o,Sr*o-jr*a),e.lineTo(Sr*s+jr*l,Sr*l-jr*s),e.closePath()}};function YB(e,t){let r=null,n=ob(i);e=typeof e=="function"?e:Te(e||lb),t=typeof t=="function"?t:Te(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Te(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Te(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function rd(){}function nd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function eE(e){this._context=e}eE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XB(e){return new eE(e)}function tE(e){this._context=e}tE.prototype={areaStart:rd,areaEnd:rd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZB(e){return new tE(e)}function rE(e){this._context=e}rE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JB(e){return new rE(e)}function nE(e){this._context=e}nE.prototype={areaStart:rd,areaEnd:rd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function e8(e){return new nE(e)}function u1(e){return e<0?-1:1}function c1(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(u1(a)+u1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function f1(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function pm(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function id(e){this._context=e}id.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:pm(this,this._t0,f1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,pm(this,f1(this,r=c1(this,e,t)),r);break;default:pm(this,this._t0,r=c1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function iE(e){this._context=new aE(e)}(iE.prototype=Object.create(id.prototype)).point=function(e,t){id.prototype.point.call(this,t,e)};function aE(e){this._context=e}aE.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function t8(e){return new id(e)}function r8(e){return new iE(e)}function oE(e){this._context=e}oE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=d1(e),i=d1(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function i8(e){return new Jh(e,.5)}function a8(e){return new Jh(e,0)}function o8(e){return new Jh(e,1)}function ts(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function s8(e,t){return e[t]}function l8(e){const t=[];return t.key=e,t}function u8(){var e=Te([]),t=gy,r=ts,n=s8;function i(a){var o=Array.from(e.apply(this,arguments),l8),s,l=o.length,u=-1,f;for(const d of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function g8(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var sE={symbolCircle:lb,symbolCross:FB,symbolDiamond:zB,symbolSquare:UB,symbolStar:KB,symbolTriangle:VB,symbolWye:QB},x8=Math.PI/180,b8=function(t){var r="symbol".concat(Yh(t));return sE[r]||lb},w8=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*x8;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},S8=function(t,r){sE["symbol".concat(Yh(t))]=r},ep=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=y8(t,h8),u=p1(p1({},l),{},{type:n,size:a,sizeType:s}),f=function(){var y=b8(n),b=YB().type(y).size(w8(a,s,n));return b()},d=u.className,h=u.cx,p=u.cy,v=X(u,!0);return h===+h&&p===+p&&a===+a?_.createElement("path",xy({},v,{className:oe("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};ep.registerSymbol=S8;function rs(e){"@babel/helpers - typeof";return rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(e)}function by(){return by=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var g=p.inactive?u:p.color;return _.createElement("li",xy({className:y,style:d,key:"legend-item-".concat(v)},zi(n.props,p,v)),_.createElement(cy,{width:o,height:o,viewBox:f,style:h},n.renderIcon(p)),_.createElement("span",{className:"recharts-legend-item-text",style:{color:g}},m?m(b,p,v):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return _.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(k.PureComponent);gu(lb,"displayName","Legend");gu(lb,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var T8=Ih;function $8(){this.__data__=new T8,this.size=0}var C8=$8;function M8(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var R8=M8;function D8(e){return this.__data__.get(e)}var I8=D8;function L8(e){return this.__data__.has(e)}var F8=L8,B8=Ih,z8=Yx,U8=Xx,q8=200;function W8(e,t){var r=this.__data__;if(r instanceof B8){var n=r.__data__;if(!z8||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&dz?new lz:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=v5}var db=y5,g5=Zn,x5=db,b5=Jn,w5="[object Arguments]",S5="[object Array]",j5="[object Boolean]",O5="[object Date]",P5="[object Error]",_5="[object Function]",k5="[object Map]",A5="[object Number]",E5="[object Object]",N5="[object RegExp]",T5="[object Set]",$5="[object String]",C5="[object WeakMap]",M5="[object ArrayBuffer]",R5="[object DataView]",D5="[object Float32Array]",I5="[object Float64Array]",L5="[object Int8Array]",F5="[object Int16Array]",B5="[object Int32Array]",z5="[object Uint8Array]",U5="[object Uint8ClampedArray]",q5="[object Uint16Array]",W5="[object Uint32Array]",Re={};Re[D5]=Re[I5]=Re[L5]=Re[F5]=Re[B5]=Re[z5]=Re[U5]=Re[q5]=Re[W5]=!0;Re[w5]=Re[S5]=Re[M5]=Re[j5]=Re[R5]=Re[O5]=Re[P5]=Re[_5]=Re[k5]=Re[A5]=Re[E5]=Re[N5]=Re[T5]=Re[$5]=Re[C5]=!1;function H5(e){return b5(e)&&x5(e.length)&&!!Re[g5(e)]}var K5=H5;function V5(e){return function(t){return e(t)}}var yE=V5,ld={exports:{}};ld.exports;(function(e,t){var r=OA,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(ld,ld.exports);var G5=ld.exports,Q5=K5,Y5=yE,b1=G5,w1=b1&&b1.isTypedArray,X5=w1?Y5(w1):Q5,gE=X5,Z5=t5,J5=cb,eU=sr,tU=vE,rU=fb,nU=gE,iU=Object.prototype,aU=iU.hasOwnProperty;function oU(e,t){var r=eU(e),n=!r&&J5(e),i=!r&&!n&&tU(e),a=!r&&!n&&!i&&nU(e),o=r||n||i||a,s=o?Z5(e.length,String):[],l=s.length;for(var u in e)(t||aU.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||rU(u,l)))&&s.push(u);return s}var sU=oU,lU=Object.prototype;function uU(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||lU;return e===r}var cU=uU;function fU(e,t){return function(r){return e(t(r))}}var xE=fU,dU=xE,hU=dU(Object.keys,Object),pU=hU,mU=cU,vU=pU,yU=Object.prototype,gU=yU.hasOwnProperty;function xU(e){if(!mU(e))return vU(e);var t=[];for(var r in Object(e))gU.call(e,r)&&r!="constructor"&&t.push(r);return t}var bU=xU,wU=Gx,SU=db;function jU(e){return e!=null&&SU(e.length)&&!wU(e)}var gc=jU,OU=sU,PU=bU,_U=gc;function kU(e){return _U(e)?OU(e):PU(e)}var tp=kU,AU=qz,EU=Jz,NU=tp;function TU(e){return AU(e,NU,EU)}var $U=TU,S1=$U,CU=1,MU=Object.prototype,RU=MU.hasOwnProperty;function DU(e,t,r,n,i,a){var o=r&CU,s=S1(e),l=s.length,u=S1(t),f=u.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var h=s[d];if(!(o?h in t:RU.call(t,h)))return!1}var p=a.get(e),v=a.get(t);if(p&&v)return p==t&&v==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=o;++d-1}var Mq=Cq;function Rq(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=Yq){var u=t?null:Gq(e);if(u)return Qq(u);o=!1,i=Vq,l=new Wq}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hW(e){return e.value}function pW(e,t){if(_.isValidElement(e))return _.cloneElement(e,t);if(typeof e=="function")return _.createElement(e,t);t.ref;var r=fW(t,nW);return _.createElement(lb,r)}var L1=1,ar=function(e){function t(){var r;iW(this,t);for(var n=arguments.length,i=new Array(n),a=0;aL1||Math.abs(i.height-this.lastBoundingBox.height)>L1)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Pn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,d,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();d={left:((u||0)-p.width)/2}}else d=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var v=this.getBBoxSnapshot();h={top:((f||0)-v.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Pn(Pn({},d),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,d=Pn(Pn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return _.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},pW(a,Pn(Pn({},this.props),{},{payload:_E(f,u,hW)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Pn(Pn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&H(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(k.PureComponent);rp(ar,"displayName","Legend");rp(ar,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var F1=yc,mW=cb,vW=sr,B1=F1?F1.isConcatSpreadable:void 0;function yW(e){return vW(e)||mW(e)||!!(B1&&e&&e[B1])}var gW=yW,xW=pE,bW=gW;function EE(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=bW),i||(i=[]);++a0&&r(s)?t>1?EE(s,t-1,r,n,i):xW(i,s):n||(i[i.length]=s)}return i}var NE=EE;function wW(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var SW=wW,jW=SW,OW=jW(),PW=OW,_W=PW,kW=tp;function AW(e,t){return e&&_W(e,t,kW)}var TE=AW,EW=gc;function NW(e,t){return function(r,n){if(r==null)return r;if(!EW(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var WW=qW,gm=Jx,HW=eb,KW=jn,VW=$E,GW=FW,QW=yE,YW=WW,XW=Ks,ZW=sr;function JW(e,t,r){t.length?t=gm(t,function(a){return ZW(a)?function(o){return HW(o,a.length===1?a[0]:a)}:a}):t=[XW];var n=-1;t=gm(t,QW(KW));var i=VW(e,function(a,o,s){var l=gm(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return GW(i,function(a,o){return YW(a,o,r)})}var e9=JW;function t9(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var r9=t9,n9=r9,U1=Math.max;function i9(e,t,r){return t=U1(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=U1(n.length-t,0),o=Array(a);++i0){if(++t>=p9)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var g9=y9,x9=h9,b9=g9,w9=b9(x9),S9=w9,j9=Ks,O9=a9,P9=S9;function _9(e,t){return P9(O9(e,t,j9),e+"")}var k9=_9,A9=Qx,E9=gc,N9=fb,T9=Gi;function $9(e,t,r){if(!T9(r))return!1;var n=typeof t;return(n=="number"?E9(r)&&N9(t,r.length):n=="string"&&t in r)?A9(r[t],e):!1}var np=$9,C9=NE,M9=e9,R9=k9,W1=np,D9=R9(function(e,t){if(e==null)return[];var r=t.length;return r>1&&W1(e,t[0],t[1])?t=[]:r>2&&W1(t[0],t[1],t[2])&&(t=[t[0]]),M9(e,C9(t,1),[])}),I9=D9;const mb=Se(I9);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function ky(){return ky=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(hl,"-left"),H(r)&&t&&H(t.x)&&r=t.y),"".concat(hl,"-top"),H(n)&&t&&H(t.y)&&nm?Math.max(f,l[n]):Math.max(d,l[n])}function Z9(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function J9(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=V1({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),d=V1({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=Z9({translateX:f,translateY:d,useTranslate3d:s})):u=Y9,{cssProperties:u,cssClasses:X9({translateX:f,translateY:d,coordinate:r})}}function is(e){"@babel/helpers - typeof";return is=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},is(e)}function G1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Q1(e){for(var t=1;tY1||Math.abs(n.height-this.state.lastBoundingBox.height)>Y1)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,f=i.coordinate,d=i.hasPayload,h=i.isAnimationActive,p=i.offset,v=i.position,m=i.reverseDirection,y=i.useTranslate3d,b=i.viewBox,g=i.wrapperStyle,x=J9({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:v,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:b}),S=x.cssClasses,w=x.cssProperties,j=Q1(Q1({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},g);return _.createElement("div",{tabIndex:-1,className:S,style:j,ref:function(P){n.wrapperNode=P}},u)}}])}(k.PureComponent),uH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},On={isSsr:uH()};function as(e){"@babel/helpers - typeof";return as=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},as(e)}function X1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Z1(e){for(var t=1;t0;return _.createElement(lH,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:f,hasPayload:j,offset:p,position:y,reverseDirection:b,useTranslate3d:g,viewBox:x,wrapperStyle:S},xH(u,Z1(Z1({},this.props),{},{payload:w})))}}])}(k.PureComponent);vb($e,"displayName","Tooltip");vb($e,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!On.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var bH=Sn,wH=function(){return bH.Date.now()},SH=wH,jH=/\s/;function OH(e){for(var t=e.length;t--&&jH.test(e.charAt(t)););return t}var PH=OH,_H=PH,kH=/^\s+/;function AH(e){return e&&e.slice(0,_H(e)+1).replace(kH,"")}var EH=AH,NH=EH,J1=Gi,TH=Ls,eS=NaN,$H=/^[-+]0x[0-9a-f]+$/i,CH=/^0b[01]+$/i,MH=/^0o[0-7]+$/i,RH=parseInt;function DH(e){if(typeof e=="number")return e;if(TH(e))return eS;if(J1(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=J1(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=NH(e);var r=CH.test(e);return r||MH.test(e)?RH(e.slice(2),r?2:8):$H.test(e)?eS:+e}var LE=DH,IH=Gi,bm=SH,tS=LE,LH="Expected a function",FH=Math.max,BH=Math.min;function zH(e,t,r){var n,i,a,o,s,l,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(LH);t=tS(t)||0,IH(r)&&(f=!!r.leading,d="maxWait"in r,a=d?FH(tS(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function p(j){var O=n,P=i;return n=i=void 0,u=j,o=e.apply(P,O),o}function v(j){return u=j,s=setTimeout(b,t),f?p(j):o}function m(j){var O=j-l,P=j-u,A=t-O;return d?BH(A,a-P):A}function y(j){var O=j-l,P=j-u;return l===void 0||O>=t||O<0||d&&P>=a}function b(){var j=bm();if(y(j))return g(j);s=setTimeout(b,m(j))}function g(j){return s=void 0,h&&n?p(j):(n=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:g(bm())}function w(){var j=bm(),O=y(j);if(n=arguments,i=this,l=j,O){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(b,t),p(l)}return s===void 0&&(s=setTimeout(b,t)),o}return w.cancel=x,w.flush=S,w}var UH=zH,qH=UH,WH=Gi,HH="Expected a function";function KH(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(HH);return WH(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),qH(e,t,{leading:n,maxWait:t,trailing:i})}var VH=KH;const FE=Se(VH);function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function rS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=FE(M,m,{trailing:!0,leading:!1}));var R=new ResizeObserver(M),D=w.current.getBoundingClientRect(),L=D.width,z=D.height;return N(L,z),R.observe(w.current),function(){R.disconnect()}},[N,m]);var T=k.useMemo(function(){var M=A.containerWidth,R=A.containerHeight;if(M<0||R<0)return null;en(ya(o)||ya(l),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(o,",").concat(o,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return _.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Or/8,"h").concat(Or,"v").concat(Or*3/4,"h").concat(-Or,"z"),className:"recharts-legend-icon"});if(_.isValidElement(n.legendIcon)){var u=j8({},n);return delete u.legendIcon,_.cloneElement(n.legendIcon,u)}return _.createElement(ep,{fill:l,cx:a,cy:a,size:Or,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,s=i.layout,l=i.formatter,u=i.inactiveColor,f={x:0,y:0,width:Or,height:Or},d={display:s==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,v){var m=p.formatter||l,y=oe(gu(gu({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",p.inactive));if(p.type==="none")return null;var b=te(p.value)?null:p.value;en(!te(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var g=p.inactive?u:p.color;return _.createElement("li",by({className:y,style:d,key:"legend-item-".concat(v)},zi(n.props,p,v)),_.createElement(fy,{width:o,height:o,viewBox:f,style:h},n.renderIcon(p)),_.createElement("span",{className:"recharts-legend-item-text",style:{color:g}},m?m(b,p,v):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return _.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(k.PureComponent);gu(ub,"displayName","Legend");gu(ub,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var $8=Ih;function C8(){this.__data__=new $8,this.size=0}var M8=C8;function R8(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var D8=R8;function I8(e){return this.__data__.get(e)}var L8=I8;function F8(e){return this.__data__.has(e)}var B8=F8,z8=Ih,U8=Xx,q8=Zx,W8=200;function H8(e,t){var r=this.__data__;if(r instanceof z8){var n=r.__data__;if(!U8||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&hz?new uz:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=y5}var hb=g5,x5=Zn,b5=hb,w5=Jn,S5="[object Arguments]",j5="[object Array]",O5="[object Boolean]",P5="[object Date]",_5="[object Error]",k5="[object Function]",A5="[object Map]",E5="[object Number]",N5="[object Object]",T5="[object RegExp]",$5="[object Set]",C5="[object String]",M5="[object WeakMap]",R5="[object ArrayBuffer]",D5="[object DataView]",I5="[object Float32Array]",L5="[object Float64Array]",F5="[object Int8Array]",B5="[object Int16Array]",z5="[object Int32Array]",U5="[object Uint8Array]",q5="[object Uint8ClampedArray]",W5="[object Uint16Array]",H5="[object Uint32Array]",Re={};Re[I5]=Re[L5]=Re[F5]=Re[B5]=Re[z5]=Re[U5]=Re[q5]=Re[W5]=Re[H5]=!0;Re[S5]=Re[j5]=Re[R5]=Re[O5]=Re[D5]=Re[P5]=Re[_5]=Re[k5]=Re[A5]=Re[E5]=Re[N5]=Re[T5]=Re[$5]=Re[C5]=Re[M5]=!1;function K5(e){return w5(e)&&b5(e.length)&&!!Re[x5(e)]}var V5=K5;function G5(e){return function(t){return e(t)}}var gE=G5,ld={exports:{}};ld.exports;(function(e,t){var r=PA,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(ld,ld.exports);var Q5=ld.exports,Y5=V5,X5=gE,w1=Q5,S1=w1&&w1.isTypedArray,Z5=S1?X5(S1):Y5,xE=Z5,J5=r5,eU=fb,tU=sr,rU=yE,nU=db,iU=xE,aU=Object.prototype,oU=aU.hasOwnProperty;function sU(e,t){var r=tU(e),n=!r&&eU(e),i=!r&&!n&&rU(e),a=!r&&!n&&!i&&iU(e),o=r||n||i||a,s=o?J5(e.length,String):[],l=s.length;for(var u in e)(t||oU.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||nU(u,l)))&&s.push(u);return s}var lU=sU,uU=Object.prototype;function cU(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||uU;return e===r}var fU=cU;function dU(e,t){return function(r){return e(t(r))}}var bE=dU,hU=bE,pU=hU(Object.keys,Object),mU=pU,vU=fU,yU=mU,gU=Object.prototype,xU=gU.hasOwnProperty;function bU(e){if(!vU(e))return yU(e);var t=[];for(var r in Object(e))xU.call(e,r)&&r!="constructor"&&t.push(r);return t}var wU=bU,SU=Qx,jU=hb;function OU(e){return e!=null&&jU(e.length)&&!SU(e)}var gc=OU,PU=lU,_U=wU,kU=gc;function AU(e){return kU(e)?PU(e):_U(e)}var tp=AU,EU=Wz,NU=e5,TU=tp;function $U(e){return EU(e,TU,NU)}var CU=$U,j1=CU,MU=1,RU=Object.prototype,DU=RU.hasOwnProperty;function IU(e,t,r,n,i,a){var o=r&MU,s=j1(e),l=s.length,u=j1(t),f=u.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var h=s[d];if(!(o?h in t:DU.call(t,h)))return!1}var p=a.get(e),v=a.get(t);if(p&&v)return p==t&&v==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=o;++d-1}var Rq=Mq;function Dq(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=Xq){var u=t?null:Qq(e);if(u)return Yq(u);o=!1,i=Gq,l=new Hq}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pW(e){return e.value}function mW(e,t){if(_.isValidElement(e))return _.cloneElement(e,t);if(typeof e=="function")return _.createElement(e,t);t.ref;var r=dW(t,iW);return _.createElement(ub,r)}var F1=1,ar=function(e){function t(){var r;aW(this,t);for(var n=arguments.length,i=new Array(n),a=0;aF1||Math.abs(i.height-this.lastBoundingBox.height)>F1)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Pn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,d,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();d={left:((u||0)-p.width)/2}}else d=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var v=this.getBBoxSnapshot();h={top:((f||0)-v.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Pn(Pn({},d),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,d=Pn(Pn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return _.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},mW(a,Pn(Pn({},this.props),{},{payload:kE(f,u,pW)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Pn(Pn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&H(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(k.PureComponent);rp(ar,"displayName","Legend");rp(ar,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var B1=yc,vW=fb,yW=sr,z1=B1?B1.isConcatSpreadable:void 0;function gW(e){return yW(e)||vW(e)||!!(z1&&e&&e[z1])}var xW=gW,bW=mE,wW=xW;function NE(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=wW),i||(i=[]);++a0&&r(s)?t>1?NE(s,t-1,r,n,i):bW(i,s):n||(i[i.length]=s)}return i}var TE=NE;function SW(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var jW=SW,OW=jW,PW=OW(),_W=PW,kW=_W,AW=tp;function EW(e,t){return e&&kW(e,t,AW)}var $E=EW,NW=gc;function TW(e,t){return function(r,n){if(r==null)return r;if(!NW(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var HW=WW,gm=eb,KW=tb,VW=jn,GW=CE,QW=BW,YW=gE,XW=HW,ZW=Ks,JW=sr;function e9(e,t,r){t.length?t=gm(t,function(a){return JW(a)?function(o){return KW(o,a.length===1?a[0]:a)}:a}):t=[ZW];var n=-1;t=gm(t,YW(VW));var i=GW(e,function(a,o,s){var l=gm(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return QW(i,function(a,o){return XW(a,o,r)})}var t9=e9;function r9(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var n9=r9,i9=n9,q1=Math.max;function a9(e,t,r){return t=q1(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=q1(n.length-t,0),o=Array(a);++i0){if(++t>=m9)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var x9=g9,b9=p9,w9=x9,S9=w9(b9),j9=S9,O9=Ks,P9=o9,_9=j9;function k9(e,t){return _9(P9(e,t,O9),e+"")}var A9=k9,E9=Yx,N9=gc,T9=db,$9=Gi;function C9(e,t,r){if(!$9(r))return!1;var n=typeof t;return(n=="number"?N9(r)&&T9(t,r.length):n=="string"&&t in r)?E9(r[t],e):!1}var np=C9,M9=TE,R9=t9,D9=A9,H1=np,I9=D9(function(e,t){if(e==null)return[];var r=t.length;return r>1&&H1(e,t[0],t[1])?t=[]:r>2&&H1(t[0],t[1],t[2])&&(t=[t[0]]),R9(e,M9(t,1),[])}),L9=I9;const vb=Se(L9);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(hl,"-left"),H(r)&&t&&H(t.x)&&r=t.y),"".concat(hl,"-top"),H(n)&&t&&H(t.y)&&nm?Math.max(f,l[n]):Math.max(d,l[n])}function J9(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function eH(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=G1({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),d=G1({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=J9({translateX:f,translateY:d,useTranslate3d:s})):u=X9,{cssProperties:u,cssClasses:Z9({translateX:f,translateY:d,coordinate:r})}}function is(e){"@babel/helpers - typeof";return is=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},is(e)}function Q1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Y1(e){for(var t=1;tX1||Math.abs(n.height-this.state.lastBoundingBox.height)>X1)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,f=i.coordinate,d=i.hasPayload,h=i.isAnimationActive,p=i.offset,v=i.position,m=i.reverseDirection,y=i.useTranslate3d,b=i.viewBox,g=i.wrapperStyle,x=eH({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:v,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:b}),S=x.cssClasses,w=x.cssProperties,j=Y1(Y1({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},g);return _.createElement("div",{tabIndex:-1,className:S,style:j,ref:function(P){n.wrapperNode=P}},u)}}])}(k.PureComponent),cH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},On={isSsr:cH()};function as(e){"@babel/helpers - typeof";return as=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},as(e)}function Z1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function J1(e){for(var t=1;t0;return _.createElement(uH,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:f,hasPayload:j,offset:p,position:y,reverseDirection:b,useTranslate3d:g,viewBox:x,wrapperStyle:S},bH(u,J1(J1({},this.props),{},{payload:w})))}}])}(k.PureComponent);yb($e,"displayName","Tooltip");yb($e,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!On.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var wH=Sn,SH=function(){return wH.Date.now()},jH=SH,OH=/\s/;function PH(e){for(var t=e.length;t--&&OH.test(e.charAt(t)););return t}var _H=PH,kH=_H,AH=/^\s+/;function EH(e){return e&&e.slice(0,kH(e)+1).replace(AH,"")}var NH=EH,TH=NH,eS=Gi,$H=Ls,tS=NaN,CH=/^[-+]0x[0-9a-f]+$/i,MH=/^0b[01]+$/i,RH=/^0o[0-7]+$/i,DH=parseInt;function IH(e){if(typeof e=="number")return e;if($H(e))return tS;if(eS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=eS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=TH(e);var r=MH.test(e);return r||RH.test(e)?DH(e.slice(2),r?2:8):CH.test(e)?tS:+e}var FE=IH,LH=Gi,bm=jH,rS=FE,FH="Expected a function",BH=Math.max,zH=Math.min;function UH(e,t,r){var n,i,a,o,s,l,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(FH);t=rS(t)||0,LH(r)&&(f=!!r.leading,d="maxWait"in r,a=d?BH(rS(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function p(j){var O=n,P=i;return n=i=void 0,u=j,o=e.apply(P,O),o}function v(j){return u=j,s=setTimeout(b,t),f?p(j):o}function m(j){var O=j-l,P=j-u,A=t-O;return d?zH(A,a-P):A}function y(j){var O=j-l,P=j-u;return l===void 0||O>=t||O<0||d&&P>=a}function b(){var j=bm();if(y(j))return g(j);s=setTimeout(b,m(j))}function g(j){return s=void 0,h&&n?p(j):(n=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:g(bm())}function w(){var j=bm(),O=y(j);if(n=arguments,i=this,l=j,O){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(b,t),p(l)}return s===void 0&&(s=setTimeout(b,t)),o}return w.cancel=x,w.flush=S,w}var qH=UH,WH=qH,HH=Gi,KH="Expected a function";function VH(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(KH);return HH(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),WH(e,t,{leading:n,maxWait:t,trailing:i})}var GH=VH;const BE=Se(GH);function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function nS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=BE(M,m,{trailing:!0,leading:!1}));var R=new ResizeObserver(M),D=w.current.getBoundingClientRect(),L=D.width,U=D.height;return N(L,U),R.observe(w.current),function(){R.disconnect()}},[N,m]);var T=k.useMemo(function(){var M=A.containerWidth,R=A.containerHeight;if(M<0||R<0)return null;en(ya(o)||ya(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,l),en(!r||r>0,"The aspect(%s) must be greater than zero.",r);var D=ya(o)?M:o,L=ya(l)?R:l;r&&r>0&&(D?L=D/r:L&&(D=L*r),h&&L>h&&(L=h)),en(D>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,D,L,o,l,f,d,r);var z=!Array.isArray(p)&&Fn(p.type).endsWith("Chart");return _.Children.map(p,function(C){return _.isValidElement(C)?k.cloneElement(C,Qc({width:D,height:L},z?{style:Qc({height:"100%",width:"100%",maxHeight:L,maxWidth:D},C.props.style)}:{})):C})},[r,p,l,h,d,f,A,o]);return _.createElement("div",{id:y?"".concat(y):void 0,className:oe("recharts-responsive-container",b),style:Qc(Qc({},S),{},{width:o,height:l,minWidth:f,minHeight:d,maxHeight:h}),ref:w},T)}),vr=function(t){return null};vr.displayName="Cell";function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function iS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ty(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||On.isSsr)return{width:0,height:0};var n=sK(r),i=JSON.stringify({text:t,copyStyle:n});if(no.widthCache[i])return no.widthCache[i];try{var a=document.getElementById(aS);a||(a=document.createElement("span"),a.setAttribute("id",aS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Ty(Ty({},oK),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return no.widthCache[i]=l,++no.cacheCount>aK&&(no.cacheCount=0,no.widthCache={}),l}catch{return{width:0,height:0}}},lK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function dd(e,t){return dK(e)||fK(e,t)||cK(e,t)||uK()}function uK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cK(e,t){if(e){if(typeof e=="string")return oS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oS(e,t)}}function oS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _K(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function dS(e,t){return NK(e)||EK(e,t)||AK(e,t)||kK()}function kK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AK(e,t){if(e){if(typeof e=="string")return hS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hS(e,t)}}function hS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function(L,z){var C=z.word,B=z.width,U=L[L.length-1];if(U&&(i==null||a||U.width+B+nz.width?L:z})};if(!f)return p;for(var m="…",y=function(D){var L=d.slice(0,D),z=qE({breakAll:u,style:l,children:L+m}).wordsWithComputedWidth,C=h(z),B=C.length>o||v(C).width>Number(i);return[B,C]},b=0,g=d.length-1,x=0,S;b<=g&&x<=d.length-1;){var w=Math.floor((b+g)/2),j=w-1,O=y(j),P=dS(O,2),A=P[0],E=P[1],N=y(w),T=dS(N,1),M=T[0];if(!A&&!M&&(b=w+1),A&&M&&(g=w-1),!A&&M){S=E;break}x++}return S||p},pS=function(t){var r=re(t)?[]:t.toString().split(UE);return[{words:r}]},$K=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!On.isSsr){var l,u,f=qE({breakAll:o,children:i,style:a});if(f){var d=f.wordsWithComputedWidth,h=f.spaceWidth;l=d,u=h}else return pS(i);return TK({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return pS(i)},mS="#808080",Wa=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,d=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,v=t.verticalAnchor,m=v===void 0?"end":v,y=t.fill,b=y===void 0?mS:y,g=fS(t,OK),x=k.useMemo(function(){return $K({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:d,style:g.style,width:g.width})},[g.breakAll,g.children,g.maxLines,d,g.style,g.width]),S=g.dx,w=g.dy,j=g.angle,O=g.className,P=g.breakAll,A=fS(g,PK);if(!pt(n)||!pt(a))return null;var E=n+(H(S)?S:0),N=a+(H(w)?w:0),T;switch(m){case"start":T=wm("calc(".concat(u,")"));break;case"middle":T=wm("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:T=wm("calc(".concat(x.length-1," * -").concat(s,")"));break}var M=[];if(d){var R=x[0].width,D=g.width;M.push("scale(".concat((H(D)?D/R:1)/R,")"))}return j&&M.push("rotate(".concat(j,", ").concat(E,", ").concat(N,")")),M.length&&(A.transform=M.join(" ")),_.createElement("text",$y({},X(A,!0),{x:E,y:N,className:oe("recharts-text",O),textAnchor:p,fill:b.includes("url")?mS:b}),x.map(function(L,z){var C=L.words.join(P?"":" ");return _.createElement("tspan",{x:E,dy:z===0?T:s,key:"".concat(C,"-").concat(z)},C)}))};function Ii(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function CK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function yb(e){let t,r,n;e.length!==2?(t=Ii,r=(s,l)=>Ii(e(s),l),n=(s,l)=>e(s)-l):(t=e===Ii||e===CK?e:MK,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[d],l)<0?u=d+1:f=d}while(u>>1;r(s[d],l)<=0?u=d+1:f=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:i,center:o,right:a}}function MK(){return 0}function WE(e){return e===null?NaN:+e}function*RK(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const DK=yb(Ii),xc=DK.right;yb(WE).center;class vS extends Map{constructor(t,r=FK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(yS(this,t))}has(t){return super.has(yS(this,t))}set(t,r){return super.set(IK(this,t),r)}delete(t){return super.delete(LK(this,t))}}function yS({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function IK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function LK({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function FK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function BK(e=Ii){if(e===Ii)return HE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function HE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const zK=Math.sqrt(50),UK=Math.sqrt(10),qK=Math.sqrt(2);function hd(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=zK?10:a>=UK?5:a>=qK?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function xS(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function KE(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?HE:BK(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/l+h)),v=Math.min(n,Math.floor(t+(l-u)*d/l+h));KE(e,t,p,v,i)}const a=e[t];let o=r,s=n;for(pl(e,r,t),i(e[n],a)>0&&pl(e,r,n);o0;)--s}i(e[r],a)===0?pl(e,r,s):(++s,pl(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function pl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function WK(e,t,r){if(e=Float64Array.from(RK(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return xS(e);if(t>=1)return gS(e);var n,i=(n-1)*t,a=Math.floor(i),o=gS(KE(e,a).subarray(0,a+1)),s=xS(e.subarray(a+1));return o+(s-o)*(i-a)}}function HK(e,t,r=WE){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function KK(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Xc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Xc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=GK.exec(e))?new Jt(t[1],t[2],t[3],1):(t=QK.exec(e))?new Jt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=YK.exec(e))?Xc(t[1],t[2],t[3],t[4]):(t=XK.exec(e))?Xc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ZK.exec(e))?_S(t[1],t[2]/100,t[3]/100,1):(t=JK.exec(e))?_S(t[1],t[2]/100,t[3]/100,t[4]):bS.hasOwnProperty(e)?jS(bS[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function jS(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function Xc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Jt(e,t,r,n)}function r7(e){return e instanceof bc||(e=ku(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function Iy(e,t,r,n){return arguments.length===1?r7(e):new Jt(e,t,r,n??1)}function Jt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}xb(Jt,Iy,GE(bc,{brighter(e){return e=e==null?pd:Math.pow(pd,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(Ma(this.r),Ma(this.g),Ma(this.b),md(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:OS,formatHex:OS,formatHex8:n7,formatRgb:PS,toString:PS}));function OS(){return`#${ga(this.r)}${ga(this.g)}${ga(this.b)}`}function n7(){return`#${ga(this.r)}${ga(this.g)}${ga(this.b)}${ga((isNaN(this.opacity)?1:this.opacity)*255)}`}function PS(){const e=md(this.opacity);return`${e===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${e===1?")":`, ${e})`}`}function md(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ma(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ga(e){return e=Ma(e),(e<16?"0":"")+e.toString(16)}function _S(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xr(e,t,r,n)}function QE(e){if(e instanceof Xr)return new Xr(e.h,e.s,e.l,e.opacity);if(e instanceof bc||(e=ku(e)),!e)return new Xr;if(e instanceof Xr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new Xr(o,s,l,e.opacity)}function i7(e,t,r,n){return arguments.length===1?QE(e):new Xr(e,t,r,n??1)}function Xr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}xb(Xr,i7,GE(bc,{brighter(e){return e=e==null?pd:Math.pow(pd,e),new Xr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new Xr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Jt(Sm(e>=240?e-240:e+120,i,n),Sm(e,i,n),Sm(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Xr(kS(this.h),Zc(this.s),Zc(this.l),md(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=md(this.opacity);return`${e===1?"hsl(":"hsla("}${kS(this.h)}, ${Zc(this.s)*100}%, ${Zc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kS(e){return e=(e||0)%360,e<0?e+360:e}function Zc(e){return Math.max(0,Math.min(1,e||0))}function Sm(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const bb=e=>()=>e;function a7(e,t){return function(r){return e+r*t}}function o7(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function s7(e){return(e=+e)==1?YE:function(t,r){return r-t?o7(t,r,e):bb(isNaN(t)?r:t)}}function YE(e,t){var r=t-e;return r?a7(e,r):bb(isNaN(e)?t:e)}const AS=function e(t){var r=s7(t);function n(i,a){var o=r((i=Iy(i)).r,(a=Iy(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=YE(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function l7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:vd(n,i)})),r=jm.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function x7(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?b7:x7,l=u=null,d}function d(h){return h==null||isNaN(h=+h)?a:(l||(l=s(e.map(n),t,r)))(n(o(h)))}return d.invert=function(h){return o(i((u||(u=s(t,e.map(n),vd)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,yd),f()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),r=wb,f()},d.clamp=function(h){return arguments.length?(o=h?!0:Ut,f()):o!==Ut},d.interpolate=function(h){return arguments.length?(r=h,f()):r},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,p){return n=h,i=p,f()}}function Sb(){return ip()(Ut,Ut)}function w7(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function gd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function os(e){return e=gd(Math.abs(e)),e?e[1]:NaN}function S7(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function j7(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var O7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=O7.exec(e)))throw new Error("invalid format: "+e);var t;return new jb({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Au.prototype=jb.prototype;function jb(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}jb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function P7(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var xd;function _7(e,t){var r=gd(e,t);if(!r)return xd=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(xd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+gd(e,Math.max(0,t+a-1))[0]}function NS(e,t){var r=gd(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const TS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:w7,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>NS(e*100,t),r:NS,s:_7,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $S(e){return e}var CS=Array.prototype.map,MS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function k7(e){var t=e.grouping===void 0||e.thousands===void 0?$S:S7(CS.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?$S:j7(CS.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=Au(d);var p=d.fill,v=d.align,m=d.sign,y=d.symbol,b=d.zero,g=d.width,x=d.comma,S=d.precision,w=d.trim,j=d.type;j==="n"?(x=!0,j="g"):TS[j]||(S===void 0&&(S=12),w=!0,j="g"),(b||p==="0"&&v==="=")&&(b=!0,p="0",v="=");var O=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),P=(y==="$"?n:/[%p]/.test(j)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),A=TS[j],E=/[defgprs%]/.test(j);S=S===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function N(T){var M=O,R=P,D,L,z;if(j==="c")R=A(T)+R,T="";else{T=+T;var C=T<0||1/T<0;if(T=isNaN(T)?l:A(Math.abs(T),S),w&&(T=P7(T)),C&&+T==0&&m!=="+"&&(C=!1),M=(C?m==="("?m:s:m==="-"||m==="("?"":m)+M,R=(j==="s"&&!isNaN(T)&&xd!==void 0?MS[8+xd/3]:"")+R+(C&&m==="("?")":""),E){for(D=-1,L=T.length;++Dz||z>57){R=(z===46?i+T.slice(D+1):T.slice(D))+R,T=T.slice(0,D);break}}}x&&!b&&(T=t(T,1/0));var B=M.length+T.length+R.length,U=B>1)+M+T+R+U.slice(B);break;default:T=U+M+T+R;break}return a(T)}return N.toString=function(){return d+""},N}function f(d,h){var p=Math.max(-8,Math.min(8,Math.floor(os(h)/3)))*3,v=Math.pow(10,-p),m=u((d=Au(d),d.type="f",d),{suffix:MS[8+p/3]});return function(y){return m(v*y)}}return{format:u,formatPrefix:f}}var Jc,Ob,XE;A7({thousands:",",grouping:[3],currency:["$",""]});function A7(e){return Jc=k7(e),Ob=Jc.format,XE=Jc.formatPrefix,Jc}function E7(e){return Math.max(0,-os(Math.abs(e)))}function N7(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(os(t)/3)))*3-os(Math.abs(e)))}function T7(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,os(t)-os(e))+1}function ZE(e,t,r,n){var i=Ry(e,t,r),a;switch(n=Au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=N7(i,o))&&(n.precision=a),XE(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=T7(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=E7(i))&&(n.precision=a-(n.type==="%")*2);break}}return Ob(n)}function Yi(e){var t=e.domain;return e.ticks=function(r){var n=t();return Cy(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return ZE(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,f=10;for(s0;){if(u=My(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function bd(){var e=Sb();return e.copy=function(){return wc(e,bd())},Fr.apply(e,arguments),Yi(e)}function JE(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,yd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return JE(e).unknown(t)},e=arguments.length?Array.from(e,yd):[0,1],Yi(r)}function eN(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function D7(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function IS(e){return(t,r)=>-e(-t,r)}function Pb(e){const t=e(RS,DS),r=t.domain;let n=10,i,a;function o(){return i=D7(n),a=R7(n),r()[0]<0?(i=IS(i),a=IS(a),e($7,C7)):e(RS,DS),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const d=f0){for(;h<=p;++h)for(v=1;vf)break;b.push(m)}}else for(;h<=p;++h)for(v=n-1;v>=1;--v)if(m=h>0?v/a(-h):v*a(h),!(mf)break;b.push(m)}b.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Au(l)).precision==null&&(l.trim=!0),l=Ob(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let d=f/a(Math.round(i(f)));return d*nr(eN(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function tN(){const e=Pb(ip()).domain([1,10]);return e.copy=()=>wc(e,tN()).base(e.base()),Fr.apply(e,arguments),e}function LS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function FS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function _b(e){var t=1,r=e(LS(t),FS(t));return r.constant=function(n){return arguments.length?e(LS(t=+n),FS(t)):t},Yi(r)}function rN(){var e=_b(ip());return e.copy=function(){return wc(e,rN()).constant(e.constant())},Fr.apply(e,arguments)}function BS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function I7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function L7(e){return e<0?-e*e:e*e}function kb(e){var t=e(Ut,Ut),r=1;function n(){return r===1?e(Ut,Ut):r===.5?e(I7,L7):e(BS(r),BS(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Yi(t)}function Ab(){var e=kb(ip());return e.copy=function(){return wc(e,Ab()).exponent(e.exponent())},Fr.apply(e,arguments),e}function F7(){return Ab.apply(null,arguments).exponent(.5)}function zS(e){return Math.sign(e)*e*e}function B7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function nN(){var e=Sb(),t=[0,1],r=!1,n;function i(a){var o=B7(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(zS(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,yd)).map(zS)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return nN(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Fr.apply(i,arguments),Yi(i)}function iN(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return aN().domain([e,t]).range(i).unknown(a)},Fr.apply(Yi(o),arguments)}function oN(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[xc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return oN().domain(e).range(t).unknown(r)},Fr.apply(i,arguments)}const Om=new Date,Pm=new Date;function vt(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uvt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Om.setTime(+a),Pm.setTime(+o),e(Om),e(Pm),Math.floor(r(Om,Pm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const wd=vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);wd.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):wd);wd.range;const Rn=1e3,$r=Rn*60,Dn=$r*60,Hn=Dn*24,Eb=Hn*7,US=Hn*30,_m=Hn*365,xa=vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rn)},(e,t)=>(t-e)/Rn,e=>e.getUTCSeconds());xa.range;const Nb=vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getMinutes());Nb.range;const Tb=vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getUTCMinutes());Tb.range;const $b=vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn-e.getMinutes()*$r)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getHours());$b.range;const Cb=vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getUTCHours());Cb.range;const Sc=vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$r)/Hn,e=>e.getDate()-1);Sc.range;const ap=vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hn,e=>e.getUTCDate()-1);ap.range;const sN=vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hn,e=>Math.floor(e/Hn));sN.range;function Za(e){return vt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*$r)/Eb)}const op=Za(0),Sd=Za(1),z7=Za(2),U7=Za(3),ss=Za(4),q7=Za(5),W7=Za(6);op.range;Sd.range;z7.range;U7.range;ss.range;q7.range;W7.range;function Ja(e){return vt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Eb)}const sp=Ja(0),jd=Ja(1),H7=Ja(2),K7=Ja(3),ls=Ja(4),V7=Ja(5),G7=Ja(6);sp.range;jd.range;H7.range;K7.range;ls.range;V7.range;G7.range;const Mb=vt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Mb.range;const Rb=vt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Rb.range;const Kn=vt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Kn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Kn.range;const Vn=vt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Vn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Vn.range;function lN(e,t,r,n,i,a){const o=[[xa,1,Rn],[xa,5,5*Rn],[xa,15,15*Rn],[xa,30,30*Rn],[a,1,$r],[a,5,5*$r],[a,15,15*$r],[a,30,30*$r],[i,1,Dn],[i,3,3*Dn],[i,6,6*Dn],[i,12,12*Dn],[n,1,Hn],[n,2,2*Hn],[r,1,Eb],[t,1,US],[t,3,3*US],[e,1,_m]];function s(u,f,d){const h=fy).right(o,h);if(p===o.length)return e.every(Ry(u/_m,f/_m,d));if(p===0)return wd.every(Math.max(Ry(u,f,d),1));const[v,m]=o[h/o[p-1][2]53)return null;"w"in W||(W.w=1),"Z"in W?(me=Am(ml(W.y,0,1)),st=me.getUTCDay(),me=st>4||st===0?jd.ceil(me):jd(me),me=ap.offset(me,(W.V-1)*7),W.y=me.getUTCFullYear(),W.m=me.getUTCMonth(),W.d=me.getUTCDate()+(W.w+6)%7):(me=km(ml(W.y,0,1)),st=me.getDay(),me=st>4||st===0?Sd.ceil(me):Sd(me),me=Sc.offset(me,(W.V-1)*7),W.y=me.getFullYear(),W.m=me.getMonth(),W.d=me.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),st="Z"in W?Am(ml(W.y,0,1)).getUTCDay():km(ml(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(st+5)%7:W.w+W.U*7-(st+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,Am(W)):km(W)}}function P(Q,le,fe,W){for(var We=0,me=le.length,st=fe.length,lt,Gt;We=st)return-1;if(lt=le.charCodeAt(We++),lt===37){if(lt=le.charAt(We++),Gt=w[lt in qS?le.charAt(We++):lt],!Gt||(W=Gt(Q,fe,W))<0)return-1}else if(lt!=fe.charCodeAt(W++))return-1}return W}function A(Q,le,fe){var W=u.exec(le.slice(fe));return W?(Q.p=f.get(W[0].toLowerCase()),fe+W[0].length):-1}function E(Q,le,fe){var W=p.exec(le.slice(fe));return W?(Q.w=v.get(W[0].toLowerCase()),fe+W[0].length):-1}function N(Q,le,fe){var W=d.exec(le.slice(fe));return W?(Q.w=h.get(W[0].toLowerCase()),fe+W[0].length):-1}function T(Q,le,fe){var W=b.exec(le.slice(fe));return W?(Q.m=g.get(W[0].toLowerCase()),fe+W[0].length):-1}function M(Q,le,fe){var W=m.exec(le.slice(fe));return W?(Q.m=y.get(W[0].toLowerCase()),fe+W[0].length):-1}function R(Q,le,fe){return P(Q,t,le,fe)}function D(Q,le,fe){return P(Q,r,le,fe)}function L(Q,le,fe){return P(Q,n,le,fe)}function z(Q){return o[Q.getDay()]}function C(Q){return a[Q.getDay()]}function B(Q){return l[Q.getMonth()]}function U(Q){return s[Q.getMonth()]}function G(Q){return i[+(Q.getHours()>=12)]}function q(Q){return 1+~~(Q.getMonth()/3)}function ee(Q){return o[Q.getUTCDay()]}function ce(Q){return a[Q.getUTCDay()]}function V(Q){return l[Q.getUTCMonth()]}function ie(Q){return s[Q.getUTCMonth()]}function Le(Q){return i[+(Q.getUTCHours()>=12)]}function ot(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var le=j(Q+="",x);return le.toString=function(){return Q},le},parse:function(Q){var le=O(Q+="",!1);return le.toString=function(){return Q},le},utcFormat:function(Q){var le=j(Q+="",S);return le.toString=function(){return Q},le},utcParse:function(Q){var le=O(Q+="",!0);return le.toString=function(){return Q},le}}}var qS={"-":"",_:" ",0:"0"},St=/^\s*\d+/,eV=/^%/,tV=/[\\^$*+?|[\]().{}]/g;function ye(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function nV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function iV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function aV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function oV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function sV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function WS(e,t,r){var n=St.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function HS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function lV(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function uV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function cV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function KS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function fV(e,t,r){var n=St.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function VS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function dV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function hV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function pV(e,t,r){var n=St.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function mV(e,t,r){var n=St.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function vV(e,t,r){var n=eV.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function yV(e,t,r){var n=St.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function gV(e,t,r){var n=St.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function GS(e,t){return ye(e.getDate(),t,2)}function xV(e,t){return ye(e.getHours(),t,2)}function bV(e,t){return ye(e.getHours()%12||12,t,2)}function wV(e,t){return ye(1+Sc.count(Kn(e),e),t,3)}function uN(e,t){return ye(e.getMilliseconds(),t,3)}function SV(e,t){return uN(e,t)+"000"}function jV(e,t){return ye(e.getMonth()+1,t,2)}function OV(e,t){return ye(e.getMinutes(),t,2)}function PV(e,t){return ye(e.getSeconds(),t,2)}function _V(e){var t=e.getDay();return t===0?7:t}function kV(e,t){return ye(op.count(Kn(e)-1,e),t,2)}function cN(e){var t=e.getDay();return t>=4||t===0?ss(e):ss.ceil(e)}function AV(e,t){return e=cN(e),ye(ss.count(Kn(e),e)+(Kn(e).getDay()===4),t,2)}function EV(e){return e.getDay()}function NV(e,t){return ye(Sd.count(Kn(e)-1,e),t,2)}function TV(e,t){return ye(e.getFullYear()%100,t,2)}function $V(e,t){return e=cN(e),ye(e.getFullYear()%100,t,2)}function CV(e,t){return ye(e.getFullYear()%1e4,t,4)}function MV(e,t){var r=e.getDay();return e=r>=4||r===0?ss(e):ss.ceil(e),ye(e.getFullYear()%1e4,t,4)}function RV(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ye(t/60|0,"0",2)+ye(t%60,"0",2)}function QS(e,t){return ye(e.getUTCDate(),t,2)}function DV(e,t){return ye(e.getUTCHours(),t,2)}function IV(e,t){return ye(e.getUTCHours()%12||12,t,2)}function LV(e,t){return ye(1+ap.count(Vn(e),e),t,3)}function fN(e,t){return ye(e.getUTCMilliseconds(),t,3)}function FV(e,t){return fN(e,t)+"000"}function BV(e,t){return ye(e.getUTCMonth()+1,t,2)}function zV(e,t){return ye(e.getUTCMinutes(),t,2)}function UV(e,t){return ye(e.getUTCSeconds(),t,2)}function qV(e){var t=e.getUTCDay();return t===0?7:t}function WV(e,t){return ye(sp.count(Vn(e)-1,e),t,2)}function dN(e){var t=e.getUTCDay();return t>=4||t===0?ls(e):ls.ceil(e)}function HV(e,t){return e=dN(e),ye(ls.count(Vn(e),e)+(Vn(e).getUTCDay()===4),t,2)}function KV(e){return e.getUTCDay()}function VV(e,t){return ye(jd.count(Vn(e)-1,e),t,2)}function GV(e,t){return ye(e.getUTCFullYear()%100,t,2)}function QV(e,t){return e=dN(e),ye(e.getUTCFullYear()%100,t,2)}function YV(e,t){return ye(e.getUTCFullYear()%1e4,t,4)}function XV(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ls(e):ls.ceil(e),ye(e.getUTCFullYear()%1e4,t,4)}function ZV(){return"+0000"}function YS(){return"%"}function XS(e){return+e}function ZS(e){return Math.floor(+e/1e3)}var io,hN,pN;JV({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function JV(e){return io=J7(e),hN=io.format,io.parse,pN=io.utcFormat,io.utcParse,io}function eG(e){return new Date(e)}function tG(e){return e instanceof Date?+e:+new Date(+e)}function Db(e,t,r,n,i,a,o,s,l,u){var f=Sb(),d=f.invert,h=f.domain,p=u(".%L"),v=u(":%S"),m=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),g=u("%b %d"),x=u("%B"),S=u("%Y");function w(j){return(l(j)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>WK(e,a/n))},r.copy=function(){return gN(t).domain(e)},ei.apply(r,arguments)}function up(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Ut,f,d=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+f(m))-a)*(n*mt}var SN=lG,uG=cp,cG=SN,fG=Ks;function dG(e){return e&&e.length?uG(e,fG,cG):void 0}var hG=dG;const Oi=Se(hG);function pG(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};J.decimalPlaces=J.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*De;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};J.dividedBy=J.div=function(e){return Bn(this,new this.constructor(e))};J.dividedToIntegerBy=J.idiv=function(e){var t=this,r=t.constructor;return Ee(Bn(t,new r(e),0,1),r.precision)};J.equals=J.eq=function(e){return!this.cmp(e)};J.exponent=function(){return nt(this)};J.greaterThan=J.gt=function(e){return this.cmp(e)>0};J.greaterThanOrEqualTo=J.gte=function(e){return this.cmp(e)>=0};J.isInteger=J.isint=function(){return this.e>this.d.length-2};J.isNegative=J.isneg=function(){return this.s<0};J.isPositive=J.ispos=function(){return this.s>0};J.isZero=function(){return this.s===0};J.lessThan=J.lt=function(e){return this.cmp(e)<0};J.lessThanOrEqualTo=J.lte=function(e){return this.cmp(e)<1};J.logarithm=J.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(dr))throw Error(Ir+"NaN");if(r.s<1)throw Error(Ir+(r.s?"NaN":"-Infinity"));return r.eq(dr)?new n(0):(Be=!1,t=Bn(Eu(r,a),Eu(e,a),a),Be=!0,Ee(t,i))};J.minus=J.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kN(t,e):PN(t,(e.s=-e.s,e))};J.modulo=J.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Ir+"NaN");return r.s?(Be=!1,t=Bn(r,e,0,1).times(e),Be=!0,r.minus(t)):Ee(new n(r),i)};J.naturalExponential=J.exp=function(){return _N(this)};J.naturalLogarithm=J.ln=function(){return Eu(this)};J.negated=J.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};J.plus=J.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?PN(t,e):kN(t,(e.s=-e.s,e))};J.precision=J.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ra+e);if(t=nt(i)+1,n=i.d.length-1,r=n*De+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};J.squareRoot=J.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Ir+"NaN")}for(e=nt(s),Be=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=hn(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Qs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Bn(s,a,o+2)).times(.5),hn(a.d).slice(0,o)===(t=hn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Ee(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return Be=!0,Ee(n,r)};J.times=J.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,d=f.constructor,h=f.d,p=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,l=h.length,u=p.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+p[n]*h[i-n-1]+t,a[i--]=s%gt|0,t=s/gt|0;a[i]=(a[i]+t)%gt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,Be?Ee(e,d.precision):e};J.toDecimalPlaces=J.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(bn(e,0,Gs),t===void 0?t=n.rounding:bn(t,0,8),Ee(r,e+nt(r)+1,t))};J.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ha(n,!0):(bn(e,0,Gs),t===void 0?t=i.rounding:bn(t,0,8),n=Ee(new i(n),e+1,t),r=Ha(n,!0,e+1)),r};J.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Ha(i):(bn(e,0,Gs),t===void 0?t=a.rounding:bn(t,0,8),n=Ee(new a(i),e+nt(i)+1,t),r=Ha(n.abs(),!1,e+nt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};J.toInteger=J.toint=function(){var e=this,t=e.constructor;return Ee(new t(e),nt(e)+1,t.rounding)};J.toNumber=function(){return+this};J.toPower=J.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(dr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Ir+"Infinity");return s}if(s.eq(dr))return s;if(n=l.precision,e.eq(dr))return Ee(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=ON){for(i=new l(dr),t=Math.ceil(n/De+4),Be=!1;r%2&&(i=i.times(s),tj(i.d,t)),r=Qs(r/2),r!==0;)s=s.times(s),tj(s.d,t);return Be=!0,e.s<0?new l(dr).div(i):Ee(i,n)}}else if(a<0)throw Error(Ir+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,Be=!1,i=e.times(Eu(s,n+u)),Be=!0,i=_N(i),i.s=a,i};J.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=nt(i),n=Ha(i,r<=a.toExpNeg||r>=a.toExpPos)):(bn(e,1,Gs),t===void 0?t=a.rounding:bn(t,0,8),i=Ee(new a(i),e,t),r=nt(i),n=Ha(i,e<=r||r<=a.toExpNeg,e)),n};J.toSignificantDigits=J.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(bn(e,1,Gs),t===void 0?t=n.rounding:bn(t,0,8)),Ee(new n(r),e,t)};J.toString=J.valueOf=J.val=J.toJSON=J[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=nt(e),r=e.constructor;return Ha(e,t<=r.toExpNeg||t>=r.toExpPos)};function PN(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Be?Ee(t,d):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(d/De),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/gt|0,l[a]%=gt;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,Be?Ee(t,d):t}function bn(e,t,r){if(e!==~~e||er)throw Error(Ra+e)}function hn(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,f,d,h,p,v,m,y,b,g,x,S,w,j,O,P,A=n.constructor,E=n.s==i.s?1:-1,N=n.d,T=i.d;if(!n.s)return new A(n);if(!i.s)throw Error(Ir+"Division by zero");for(l=n.e-i.e,O=T.length,w=N.length,p=new A(E),v=p.d=[],u=0;T[u]==(N[u]||0);)++u;if(T[u]>(N[u]||0)&&--l,a==null?g=a=A.precision:o?g=a+(nt(n)-nt(i))+1:g=a,g<0)return new A(0);if(g=g/De+2|0,u=0,O==1)for(f=0,T=T[0],g++;(u1&&(T=e(T,f),N=e(N,f),O=T.length,w=N.length),S=O,m=N.slice(0,O),y=m.length;y=gt/2&&++j;do f=0,s=t(T,m,O,y),s<0?(b=m[0],O!=y&&(b=b*gt+(m[1]||0)),f=b/j|0,f>1?(f>=gt&&(f=gt-1),d=e(T,f),h=d.length,y=m.length,s=t(d,m,h,y),s==1&&(f--,r(d,O16)throw Error(Fb+nt(e));if(!e.s)return new f(dr);for(Be=!1,s=d,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(ua(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(dr),f.precision=s;;){if(i=Ee(i.times(e),s),r=r.times(++l),o=a.plus(Bn(i,r,s)),hn(o.d).slice(0,s)===hn(a.d).slice(0,s)){for(;u--;)a=Ee(a.times(a),s);return f.precision=d,t==null?(Be=!0,Ee(a,d)):a}a=o}}function nt(e){for(var t=e.e*De,r=e.d[0];r>=10;r/=10)t++;return t}function Em(e,t,r){if(t>e.LN10.sd())throw Be=!0,r&&(e.precision=r),Error(Ir+"LN10 precision limit exceeded");return Ee(new e(e.LN10),t)}function ui(e){for(var t="";e--;)t+="0";return t}function Eu(e,t){var r,n,i,a,o,s,l,u,f,d=1,h=10,p=e,v=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(Ir+(p.s?"NaN":"-Infinity"));if(p.eq(dr))return new m(0);if(t==null?(Be=!1,u=y):u=t,p.eq(10))return t==null&&(Be=!0),Em(m,u);if(u+=h,m.precision=u,r=hn(v),n=r.charAt(0),a=nt(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=hn(p.d),n=r.charAt(0),d++;a=nt(p),n>1?(p=new m("0."+r),a++):p=new m(n+"."+r.slice(1))}else return l=Em(m,u+2,y).times(a+""),p=Eu(new m(n+"."+r.slice(1)),u-h).plus(l),m.precision=y,t==null?(Be=!0,Ee(p,y)):p;for(s=o=p=Bn(p.minus(dr),p.plus(dr),u),f=Ee(p.times(p),u),i=3;;){if(o=Ee(o.times(f),u),l=s.plus(Bn(o,new m(i),u)),hn(l.d).slice(0,u)===hn(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(Em(m,u+2,y).times(a+""))),s=Bn(s,new m(d),u),m.precision=y,t==null?(Be=!0,Ee(s,y)):s;s=l,i+=2}}function ej(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Qs(r/De),e.d=[],n=(r+1)%De,r<0&&(n+=De),nOd||e.e<-Od))throw Error(Fb+r)}else e.s=0,e.e=0,e.d=[0];return e}function Ee(e,t,r){var n,i,a,o,s,l,u,f,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=De,i=t,u=d[f=0];else{if(f=Math.ceil((n+1)/De),a=d.length,f>=a)return e;for(u=a=d[f],o=1;a>=10;a/=10)o++;n%=De,i=n-De+o}if(r!==void 0&&(a=ua(10,o-i-1),s=u/a%10|0,l=t<0||d[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/ua(10,o-i):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(a=nt(e),d.length=1,t=t-a-1,d[0]=ua(10,(De-t%De)%De),e.e=Qs(-t/De)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,a=1,f--):(d.length=f+1,a=ua(10,De-n),d[f]=i>0?(u/ua(10,o-i)%ua(10,i)|0)*a:0),l)for(;;)if(f==0){(d[0]+=a)==gt&&(d[0]=1,++e.e);break}else{if(d[f]+=a,d[f]!=gt)break;d[f--]=0,a=1}for(n=d.length;d[--n]===0;)d.pop();if(Be&&(e.e>Od||e.e<-Od))throw Error(Fb+nt(e));return e}function kN(e,t){var r,n,i,a,o,s,l,u,f,d,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Be?Ee(t,p):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=d.length):(r=d,n=u,s=l.length),i=Math.max(Math.ceil(p/De),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=d.length,f=i0;--i)l[s++]=0;for(i=d.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+ui(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ui(-i-1)+a,r&&(n=r-o)>0&&(a+=ui(n))):i>=o?(a+=ui(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+ui(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=ui(n))),e.s<0?"-"+a:a}function tj(e,t){if(e.length>t)return e.length=t,!0}function AN(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ra+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return ej(o,a.toString())}else if(typeof a!="string")throw Error(Ra+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,RG.test(a))ej(o,a);else throw Error(Ra+a)}if(i.prototype=J,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=AN,i.config=i.set=DG,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Ra+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ra+r+": "+n);return this}var Bb=AN(MG);dr=new Bb(1);const _e=Bb;function IG(e){return zG(e)||BG(e)||FG(e)||LG()}function LG(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FG(e,t){if(e){if(typeof e=="string")return By(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return By(e,t)}}function BG(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function zG(e){if(Array.isArray(e))return By(e)}function By(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,rj(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function rQ(e){if(Array.isArray(e))return e}function CN(e){var t=Nu(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function MN(e,t,r){if(e.lte(0))return new _e(0);var n=hp.getDigitCount(e.toNumber()),i=new _e(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new _e(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new _e(Math.ceil(l))}function nQ(e,t,r){var n=1,i=new _e(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new _e(10).pow(hp.getDigitCount(e)-1),i=new _e(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new _e(Math.floor(e)))}else e===0?i=new _e(Math.floor((t-1)/2)):r||(i=new _e(Math.floor(e)));var o=Math.floor((t-1)/2),s=HG(WG(function(l){return i.add(new _e(l-o).mul(n)).toNumber()}),zy);return s(0,t)}function RN(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new _e(0),tickMin:new _e(0),tickMax:new _e(0)};var a=MN(new _e(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new _e(0):(o=new _e(e).add(t).div(2),o=o.sub(new _e(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new _e(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?RN(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new _e(s).mul(a)),tickMax:o.add(new _e(l).mul(a))})}function iQ(e){var t=Nu(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=CN([r,n]),l=Nu(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(qy(zy(0,i-1).map(function(){return 1/0}))):[].concat(qy(zy(0,i-1).map(function(){return-1/0})),[f]);return r>n?Uy(d):d}if(u===f)return nQ(u,i,a);var h=RN(u,f,o,a),p=h.step,v=h.tickMin,m=h.tickMax,y=hp.rangeStep(v,m.add(new _e(.1).mul(p)),p);return r>n?Uy(y):y}function aQ(e,t){var r=Nu(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=CN([n,i]),s=Nu(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),d=MN(new _e(u).sub(l).div(f-1),a,0),h=[].concat(qy(hp.rangeStep(new _e(l),new _e(u).sub(new _e(.99).mul(d)),d)),[u]);return n>i?Uy(h):h}var oQ=TN(iQ),sQ=TN(aQ),lQ="Invariant failed";function Ka(e,t){throw new Error(lQ)}var uQ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function yQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gQ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,d=i[u].coordinate,h=u>=s-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(Bt(d-f)!==Bt(h-d)){var v=[];if(Bt(h-d)===Bt(l[1]-l[0])){p=h;var m=d+l[1]-l[0];v[0]=Math.min(m,(m+f)/2),v[1]=Math.max(m,(m+f)/2)}else{p=f;var y=h+l[1]-l[0];v[0]=Math.min(d,(y+d)/2),v[1]=Math.max(d,(y+d)/2)}var b=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>b[0]&&t<=b[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var g=Math.min(f,h),x=Math.max(f,h);if(t>(g+d)/2&&t<=(x+d)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},zb=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ve(Ve({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},RQ=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(b&&b.length){var g=b[0].type.defaultProps,x=g!==void 0?Ve(Ve({},g),b[0].props):b[0].props,S=x.barSize,w=x[y];o[w]||(o[w]=[]);var j=re(S)?r:S;o[w].push({item:b[0],stackList:b.slice(1),barSize:re(j)?void 0:zt(j,n,0)})}}return o},DQ=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=zt(r,i,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/l,v=o.reduce(function(S,w){return S+w.barSize||0},0);v+=(l-1)*u,v>=i&&(v-=(l-1)*u,u=0),v>=i&&p>0&&(h=!0,p*=.9,v=l*p);var m=(i-v)/2>>0,y={offset:m-u,size:0};f=o.reduce(function(S,w){var j={item:w.item,position:{offset:y.offset+y.size+u,size:h?p:w.barSize}},O=[].concat(aj(S),[j]);return y=O[O.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(P){O.push({item:P,position:y})}),O},d)}else{var b=zt(n,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var g=(i-2*b-(l-1)*u)/l;g>1&&(g>>=0);var x=s===+s?Math.min(g,s):g;f=o.reduce(function(S,w,j){var O=[].concat(aj(S),[{item:w.item,position:{offset:b+(g+u)*j+(g-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(P){O.push({item:P,position:O[O.length-1].position})}),O},d)}return f},IQ=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=FN({children:a,legendWidth:l});if(u){var f=i||{},d=f.width,h=f.height,p=u.align,v=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&v==="middle")&&p!=="center"&&H(t[p]))return Ve(Ve({},t),{},Mo({},p,t[p]+(d||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&v!=="middle"&&H(t[v]))return Ve(Ve({},t),{},Mo({},v,t[v]+(h||0)))}return t},LQ=function(t,r,n){return re(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},BN=function(t,r,n,i,a){var o=r.props.children,s=Wt(o,Ys).filter(function(u){return LQ(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Ae(f,n);if(re(d))return u;var h=Array.isArray(d)?[fp(d),Oi(d)]:[d,d],p=l.reduce(function(v,m){var y=Ae(f,m,0),b=h[0]-Math.abs(Array.isArray(y)?y[0]:y),g=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(b,v[0]),Math.max(g,v[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},FQ=function(t,r,n,i,a){var o=r.map(function(s){return BN(t,s,n,a,i)}).filter(function(s){return!re(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},zN=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&BN(t,l,u,i)||Ul(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,d=u.length;f=2?Bt(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var h=a?a.indexOf(d):d;return{coordinate:i(h)+u,value:d,offset:u}});return f.filter(function(d){return!qs(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,h){return{coordinate:i(d)+u,value:d,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(d){return{coordinate:i(d)+u,value:d,offset:u}}):i.domain().map(function(d,h){return{coordinate:i(d)+u,value:a?a[d]:d,index:h,offset:u}})},Nm=new WeakMap,ef=function(t,r){if(typeof r!="function")return t;Nm.has(t)||Nm.set(t,new WeakMap);var n=Nm.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},WN=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Ou(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:bd(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:zl(),realScaleType:"point"}:a==="category"?{scale:Ou(),realScaleType:"band"}:{scale:bd(),realScaleType:"linear"};if(qa(i)){var l="scale".concat(Yh(i));return{scale:(JS[l]||zl)(),realScaleType:JS[l]?l:"point"}}return te(i)?{scale:i}:{scale:zl(),realScaleType:"point"}},sj=1e-4,HN=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-sj,o=Math.max(i[0],i[1])+sj,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},BQ=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},qQ=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},WQ={sign:UQ,expand:u8,none:ts,silhouette:c8,wiggle:f8,positive:qQ},HQ=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=WQ[n],o=l8().keys(i).value(function(s,l){return+Ae(s,l,0)}).order(yy).offset(a);return o(t)},KQ=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(d,h){var p,v=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Ve(Ve({},h.type.defaultProps),h.props):h.props,m=v.stackId,y=v.hide;if(y)return d;var b=v[n],g=d[b]||{hasStack:!1,stackGroups:{}};if(pt(m)){var x=g.stackGroups[m]||{numericAxisId:n,cateAxisId:i,items:[]};x.items.push(h),g.hasStack=!0,g.stackGroups[m]=x}else g.stackGroups[Qi("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return Ve(Ve({},d),{},Mo({},b,g))},l),f={};return Object.keys(u).reduce(function(d,h){var p=u[h];if(p.hasStack){var v={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var b=p.stackGroups[y];return Ve(Ve({},m),{},Mo({},y,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:HQ(t,b.items,a)}))},v)}return Ve(Ve({},d),{},Mo({},h,p))},f)},KN=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=oQ(u,a,s);return t.domain([fp(f),Oi(f)]),{niceTicks:f}}if(a&&i==="number"){var d=t.domain(),h=sQ(d,a,s);return{niceTicks:h}}return null};function cs(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!re(i[t.dataKey])){var s=Zf(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Ae(i,re(o)?t.dataKey:o);return re(l)?null:t.scale(l)}var lj=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Ae(o,r.dataKey,r.domain[s]);return re(l)?null:r.scale(l)-a/2+i},VQ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},GQ=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ve(Ve({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(pt(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},QQ=function(t){return t.reduce(function(r,n){return[fp(n.concat([r[0]]).filter(H)),Oi(n.concat([r[1]]).filter(H))]},[1/0,-1/0])},VN=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var d=QQ(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},uj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,cj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Vy=function(t,r,n){if(te(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(H(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(uj.test(t[0])){var a=+uj.exec(t[0])[1];i[0]=r[0]-a}else te(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(H(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(cj.test(t[1])){var o=+cj.exec(t[1])[1];i[1]=r[1]+o}else te(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},kd=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=mb(r,function(d){return d.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},XN=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=zt(t.cx,o,o/2),d=zt(t.cy,s,s/2),h=YN(o,s,n),p=zt(t.innerRadius,h,0),v=zt(t.outerRadius,h,h*.8),m=Object.keys(r);return m.reduce(function(y,b){var g=r[b],x=g.domain,S=g.reversed,w;if(re(g.range))i==="angleAxis"?w=[l,u]:i==="radiusAxis"&&(w=[p,v]),S&&(w=[w[1],w[0]]);else{w=g.range;var j=w,O=ZQ(j,2);l=O[0],u=O[1]}var P=WN(g,a),A=P.realScaleType,E=P.scale;E.domain(x).range(w),HN(E);var N=KN(E,An(An({},g),{},{realScaleType:A})),T=An(An(An({},g),N),{},{range:w,radius:v,realScaleType:A,scale:E,cx:f,cy:d,innerRadius:p,outerRadius:v,startAngle:l,endAngle:u});return An(An({},y),{},QN({},b,T))},{})},iY=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},aY=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=iY({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:nY(u),angleInRadian:u}},oY=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},sY=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},pj=function(t,r){var n=t.x,i=t.y,a=aY({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=oY(r),d=f.startAngle,h=f.endAngle,p=s,v;if(d<=h){for(;p>h;)p-=360;for(;p=d&&p<=h}else{for(;p>d;)p-=360;for(;p=h&&p<=d}return v?An(An({},r),{},{radius:o,angle:sY(p,r)}):null},ZN=function(t){return!k.isValidElement(t)&&!te(t)&&typeof t!="boolean"?t.className:""};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}var lY=["offset"];function uY(e){return hY(e)||dY(e)||fY(e)||cY()}function cY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fY(e,t){if(e){if(typeof e=="string")return Gy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gy(e,t)}}function dY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hY(e){if(Array.isArray(e))return Gy(e)}function Gy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function mj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t=0?1:-1,x,S;i==="insideStart"?(x=p+g*o,S=m):i==="insideEnd"?(x=v-g*o,S=!m):i==="end"&&(x=v+g*o,S=m),S=b<=0?S:!S;var w=ge(u,f,y,x),j=ge(u,f,y,x+(S?1:-1)*359),O="M".concat(w.x,",").concat(w.y,` + height and width.`,D,L,o,l,f,d,r);var U=!Array.isArray(p)&&Fn(p.type).endsWith("Chart");return _.Children.map(p,function(C){return _.isValidElement(C)?k.cloneElement(C,Qc({width:D,height:L},U?{style:Qc({height:"100%",width:"100%",maxHeight:L,maxWidth:D},C.props.style)}:{})):C})},[r,p,l,h,d,f,A,o]);return _.createElement("div",{id:y?"".concat(y):void 0,className:oe("recharts-responsive-container",b),style:Qc(Qc({},S),{},{width:o,height:l,minWidth:f,minHeight:d,maxHeight:h}),ref:w},T)}),vr=function(t){return null};vr.displayName="Cell";function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function aS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $y(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||On.isSsr)return{width:0,height:0};var n=lK(r),i=JSON.stringify({text:t,copyStyle:n});if(no.widthCache[i])return no.widthCache[i];try{var a=document.getElementById(oS);a||(a=document.createElement("span"),a.setAttribute("id",oS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=$y($y({},sK),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return no.widthCache[i]=l,++no.cacheCount>oK&&(no.cacheCount=0,no.widthCache={}),l}catch{return{width:0,height:0}}},uK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function dd(e,t){return hK(e)||dK(e,t)||fK(e,t)||cK()}function cK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fK(e,t){if(e){if(typeof e=="string")return sS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sS(e,t)}}function sS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hS(e,t){return TK(e)||NK(e,t)||EK(e,t)||AK()}function AK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EK(e,t){if(e){if(typeof e=="string")return pS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pS(e,t)}}function pS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function(L,U){var C=U.word,F=U.width,z=L[L.length-1];if(z&&(i==null||a||z.width+F+nU.width?L:U})};if(!f)return p;for(var m="…",y=function(D){var L=d.slice(0,D),U=WE({breakAll:u,style:l,children:L+m}).wordsWithComputedWidth,C=h(U),F=C.length>o||v(C).width>Number(i);return[F,C]},b=0,g=d.length-1,x=0,S;b<=g&&x<=d.length-1;){var w=Math.floor((b+g)/2),j=w-1,O=y(j),P=hS(O,2),A=P[0],E=P[1],N=y(w),T=hS(N,1),M=T[0];if(!A&&!M&&(b=w+1),A&&M&&(g=w-1),!A&&M){S=E;break}x++}return S||p},mS=function(t){var r=re(t)?[]:t.toString().split(qE);return[{words:r}]},CK=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!On.isSsr){var l,u,f=WE({breakAll:o,children:i,style:a});if(f){var d=f.wordsWithComputedWidth,h=f.spaceWidth;l=d,u=h}else return mS(i);return $K({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return mS(i)},vS="#808080",Wa=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,d=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,v=t.verticalAnchor,m=v===void 0?"end":v,y=t.fill,b=y===void 0?vS:y,g=dS(t,PK),x=k.useMemo(function(){return CK({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:d,style:g.style,width:g.width})},[g.breakAll,g.children,g.maxLines,d,g.style,g.width]),S=g.dx,w=g.dy,j=g.angle,O=g.className,P=g.breakAll,A=dS(g,_K);if(!pt(n)||!pt(a))return null;var E=n+(H(S)?S:0),N=a+(H(w)?w:0),T;switch(m){case"start":T=wm("calc(".concat(u,")"));break;case"middle":T=wm("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:T=wm("calc(".concat(x.length-1," * -").concat(s,")"));break}var M=[];if(d){var R=x[0].width,D=g.width;M.push("scale(".concat((H(D)?D/R:1)/R,")"))}return j&&M.push("rotate(".concat(j,", ").concat(E,", ").concat(N,")")),M.length&&(A.transform=M.join(" ")),_.createElement("text",Cy({},X(A,!0),{x:E,y:N,className:oe("recharts-text",O),textAnchor:p,fill:b.includes("url")?vS:b}),x.map(function(L,U){var C=L.words.join(P?"":" ");return _.createElement("tspan",{x:E,dy:U===0?T:s,key:"".concat(C,"-").concat(U)},C)}))};function Ii(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function MK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function gb(e){let t,r,n;e.length!==2?(t=Ii,r=(s,l)=>Ii(e(s),l),n=(s,l)=>e(s)-l):(t=e===Ii||e===MK?e:RK,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[d],l)<0?u=d+1:f=d}while(u>>1;r(s[d],l)<=0?u=d+1:f=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:i,center:o,right:a}}function RK(){return 0}function HE(e){return e===null?NaN:+e}function*DK(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const IK=gb(Ii),xc=IK.right;gb(HE).center;class yS extends Map{constructor(t,r=BK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(gS(this,t))}has(t){return super.has(gS(this,t))}set(t,r){return super.set(LK(this,t),r)}delete(t){return super.delete(FK(this,t))}}function gS({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function LK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function FK({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function BK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function zK(e=Ii){if(e===Ii)return KE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function KE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const UK=Math.sqrt(50),qK=Math.sqrt(10),WK=Math.sqrt(2);function hd(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=UK?10:a>=qK?5:a>=WK?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function bS(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function VE(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?KE:zK(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/l+h)),v=Math.min(n,Math.floor(t+(l-u)*d/l+h));VE(e,t,p,v,i)}const a=e[t];let o=r,s=n;for(pl(e,r,t),i(e[n],a)>0&&pl(e,r,n);o0;)--s}i(e[r],a)===0?pl(e,r,s):(++s,pl(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function pl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function HK(e,t,r){if(e=Float64Array.from(DK(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return bS(e);if(t>=1)return xS(e);var n,i=(n-1)*t,a=Math.floor(i),o=xS(VE(e,a).subarray(0,a+1)),s=bS(e.subarray(a+1));return o+(s-o)*(i-a)}}function KK(e,t,r=HE){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function VK(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Xc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Xc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=QK.exec(e))?new Jt(t[1],t[2],t[3],1):(t=YK.exec(e))?new Jt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=XK.exec(e))?Xc(t[1],t[2],t[3],t[4]):(t=ZK.exec(e))?Xc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=JK.exec(e))?kS(t[1],t[2]/100,t[3]/100,1):(t=e7.exec(e))?kS(t[1],t[2]/100,t[3]/100,t[4]):wS.hasOwnProperty(e)?OS(wS[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function OS(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function Xc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Jt(e,t,r,n)}function n7(e){return e instanceof bc||(e=ku(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function Ly(e,t,r,n){return arguments.length===1?n7(e):new Jt(e,t,r,n??1)}function Jt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}bb(Jt,Ly,QE(bc,{brighter(e){return e=e==null?pd:Math.pow(pd,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(Ma(this.r),Ma(this.g),Ma(this.b),md(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PS,formatHex:PS,formatHex8:i7,formatRgb:_S,toString:_S}));function PS(){return`#${ga(this.r)}${ga(this.g)}${ga(this.b)}`}function i7(){return`#${ga(this.r)}${ga(this.g)}${ga(this.b)}${ga((isNaN(this.opacity)?1:this.opacity)*255)}`}function _S(){const e=md(this.opacity);return`${e===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${e===1?")":`, ${e})`}`}function md(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ma(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ga(e){return e=Ma(e),(e<16?"0":"")+e.toString(16)}function kS(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xr(e,t,r,n)}function YE(e){if(e instanceof Xr)return new Xr(e.h,e.s,e.l,e.opacity);if(e instanceof bc||(e=ku(e)),!e)return new Xr;if(e instanceof Xr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new Xr(o,s,l,e.opacity)}function a7(e,t,r,n){return arguments.length===1?YE(e):new Xr(e,t,r,n??1)}function Xr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}bb(Xr,a7,QE(bc,{brighter(e){return e=e==null?pd:Math.pow(pd,e),new Xr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new Xr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Jt(Sm(e>=240?e-240:e+120,i,n),Sm(e,i,n),Sm(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Xr(AS(this.h),Zc(this.s),Zc(this.l),md(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=md(this.opacity);return`${e===1?"hsl(":"hsla("}${AS(this.h)}, ${Zc(this.s)*100}%, ${Zc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function AS(e){return e=(e||0)%360,e<0?e+360:e}function Zc(e){return Math.max(0,Math.min(1,e||0))}function Sm(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const wb=e=>()=>e;function o7(e,t){return function(r){return e+r*t}}function s7(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function l7(e){return(e=+e)==1?XE:function(t,r){return r-t?s7(t,r,e):wb(isNaN(t)?r:t)}}function XE(e,t){var r=t-e;return r?o7(e,r):wb(isNaN(e)?t:e)}const ES=function e(t){var r=l7(t);function n(i,a){var o=r((i=Ly(i)).r,(a=Ly(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=XE(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function u7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:vd(n,i)})),r=jm.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function b7(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?w7:b7,l=u=null,d}function d(h){return h==null||isNaN(h=+h)?a:(l||(l=s(e.map(n),t,r)))(n(o(h)))}return d.invert=function(h){return o(i((u||(u=s(t,e.map(n),vd)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,yd),f()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),r=Sb,f()},d.clamp=function(h){return arguments.length?(o=h?!0:Ut,f()):o!==Ut},d.interpolate=function(h){return arguments.length?(r=h,f()):r},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,p){return n=h,i=p,f()}}function jb(){return ip()(Ut,Ut)}function S7(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function gd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function os(e){return e=gd(Math.abs(e)),e?e[1]:NaN}function j7(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function O7(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var P7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=P7.exec(e)))throw new Error("invalid format: "+e);var t;return new Ob({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Au.prototype=Ob.prototype;function Ob(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ob.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _7(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var xd;function k7(e,t){var r=gd(e,t);if(!r)return xd=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(xd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+gd(e,Math.max(0,t+a-1))[0]}function TS(e,t){var r=gd(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const $S={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:S7,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>TS(e*100,t),r:TS,s:k7,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function CS(e){return e}var MS=Array.prototype.map,RS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function A7(e){var t=e.grouping===void 0||e.thousands===void 0?CS:j7(MS.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?CS:O7(MS.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=Au(d);var p=d.fill,v=d.align,m=d.sign,y=d.symbol,b=d.zero,g=d.width,x=d.comma,S=d.precision,w=d.trim,j=d.type;j==="n"?(x=!0,j="g"):$S[j]||(S===void 0&&(S=12),w=!0,j="g"),(b||p==="0"&&v==="=")&&(b=!0,p="0",v="=");var O=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),P=(y==="$"?n:/[%p]/.test(j)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),A=$S[j],E=/[defgprs%]/.test(j);S=S===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function N(T){var M=O,R=P,D,L,U;if(j==="c")R=A(T)+R,T="";else{T=+T;var C=T<0||1/T<0;if(T=isNaN(T)?l:A(Math.abs(T),S),w&&(T=_7(T)),C&&+T==0&&m!=="+"&&(C=!1),M=(C?m==="("?m:s:m==="-"||m==="("?"":m)+M,R=(j==="s"&&!isNaN(T)&&xd!==void 0?RS[8+xd/3]:"")+R+(C&&m==="("?")":""),E){for(D=-1,L=T.length;++DU||U>57){R=(U===46?i+T.slice(D+1):T.slice(D))+R,T=T.slice(0,D);break}}}x&&!b&&(T=t(T,1/0));var F=M.length+T.length+R.length,z=F>1)+M+T+R+z.slice(F);break;default:T=z+M+T+R;break}return a(T)}return N.toString=function(){return d+""},N}function f(d,h){var p=Math.max(-8,Math.min(8,Math.floor(os(h)/3)))*3,v=Math.pow(10,-p),m=u((d=Au(d),d.type="f",d),{suffix:RS[8+p/3]});return function(y){return m(v*y)}}return{format:u,formatPrefix:f}}var Jc,Pb,ZE;E7({thousands:",",grouping:[3],currency:["$",""]});function E7(e){return Jc=A7(e),Pb=Jc.format,ZE=Jc.formatPrefix,Jc}function N7(e){return Math.max(0,-os(Math.abs(e)))}function T7(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(os(t)/3)))*3-os(Math.abs(e)))}function $7(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,os(t)-os(e))+1}function JE(e,t,r,n){var i=Dy(e,t,r),a;switch(n=Au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=T7(i,o))&&(n.precision=a),ZE(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=$7(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=N7(i))&&(n.precision=a-(n.type==="%")*2);break}}return Pb(n)}function Yi(e){var t=e.domain;return e.ticks=function(r){var n=t();return My(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return JE(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,f=10;for(s0;){if(u=Ry(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function bd(){var e=jb();return e.copy=function(){return wc(e,bd())},Fr.apply(e,arguments),Yi(e)}function eN(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,yd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return eN(e).unknown(t)},e=arguments.length?Array.from(e,yd):[0,1],Yi(r)}function tN(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function I7(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function LS(e){return(t,r)=>-e(-t,r)}function _b(e){const t=e(DS,IS),r=t.domain;let n=10,i,a;function o(){return i=I7(n),a=D7(n),r()[0]<0?(i=LS(i),a=LS(a),e(C7,M7)):e(DS,IS),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const d=f0){for(;h<=p;++h)for(v=1;vf)break;b.push(m)}}else for(;h<=p;++h)for(v=n-1;v>=1;--v)if(m=h>0?v/a(-h):v*a(h),!(mf)break;b.push(m)}b.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Au(l)).precision==null&&(l.trim=!0),l=Pb(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let d=f/a(Math.round(i(f)));return d*nr(tN(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function rN(){const e=_b(ip()).domain([1,10]);return e.copy=()=>wc(e,rN()).base(e.base()),Fr.apply(e,arguments),e}function FS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function BS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function kb(e){var t=1,r=e(FS(t),BS(t));return r.constant=function(n){return arguments.length?e(FS(t=+n),BS(t)):t},Yi(r)}function nN(){var e=kb(ip());return e.copy=function(){return wc(e,nN()).constant(e.constant())},Fr.apply(e,arguments)}function zS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function L7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function F7(e){return e<0?-e*e:e*e}function Ab(e){var t=e(Ut,Ut),r=1;function n(){return r===1?e(Ut,Ut):r===.5?e(L7,F7):e(zS(r),zS(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Yi(t)}function Eb(){var e=Ab(ip());return e.copy=function(){return wc(e,Eb()).exponent(e.exponent())},Fr.apply(e,arguments),e}function B7(){return Eb.apply(null,arguments).exponent(.5)}function US(e){return Math.sign(e)*e*e}function z7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function iN(){var e=jb(),t=[0,1],r=!1,n;function i(a){var o=z7(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(US(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,yd)).map(US)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return iN(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Fr.apply(i,arguments),Yi(i)}function aN(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return oN().domain([e,t]).range(i).unknown(a)},Fr.apply(Yi(o),arguments)}function sN(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[xc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return sN().domain(e).range(t).unknown(r)},Fr.apply(i,arguments)}const Om=new Date,Pm=new Date;function vt(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uvt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Om.setTime(+a),Pm.setTime(+o),e(Om),e(Pm),Math.floor(r(Om,Pm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const wd=vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);wd.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):wd);wd.range;const Rn=1e3,$r=Rn*60,Dn=$r*60,Hn=Dn*24,Nb=Hn*7,qS=Hn*30,_m=Hn*365,xa=vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rn)},(e,t)=>(t-e)/Rn,e=>e.getUTCSeconds());xa.range;const Tb=vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getMinutes());Tb.range;const $b=vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getUTCMinutes());$b.range;const Cb=vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn-e.getMinutes()*$r)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getHours());Cb.range;const Mb=vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getUTCHours());Mb.range;const Sc=vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$r)/Hn,e=>e.getDate()-1);Sc.range;const ap=vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hn,e=>e.getUTCDate()-1);ap.range;const lN=vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hn,e=>Math.floor(e/Hn));lN.range;function Za(e){return vt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*$r)/Nb)}const op=Za(0),Sd=Za(1),U7=Za(2),q7=Za(3),ss=Za(4),W7=Za(5),H7=Za(6);op.range;Sd.range;U7.range;q7.range;ss.range;W7.range;H7.range;function Ja(e){return vt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Nb)}const sp=Ja(0),jd=Ja(1),K7=Ja(2),V7=Ja(3),ls=Ja(4),G7=Ja(5),Q7=Ja(6);sp.range;jd.range;K7.range;V7.range;ls.range;G7.range;Q7.range;const Rb=vt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Rb.range;const Db=vt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Db.range;const Kn=vt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Kn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Kn.range;const Vn=vt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Vn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Vn.range;function uN(e,t,r,n,i,a){const o=[[xa,1,Rn],[xa,5,5*Rn],[xa,15,15*Rn],[xa,30,30*Rn],[a,1,$r],[a,5,5*$r],[a,15,15*$r],[a,30,30*$r],[i,1,Dn],[i,3,3*Dn],[i,6,6*Dn],[i,12,12*Dn],[n,1,Hn],[n,2,2*Hn],[r,1,Nb],[t,1,qS],[t,3,3*qS],[e,1,_m]];function s(u,f,d){const h=fy).right(o,h);if(p===o.length)return e.every(Dy(u/_m,f/_m,d));if(p===0)return wd.every(Math.max(Dy(u,f,d),1));const[v,m]=o[h/o[p-1][2]53)return null;"w"in W||(W.w=1),"Z"in W?(me=Am(ml(W.y,0,1)),st=me.getUTCDay(),me=st>4||st===0?jd.ceil(me):jd(me),me=ap.offset(me,(W.V-1)*7),W.y=me.getUTCFullYear(),W.m=me.getUTCMonth(),W.d=me.getUTCDate()+(W.w+6)%7):(me=km(ml(W.y,0,1)),st=me.getDay(),me=st>4||st===0?Sd.ceil(me):Sd(me),me=Sc.offset(me,(W.V-1)*7),W.y=me.getFullYear(),W.m=me.getMonth(),W.d=me.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),st="Z"in W?Am(ml(W.y,0,1)).getUTCDay():km(ml(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(st+5)%7:W.w+W.U*7-(st+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,Am(W)):km(W)}}function P(Q,le,fe,W){for(var We=0,me=le.length,st=fe.length,lt,Gt;We=st)return-1;if(lt=le.charCodeAt(We++),lt===37){if(lt=le.charAt(We++),Gt=w[lt in WS?le.charAt(We++):lt],!Gt||(W=Gt(Q,fe,W))<0)return-1}else if(lt!=fe.charCodeAt(W++))return-1}return W}function A(Q,le,fe){var W=u.exec(le.slice(fe));return W?(Q.p=f.get(W[0].toLowerCase()),fe+W[0].length):-1}function E(Q,le,fe){var W=p.exec(le.slice(fe));return W?(Q.w=v.get(W[0].toLowerCase()),fe+W[0].length):-1}function N(Q,le,fe){var W=d.exec(le.slice(fe));return W?(Q.w=h.get(W[0].toLowerCase()),fe+W[0].length):-1}function T(Q,le,fe){var W=b.exec(le.slice(fe));return W?(Q.m=g.get(W[0].toLowerCase()),fe+W[0].length):-1}function M(Q,le,fe){var W=m.exec(le.slice(fe));return W?(Q.m=y.get(W[0].toLowerCase()),fe+W[0].length):-1}function R(Q,le,fe){return P(Q,t,le,fe)}function D(Q,le,fe){return P(Q,r,le,fe)}function L(Q,le,fe){return P(Q,n,le,fe)}function U(Q){return o[Q.getDay()]}function C(Q){return a[Q.getDay()]}function F(Q){return l[Q.getMonth()]}function z(Q){return s[Q.getMonth()]}function G(Q){return i[+(Q.getHours()>=12)]}function q(Q){return 1+~~(Q.getMonth()/3)}function ee(Q){return o[Q.getUTCDay()]}function ce(Q){return a[Q.getUTCDay()]}function V(Q){return l[Q.getUTCMonth()]}function ie(Q){return s[Q.getUTCMonth()]}function Le(Q){return i[+(Q.getUTCHours()>=12)]}function ot(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var le=j(Q+="",x);return le.toString=function(){return Q},le},parse:function(Q){var le=O(Q+="",!1);return le.toString=function(){return Q},le},utcFormat:function(Q){var le=j(Q+="",S);return le.toString=function(){return Q},le},utcParse:function(Q){var le=O(Q+="",!0);return le.toString=function(){return Q},le}}}var WS={"-":"",_:" ",0:"0"},St=/^\s*\d+/,tV=/^%/,rV=/[\\^$*+?|[\]().{}]/g;function ye(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function iV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function aV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function oV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function sV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function lV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function HS(e,t,r){var n=St.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function KS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function uV(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function cV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function fV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function VS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function dV(e,t,r){var n=St.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function GS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function hV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function pV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function mV(e,t,r){var n=St.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function vV(e,t,r){var n=St.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function yV(e,t,r){var n=tV.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function gV(e,t,r){var n=St.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function xV(e,t,r){var n=St.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function QS(e,t){return ye(e.getDate(),t,2)}function bV(e,t){return ye(e.getHours(),t,2)}function wV(e,t){return ye(e.getHours()%12||12,t,2)}function SV(e,t){return ye(1+Sc.count(Kn(e),e),t,3)}function cN(e,t){return ye(e.getMilliseconds(),t,3)}function jV(e,t){return cN(e,t)+"000"}function OV(e,t){return ye(e.getMonth()+1,t,2)}function PV(e,t){return ye(e.getMinutes(),t,2)}function _V(e,t){return ye(e.getSeconds(),t,2)}function kV(e){var t=e.getDay();return t===0?7:t}function AV(e,t){return ye(op.count(Kn(e)-1,e),t,2)}function fN(e){var t=e.getDay();return t>=4||t===0?ss(e):ss.ceil(e)}function EV(e,t){return e=fN(e),ye(ss.count(Kn(e),e)+(Kn(e).getDay()===4),t,2)}function NV(e){return e.getDay()}function TV(e,t){return ye(Sd.count(Kn(e)-1,e),t,2)}function $V(e,t){return ye(e.getFullYear()%100,t,2)}function CV(e,t){return e=fN(e),ye(e.getFullYear()%100,t,2)}function MV(e,t){return ye(e.getFullYear()%1e4,t,4)}function RV(e,t){var r=e.getDay();return e=r>=4||r===0?ss(e):ss.ceil(e),ye(e.getFullYear()%1e4,t,4)}function DV(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ye(t/60|0,"0",2)+ye(t%60,"0",2)}function YS(e,t){return ye(e.getUTCDate(),t,2)}function IV(e,t){return ye(e.getUTCHours(),t,2)}function LV(e,t){return ye(e.getUTCHours()%12||12,t,2)}function FV(e,t){return ye(1+ap.count(Vn(e),e),t,3)}function dN(e,t){return ye(e.getUTCMilliseconds(),t,3)}function BV(e,t){return dN(e,t)+"000"}function zV(e,t){return ye(e.getUTCMonth()+1,t,2)}function UV(e,t){return ye(e.getUTCMinutes(),t,2)}function qV(e,t){return ye(e.getUTCSeconds(),t,2)}function WV(e){var t=e.getUTCDay();return t===0?7:t}function HV(e,t){return ye(sp.count(Vn(e)-1,e),t,2)}function hN(e){var t=e.getUTCDay();return t>=4||t===0?ls(e):ls.ceil(e)}function KV(e,t){return e=hN(e),ye(ls.count(Vn(e),e)+(Vn(e).getUTCDay()===4),t,2)}function VV(e){return e.getUTCDay()}function GV(e,t){return ye(jd.count(Vn(e)-1,e),t,2)}function QV(e,t){return ye(e.getUTCFullYear()%100,t,2)}function YV(e,t){return e=hN(e),ye(e.getUTCFullYear()%100,t,2)}function XV(e,t){return ye(e.getUTCFullYear()%1e4,t,4)}function ZV(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ls(e):ls.ceil(e),ye(e.getUTCFullYear()%1e4,t,4)}function JV(){return"+0000"}function XS(){return"%"}function ZS(e){return+e}function JS(e){return Math.floor(+e/1e3)}var io,pN,mN;eG({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function eG(e){return io=eV(e),pN=io.format,io.parse,mN=io.utcFormat,io.utcParse,io}function tG(e){return new Date(e)}function rG(e){return e instanceof Date?+e:+new Date(+e)}function Ib(e,t,r,n,i,a,o,s,l,u){var f=jb(),d=f.invert,h=f.domain,p=u(".%L"),v=u(":%S"),m=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),g=u("%b %d"),x=u("%B"),S=u("%Y");function w(j){return(l(j)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>HK(e,a/n))},r.copy=function(){return xN(t).domain(e)},ei.apply(r,arguments)}function up(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Ut,f,d=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+f(m))-a)*(n*mt}var jN=uG,cG=cp,fG=jN,dG=Ks;function hG(e){return e&&e.length?cG(e,dG,fG):void 0}var pG=hG;const Oi=Se(pG);function mG(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};J.decimalPlaces=J.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*De;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};J.dividedBy=J.div=function(e){return Bn(this,new this.constructor(e))};J.dividedToIntegerBy=J.idiv=function(e){var t=this,r=t.constructor;return Ee(Bn(t,new r(e),0,1),r.precision)};J.equals=J.eq=function(e){return!this.cmp(e)};J.exponent=function(){return nt(this)};J.greaterThan=J.gt=function(e){return this.cmp(e)>0};J.greaterThanOrEqualTo=J.gte=function(e){return this.cmp(e)>=0};J.isInteger=J.isint=function(){return this.e>this.d.length-2};J.isNegative=J.isneg=function(){return this.s<0};J.isPositive=J.ispos=function(){return this.s>0};J.isZero=function(){return this.s===0};J.lessThan=J.lt=function(e){return this.cmp(e)<0};J.lessThanOrEqualTo=J.lte=function(e){return this.cmp(e)<1};J.logarithm=J.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(dr))throw Error(Ir+"NaN");if(r.s<1)throw Error(Ir+(r.s?"NaN":"-Infinity"));return r.eq(dr)?new n(0):(Be=!1,t=Bn(Eu(r,a),Eu(e,a),a),Be=!0,Ee(t,i))};J.minus=J.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?AN(t,e):_N(t,(e.s=-e.s,e))};J.modulo=J.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Ir+"NaN");return r.s?(Be=!1,t=Bn(r,e,0,1).times(e),Be=!0,r.minus(t)):Ee(new n(r),i)};J.naturalExponential=J.exp=function(){return kN(this)};J.naturalLogarithm=J.ln=function(){return Eu(this)};J.negated=J.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};J.plus=J.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_N(t,e):AN(t,(e.s=-e.s,e))};J.precision=J.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ra+e);if(t=nt(i)+1,n=i.d.length-1,r=n*De+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};J.squareRoot=J.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Ir+"NaN")}for(e=nt(s),Be=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=hn(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Qs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Bn(s,a,o+2)).times(.5),hn(a.d).slice(0,o)===(t=hn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Ee(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return Be=!0,Ee(n,r)};J.times=J.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,d=f.constructor,h=f.d,p=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,l=h.length,u=p.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+p[n]*h[i-n-1]+t,a[i--]=s%gt|0,t=s/gt|0;a[i]=(a[i]+t)%gt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,Be?Ee(e,d.precision):e};J.toDecimalPlaces=J.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(bn(e,0,Gs),t===void 0?t=n.rounding:bn(t,0,8),Ee(r,e+nt(r)+1,t))};J.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ha(n,!0):(bn(e,0,Gs),t===void 0?t=i.rounding:bn(t,0,8),n=Ee(new i(n),e+1,t),r=Ha(n,!0,e+1)),r};J.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Ha(i):(bn(e,0,Gs),t===void 0?t=a.rounding:bn(t,0,8),n=Ee(new a(i),e+nt(i)+1,t),r=Ha(n.abs(),!1,e+nt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};J.toInteger=J.toint=function(){var e=this,t=e.constructor;return Ee(new t(e),nt(e)+1,t.rounding)};J.toNumber=function(){return+this};J.toPower=J.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(dr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Ir+"Infinity");return s}if(s.eq(dr))return s;if(n=l.precision,e.eq(dr))return Ee(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=PN){for(i=new l(dr),t=Math.ceil(n/De+4),Be=!1;r%2&&(i=i.times(s),rj(i.d,t)),r=Qs(r/2),r!==0;)s=s.times(s),rj(s.d,t);return Be=!0,e.s<0?new l(dr).div(i):Ee(i,n)}}else if(a<0)throw Error(Ir+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,Be=!1,i=e.times(Eu(s,n+u)),Be=!0,i=kN(i),i.s=a,i};J.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=nt(i),n=Ha(i,r<=a.toExpNeg||r>=a.toExpPos)):(bn(e,1,Gs),t===void 0?t=a.rounding:bn(t,0,8),i=Ee(new a(i),e,t),r=nt(i),n=Ha(i,e<=r||r<=a.toExpNeg,e)),n};J.toSignificantDigits=J.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(bn(e,1,Gs),t===void 0?t=n.rounding:bn(t,0,8)),Ee(new n(r),e,t)};J.toString=J.valueOf=J.val=J.toJSON=J[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=nt(e),r=e.constructor;return Ha(e,t<=r.toExpNeg||t>=r.toExpPos)};function _N(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Be?Ee(t,d):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(d/De),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/gt|0,l[a]%=gt;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,Be?Ee(t,d):t}function bn(e,t,r){if(e!==~~e||er)throw Error(Ra+e)}function hn(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,f,d,h,p,v,m,y,b,g,x,S,w,j,O,P,A=n.constructor,E=n.s==i.s?1:-1,N=n.d,T=i.d;if(!n.s)return new A(n);if(!i.s)throw Error(Ir+"Division by zero");for(l=n.e-i.e,O=T.length,w=N.length,p=new A(E),v=p.d=[],u=0;T[u]==(N[u]||0);)++u;if(T[u]>(N[u]||0)&&--l,a==null?g=a=A.precision:o?g=a+(nt(n)-nt(i))+1:g=a,g<0)return new A(0);if(g=g/De+2|0,u=0,O==1)for(f=0,T=T[0],g++;(u1&&(T=e(T,f),N=e(N,f),O=T.length,w=N.length),S=O,m=N.slice(0,O),y=m.length;y=gt/2&&++j;do f=0,s=t(T,m,O,y),s<0?(b=m[0],O!=y&&(b=b*gt+(m[1]||0)),f=b/j|0,f>1?(f>=gt&&(f=gt-1),d=e(T,f),h=d.length,y=m.length,s=t(d,m,h,y),s==1&&(f--,r(d,O16)throw Error(Bb+nt(e));if(!e.s)return new f(dr);for(Be=!1,s=d,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(ua(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(dr),f.precision=s;;){if(i=Ee(i.times(e),s),r=r.times(++l),o=a.plus(Bn(i,r,s)),hn(o.d).slice(0,s)===hn(a.d).slice(0,s)){for(;u--;)a=Ee(a.times(a),s);return f.precision=d,t==null?(Be=!0,Ee(a,d)):a}a=o}}function nt(e){for(var t=e.e*De,r=e.d[0];r>=10;r/=10)t++;return t}function Em(e,t,r){if(t>e.LN10.sd())throw Be=!0,r&&(e.precision=r),Error(Ir+"LN10 precision limit exceeded");return Ee(new e(e.LN10),t)}function ui(e){for(var t="";e--;)t+="0";return t}function Eu(e,t){var r,n,i,a,o,s,l,u,f,d=1,h=10,p=e,v=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(Ir+(p.s?"NaN":"-Infinity"));if(p.eq(dr))return new m(0);if(t==null?(Be=!1,u=y):u=t,p.eq(10))return t==null&&(Be=!0),Em(m,u);if(u+=h,m.precision=u,r=hn(v),n=r.charAt(0),a=nt(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=hn(p.d),n=r.charAt(0),d++;a=nt(p),n>1?(p=new m("0."+r),a++):p=new m(n+"."+r.slice(1))}else return l=Em(m,u+2,y).times(a+""),p=Eu(new m(n+"."+r.slice(1)),u-h).plus(l),m.precision=y,t==null?(Be=!0,Ee(p,y)):p;for(s=o=p=Bn(p.minus(dr),p.plus(dr),u),f=Ee(p.times(p),u),i=3;;){if(o=Ee(o.times(f),u),l=s.plus(Bn(o,new m(i),u)),hn(l.d).slice(0,u)===hn(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(Em(m,u+2,y).times(a+""))),s=Bn(s,new m(d),u),m.precision=y,t==null?(Be=!0,Ee(s,y)):s;s=l,i+=2}}function tj(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Qs(r/De),e.d=[],n=(r+1)%De,r<0&&(n+=De),nOd||e.e<-Od))throw Error(Bb+r)}else e.s=0,e.e=0,e.d=[0];return e}function Ee(e,t,r){var n,i,a,o,s,l,u,f,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=De,i=t,u=d[f=0];else{if(f=Math.ceil((n+1)/De),a=d.length,f>=a)return e;for(u=a=d[f],o=1;a>=10;a/=10)o++;n%=De,i=n-De+o}if(r!==void 0&&(a=ua(10,o-i-1),s=u/a%10|0,l=t<0||d[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/ua(10,o-i):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(a=nt(e),d.length=1,t=t-a-1,d[0]=ua(10,(De-t%De)%De),e.e=Qs(-t/De)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,a=1,f--):(d.length=f+1,a=ua(10,De-n),d[f]=i>0?(u/ua(10,o-i)%ua(10,i)|0)*a:0),l)for(;;)if(f==0){(d[0]+=a)==gt&&(d[0]=1,++e.e);break}else{if(d[f]+=a,d[f]!=gt)break;d[f--]=0,a=1}for(n=d.length;d[--n]===0;)d.pop();if(Be&&(e.e>Od||e.e<-Od))throw Error(Bb+nt(e));return e}function AN(e,t){var r,n,i,a,o,s,l,u,f,d,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Be?Ee(t,p):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=d.length):(r=d,n=u,s=l.length),i=Math.max(Math.ceil(p/De),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=d.length,f=i0;--i)l[s++]=0;for(i=d.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+ui(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ui(-i-1)+a,r&&(n=r-o)>0&&(a+=ui(n))):i>=o?(a+=ui(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+ui(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=ui(n))),e.s<0?"-"+a:a}function rj(e,t){if(e.length>t)return e.length=t,!0}function EN(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ra+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return tj(o,a.toString())}else if(typeof a!="string")throw Error(Ra+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,DG.test(a))tj(o,a);else throw Error(Ra+a)}if(i.prototype=J,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=EN,i.config=i.set=IG,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Ra+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ra+r+": "+n);return this}var zb=EN(RG);dr=new zb(1);const _e=zb;function LG(e){return UG(e)||zG(e)||BG(e)||FG()}function FG(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BG(e,t){if(e){if(typeof e=="string")return zy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zy(e,t)}}function zG(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function UG(e){if(Array.isArray(e))return zy(e)}function zy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,nj(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function nQ(e){if(Array.isArray(e))return e}function MN(e){var t=Nu(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function RN(e,t,r){if(e.lte(0))return new _e(0);var n=hp.getDigitCount(e.toNumber()),i=new _e(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new _e(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new _e(Math.ceil(l))}function iQ(e,t,r){var n=1,i=new _e(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new _e(10).pow(hp.getDigitCount(e)-1),i=new _e(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new _e(Math.floor(e)))}else e===0?i=new _e(Math.floor((t-1)/2)):r||(i=new _e(Math.floor(e)));var o=Math.floor((t-1)/2),s=KG(HG(function(l){return i.add(new _e(l-o).mul(n)).toNumber()}),Uy);return s(0,t)}function DN(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new _e(0),tickMin:new _e(0),tickMax:new _e(0)};var a=RN(new _e(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new _e(0):(o=new _e(e).add(t).div(2),o=o.sub(new _e(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new _e(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?DN(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new _e(s).mul(a)),tickMax:o.add(new _e(l).mul(a))})}function aQ(e){var t=Nu(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=MN([r,n]),l=Nu(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(Wy(Uy(0,i-1).map(function(){return 1/0}))):[].concat(Wy(Uy(0,i-1).map(function(){return-1/0})),[f]);return r>n?qy(d):d}if(u===f)return iQ(u,i,a);var h=DN(u,f,o,a),p=h.step,v=h.tickMin,m=h.tickMax,y=hp.rangeStep(v,m.add(new _e(.1).mul(p)),p);return r>n?qy(y):y}function oQ(e,t){var r=Nu(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=MN([n,i]),s=Nu(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),d=RN(new _e(u).sub(l).div(f-1),a,0),h=[].concat(Wy(hp.rangeStep(new _e(l),new _e(u).sub(new _e(.99).mul(d)),d)),[u]);return n>i?qy(h):h}var sQ=$N(aQ),lQ=$N(oQ),uQ="Invariant failed";function Ka(e,t){throw new Error(uQ)}var cQ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xQ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,d=i[u].coordinate,h=u>=s-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(Bt(d-f)!==Bt(h-d)){var v=[];if(Bt(h-d)===Bt(l[1]-l[0])){p=h;var m=d+l[1]-l[0];v[0]=Math.min(m,(m+f)/2),v[1]=Math.max(m,(m+f)/2)}else{p=f;var y=h+l[1]-l[0];v[0]=Math.min(d,(y+d)/2),v[1]=Math.max(d,(y+d)/2)}var b=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>b[0]&&t<=b[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var g=Math.min(f,h),x=Math.max(f,h);if(t>(g+d)/2&&t<=(x+d)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},Ub=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ve(Ve({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},DQ=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(b&&b.length){var g=b[0].type.defaultProps,x=g!==void 0?Ve(Ve({},g),b[0].props):b[0].props,S=x.barSize,w=x[y];o[w]||(o[w]=[]);var j=re(S)?r:S;o[w].push({item:b[0],stackList:b.slice(1),barSize:re(j)?void 0:zt(j,n,0)})}}return o},IQ=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=zt(r,i,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/l,v=o.reduce(function(S,w){return S+w.barSize||0},0);v+=(l-1)*u,v>=i&&(v-=(l-1)*u,u=0),v>=i&&p>0&&(h=!0,p*=.9,v=l*p);var m=(i-v)/2>>0,y={offset:m-u,size:0};f=o.reduce(function(S,w){var j={item:w.item,position:{offset:y.offset+y.size+u,size:h?p:w.barSize}},O=[].concat(oj(S),[j]);return y=O[O.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(P){O.push({item:P,position:y})}),O},d)}else{var b=zt(n,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var g=(i-2*b-(l-1)*u)/l;g>1&&(g>>=0);var x=s===+s?Math.min(g,s):g;f=o.reduce(function(S,w,j){var O=[].concat(oj(S),[{item:w.item,position:{offset:b+(g+u)*j+(g-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(P){O.push({item:P,position:O[O.length-1].position})}),O},d)}return f},LQ=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=BN({children:a,legendWidth:l});if(u){var f=i||{},d=f.width,h=f.height,p=u.align,v=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&v==="middle")&&p!=="center"&&H(t[p]))return Ve(Ve({},t),{},Mo({},p,t[p]+(d||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&v!=="middle"&&H(t[v]))return Ve(Ve({},t),{},Mo({},v,t[v]+(h||0)))}return t},FQ=function(t,r,n){return re(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},zN=function(t,r,n,i,a){var o=r.props.children,s=Wt(o,Ys).filter(function(u){return FQ(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Ae(f,n);if(re(d))return u;var h=Array.isArray(d)?[fp(d),Oi(d)]:[d,d],p=l.reduce(function(v,m){var y=Ae(f,m,0),b=h[0]-Math.abs(Array.isArray(y)?y[0]:y),g=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(b,v[0]),Math.max(g,v[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},BQ=function(t,r,n,i,a){var o=r.map(function(s){return zN(t,s,n,a,i)}).filter(function(s){return!re(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},UN=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&zN(t,l,u,i)||Ul(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,d=u.length;f=2?Bt(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var h=a?a.indexOf(d):d;return{coordinate:i(h)+u,value:d,offset:u}});return f.filter(function(d){return!qs(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,h){return{coordinate:i(d)+u,value:d,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(d){return{coordinate:i(d)+u,value:d,offset:u}}):i.domain().map(function(d,h){return{coordinate:i(d)+u,value:a?a[d]:d,index:h,offset:u}})},Nm=new WeakMap,ef=function(t,r){if(typeof r!="function")return t;Nm.has(t)||Nm.set(t,new WeakMap);var n=Nm.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},HN=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Ou(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:bd(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:zl(),realScaleType:"point"}:a==="category"?{scale:Ou(),realScaleType:"band"}:{scale:bd(),realScaleType:"linear"};if(qa(i)){var l="scale".concat(Yh(i));return{scale:(ej[l]||zl)(),realScaleType:ej[l]?l:"point"}}return te(i)?{scale:i}:{scale:zl(),realScaleType:"point"}},lj=1e-4,KN=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-lj,o=Math.max(i[0],i[1])+lj,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},zQ=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},WQ=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},HQ={sign:qQ,expand:c8,none:ts,silhouette:f8,wiggle:d8,positive:WQ},KQ=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=HQ[n],o=u8().keys(i).value(function(s,l){return+Ae(s,l,0)}).order(gy).offset(a);return o(t)},VQ=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(d,h){var p,v=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Ve(Ve({},h.type.defaultProps),h.props):h.props,m=v.stackId,y=v.hide;if(y)return d;var b=v[n],g=d[b]||{hasStack:!1,stackGroups:{}};if(pt(m)){var x=g.stackGroups[m]||{numericAxisId:n,cateAxisId:i,items:[]};x.items.push(h),g.hasStack=!0,g.stackGroups[m]=x}else g.stackGroups[Qi("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return Ve(Ve({},d),{},Mo({},b,g))},l),f={};return Object.keys(u).reduce(function(d,h){var p=u[h];if(p.hasStack){var v={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var b=p.stackGroups[y];return Ve(Ve({},m),{},Mo({},y,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:KQ(t,b.items,a)}))},v)}return Ve(Ve({},d),{},Mo({},h,p))},f)},VN=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=sQ(u,a,s);return t.domain([fp(f),Oi(f)]),{niceTicks:f}}if(a&&i==="number"){var d=t.domain(),h=lQ(d,a,s);return{niceTicks:h}}return null};function cs(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!re(i[t.dataKey])){var s=Zf(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Ae(i,re(o)?t.dataKey:o);return re(l)?null:t.scale(l)}var uj=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Ae(o,r.dataKey,r.domain[s]);return re(l)?null:r.scale(l)-a/2+i},GQ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},QQ=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ve(Ve({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(pt(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},YQ=function(t){return t.reduce(function(r,n){return[fp(n.concat([r[0]]).filter(H)),Oi(n.concat([r[1]]).filter(H))]},[1/0,-1/0])},GN=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var d=YQ(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},cj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Gy=function(t,r,n){if(te(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(H(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(cj.test(t[0])){var a=+cj.exec(t[0])[1];i[0]=r[0]-a}else te(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(H(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(fj.test(t[1])){var o=+fj.exec(t[1])[1];i[1]=r[1]+o}else te(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},kd=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=vb(r,function(d){return d.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},ZN=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=zt(t.cx,o,o/2),d=zt(t.cy,s,s/2),h=XN(o,s,n),p=zt(t.innerRadius,h,0),v=zt(t.outerRadius,h,h*.8),m=Object.keys(r);return m.reduce(function(y,b){var g=r[b],x=g.domain,S=g.reversed,w;if(re(g.range))i==="angleAxis"?w=[l,u]:i==="radiusAxis"&&(w=[p,v]),S&&(w=[w[1],w[0]]);else{w=g.range;var j=w,O=JQ(j,2);l=O[0],u=O[1]}var P=HN(g,a),A=P.realScaleType,E=P.scale;E.domain(x).range(w),KN(E);var N=VN(E,An(An({},g),{},{realScaleType:A})),T=An(An(An({},g),N),{},{range:w,radius:v,realScaleType:A,scale:E,cx:f,cy:d,innerRadius:p,outerRadius:v,startAngle:l,endAngle:u});return An(An({},y),{},YN({},b,T))},{})},aY=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},oY=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=aY({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:iY(u),angleInRadian:u}},sY=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},lY=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},mj=function(t,r){var n=t.x,i=t.y,a=oY({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=sY(r),d=f.startAngle,h=f.endAngle,p=s,v;if(d<=h){for(;p>h;)p-=360;for(;p=d&&p<=h}else{for(;p>d;)p-=360;for(;p=h&&p<=d}return v?An(An({},r),{},{radius:o,angle:lY(p,r)}):null},JN=function(t){return!k.isValidElement(t)&&!te(t)&&typeof t!="boolean"?t.className:""};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}var uY=["offset"];function cY(e){return pY(e)||hY(e)||dY(e)||fY()}function fY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dY(e,t){if(e){if(typeof e=="string")return Qy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qy(e,t)}}function hY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pY(e){if(Array.isArray(e))return Qy(e)}function Qy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t=0?1:-1,x,S;i==="insideStart"?(x=p+g*o,S=m):i==="insideEnd"?(x=v-g*o,S=!m):i==="end"&&(x=v+g*o,S=m),S=b<=0?S:!S;var w=ge(u,f,y,x),j=ge(u,f,y,x+(S?1:-1)*359),O="M".concat(w.x,",").concat(w.y,` A`).concat(y,",").concat(y,",0,1,").concat(S?0:1,`, - `).concat(j.x,",").concat(j.y),P=re(t.id)?Qi("recharts-radial-line-"):t.id;return _.createElement("text",Ru({},n,{dominantBaseline:"central",className:oe("recharts-radial-bar-label",s)}),_.createElement("defs",null,_.createElement("path",{id:P,d:O})),_.createElement("textPath",{xlinkHref:"#".concat(P)},r))},SY=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,f=a.startAngle,d=a.endAngle,h=(f+d)/2;if(i==="outside"){var p=ge(o,s,u+n,h),v=p.x,m=p.y;return{x:v,y:m,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,b=ge(o,s,y,h),g=b.x,x=b.y;return{x:g,y:x,textAnchor:"middle",verticalAnchor:"middle"}},jY=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,d=f>=0?1:-1,h=d*i,p=d>0?"end":"start",v=d>0?"start":"end",m=u>=0?1:-1,y=m*i,b=m>0?"end":"start",g=m>0?"start":"end";if(a==="top"){var x={x:s+u/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return ft(ft({},x),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+f+h,textAnchor:"middle",verticalAnchor:v};return ft(ft({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var w={x:s-y,y:l+f/2,textAnchor:b,verticalAnchor:"middle"};return ft(ft({},w),n?{width:Math.max(w.x-n.x,0),height:f}:{})}if(a==="right"){var j={x:s+u+y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"};return ft(ft({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return a==="insideLeft"?ft({x:s+y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"},O):a==="insideRight"?ft({x:s+u-y,y:l+f/2,textAnchor:b,verticalAnchor:"middle"},O):a==="insideTop"?ft({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},O):a==="insideBottom"?ft({x:s+u/2,y:l+f-h,textAnchor:"middle",verticalAnchor:p},O):a==="insideTopLeft"?ft({x:s+y,y:l+h,textAnchor:g,verticalAnchor:v},O):a==="insideTopRight"?ft({x:s+u-y,y:l+h,textAnchor:b,verticalAnchor:v},O):a==="insideBottomLeft"?ft({x:s+y,y:l+f-h,textAnchor:g,verticalAnchor:p},O):a==="insideBottomRight"?ft({x:s+u-y,y:l+f-h,textAnchor:b,verticalAnchor:p},O):Fs(a)&&(H(a.x)||ya(a.x))&&(H(a.y)||ya(a.y))?ft({x:s+zt(a.x,u),y:l+zt(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):ft({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},OY=function(t){return"cx"in t&&H(t.cx)};function bt(e){var t=e.offset,r=t===void 0?5:t,n=pY(e,lY),i=ft({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,d=f===void 0?"":f,h=i.textBreakAll;if(!a||re(s)&&re(l)&&!k.isValidElement(u)&&!te(u))return null;if(k.isValidElement(u))return k.cloneElement(u,i);var p;if(te(u)){if(p=k.createElement(u,i),k.isValidElement(p))return p}else p=xY(i);var v=OY(a),m=X(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return wY(i,p,m);var y=v?SY(i):jY(i);return _.createElement(Wa,Ru({className:oe("recharts-label",d)},m,y,{breakAll:h}),p)}bt.displayName="Label";var JN=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,h=t.y,p=t.top,v=t.left,m=t.width,y=t.height,b=t.clockWise,g=t.labelViewBox;if(g)return g;if(H(m)&&H(y)){if(H(d)&&H(h))return{x:d,y:h,width:m,height:y};if(H(p)&&H(v))return{x:p,y:v,width:m,height:y}}return H(d)&&H(h)?{x:d,y:h,width:0,height:0}:H(r)&&H(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:b}:t.viewBox?t.viewBox:{}},PY=function(t,r){return t?t===!0?_.createElement(bt,{key:"label-implicit",viewBox:r}):pt(t)?_.createElement(bt,{key:"label-implicit",viewBox:r,value:t}):k.isValidElement(t)?t.type===bt?k.cloneElement(t,{key:"label-implicit",viewBox:r}):_.createElement(bt,{key:"label-implicit",content:t,viewBox:r}):te(t)?_.createElement(bt,{key:"label-implicit",content:t,viewBox:r}):Fs(t)?_.createElement(bt,Ru({viewBox:r},t,{key:"label-implicit"})):null:null},_Y=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=JN(t),o=Wt(i,bt).map(function(l,u){return k.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=PY(t.label,r||a);return[s].concat(uY(o))};bt.parseViewBox=JN;bt.renderCallByParent=_Y;function kY(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var AY=kY;const e2=Se(AY);function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}var EY=["valueAccessor"],NY=["data","dataKey","clockWise","id","textBreakAll"];function TY(e){return RY(e)||MY(e)||CY(e)||$Y()}function $Y(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CY(e,t){if(e){if(typeof e=="string")return Qy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qy(e,t)}}function MY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RY(e){if(Array.isArray(e))return Qy(e)}function Qy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var BY=function(t){return Array.isArray(t.value)?e2(t.value):t.value};function Mr(e){var t=e.valueAccessor,r=t===void 0?BY:t,n=gj(e,EY),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=gj(n,NY);return!i||!i.length?null:_.createElement(se,{className:"recharts-label-list"},i.map(function(f,d){var h=re(a)?r(f,d):Ae(f&&f.payload,a),p=re(s)?{}:{id:"".concat(s,"-").concat(d)};return _.createElement(bt,Ed({},X(f,!0),u,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:l,viewBox:bt.parseViewBox(re(o)?f:yj(yj({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}Mr.displayName="LabelList";function zY(e,t){return e?e===!0?_.createElement(Mr,{key:"labelList-implicit",data:t}):_.isValidElement(e)||te(e)?_.createElement(Mr,{key:"labelList-implicit",data:t,content:e}):Fs(e)?_.createElement(Mr,Ed({data:t},e,{key:"labelList-implicit"})):null:null}function UY(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Wt(n,Mr).map(function(o,s){return k.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=zY(e.label,t);return[a].concat(TY(i))}Mr.renderCallByParent=UY;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function Yy(){return Yy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,b=ge(o,s,y,h),g=b.x,x=b.y;return{x:g,y:x,textAnchor:"middle",verticalAnchor:"middle"}},OY=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,d=f>=0?1:-1,h=d*i,p=d>0?"end":"start",v=d>0?"start":"end",m=u>=0?1:-1,y=m*i,b=m>0?"end":"start",g=m>0?"start":"end";if(a==="top"){var x={x:s+u/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return ft(ft({},x),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+f+h,textAnchor:"middle",verticalAnchor:v};return ft(ft({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var w={x:s-y,y:l+f/2,textAnchor:b,verticalAnchor:"middle"};return ft(ft({},w),n?{width:Math.max(w.x-n.x,0),height:f}:{})}if(a==="right"){var j={x:s+u+y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"};return ft(ft({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return a==="insideLeft"?ft({x:s+y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"},O):a==="insideRight"?ft({x:s+u-y,y:l+f/2,textAnchor:b,verticalAnchor:"middle"},O):a==="insideTop"?ft({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},O):a==="insideBottom"?ft({x:s+u/2,y:l+f-h,textAnchor:"middle",verticalAnchor:p},O):a==="insideTopLeft"?ft({x:s+y,y:l+h,textAnchor:g,verticalAnchor:v},O):a==="insideTopRight"?ft({x:s+u-y,y:l+h,textAnchor:b,verticalAnchor:v},O):a==="insideBottomLeft"?ft({x:s+y,y:l+f-h,textAnchor:g,verticalAnchor:p},O):a==="insideBottomRight"?ft({x:s+u-y,y:l+f-h,textAnchor:b,verticalAnchor:p},O):Fs(a)&&(H(a.x)||ya(a.x))&&(H(a.y)||ya(a.y))?ft({x:s+zt(a.x,u),y:l+zt(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):ft({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},PY=function(t){return"cx"in t&&H(t.cx)};function bt(e){var t=e.offset,r=t===void 0?5:t,n=mY(e,uY),i=ft({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,d=f===void 0?"":f,h=i.textBreakAll;if(!a||re(s)&&re(l)&&!k.isValidElement(u)&&!te(u))return null;if(k.isValidElement(u))return k.cloneElement(u,i);var p;if(te(u)){if(p=k.createElement(u,i),k.isValidElement(p))return p}else p=bY(i);var v=PY(a),m=X(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return SY(i,p,m);var y=v?jY(i):OY(i);return _.createElement(Wa,Ru({className:oe("recharts-label",d)},m,y,{breakAll:h}),p)}bt.displayName="Label";var e2=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,h=t.y,p=t.top,v=t.left,m=t.width,y=t.height,b=t.clockWise,g=t.labelViewBox;if(g)return g;if(H(m)&&H(y)){if(H(d)&&H(h))return{x:d,y:h,width:m,height:y};if(H(p)&&H(v))return{x:p,y:v,width:m,height:y}}return H(d)&&H(h)?{x:d,y:h,width:0,height:0}:H(r)&&H(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:b}:t.viewBox?t.viewBox:{}},_Y=function(t,r){return t?t===!0?_.createElement(bt,{key:"label-implicit",viewBox:r}):pt(t)?_.createElement(bt,{key:"label-implicit",viewBox:r,value:t}):k.isValidElement(t)?t.type===bt?k.cloneElement(t,{key:"label-implicit",viewBox:r}):_.createElement(bt,{key:"label-implicit",content:t,viewBox:r}):te(t)?_.createElement(bt,{key:"label-implicit",content:t,viewBox:r}):Fs(t)?_.createElement(bt,Ru({viewBox:r},t,{key:"label-implicit"})):null:null},kY=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=e2(t),o=Wt(i,bt).map(function(l,u){return k.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=_Y(t.label,r||a);return[s].concat(cY(o))};bt.parseViewBox=e2;bt.renderCallByParent=kY;function AY(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var EY=AY;const t2=Se(EY);function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}var NY=["valueAccessor"],TY=["data","dataKey","clockWise","id","textBreakAll"];function $Y(e){return DY(e)||RY(e)||MY(e)||CY()}function CY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MY(e,t){if(e){if(typeof e=="string")return Yy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yy(e,t)}}function RY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DY(e){if(Array.isArray(e))return Yy(e)}function Yy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var zY=function(t){return Array.isArray(t.value)?t2(t.value):t.value};function Mr(e){var t=e.valueAccessor,r=t===void 0?zY:t,n=xj(e,NY),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=xj(n,TY);return!i||!i.length?null:_.createElement(se,{className:"recharts-label-list"},i.map(function(f,d){var h=re(a)?r(f,d):Ae(f&&f.payload,a),p=re(s)?{}:{id:"".concat(s,"-").concat(d)};return _.createElement(bt,Ed({},X(f,!0),u,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:l,viewBox:bt.parseViewBox(re(o)?f:gj(gj({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}Mr.displayName="LabelList";function UY(e,t){return e?e===!0?_.createElement(Mr,{key:"labelList-implicit",data:t}):_.isValidElement(e)||te(e)?_.createElement(Mr,{key:"labelList-implicit",data:t,content:e}):Fs(e)?_.createElement(Mr,Ed({data:t},e,{key:"labelList-implicit"})):null:null}function qY(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Wt(n,Mr).map(function(o,s){return k.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=UY(e.label,t);return[a].concat($Y(i))}Mr.renderCallByParent=qY;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, `).concat(d.x,",").concat(d.y,` `);if(i>0){var p=ge(r,n,i,o),v=ge(r,n,i,u);h+="L ".concat(v.x,",").concat(v.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},VY=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=Bt(f-u),h=tf({cx:r,cy:n,radius:a,angle:u,sign:d,cornerRadius:o,cornerIsExternal:l}),p=h.circleTangency,v=h.lineTangency,m=h.theta,y=tf({cx:r,cy:n,radius:a,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:l}),b=y.circleTangency,g=y.lineTangency,x=y.theta,S=l?Math.abs(u-f):Math.abs(u-f)-m-x;if(S<0)return s?"M ".concat(v.x,",").concat(v.y,` + `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},GY=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=Bt(f-u),h=tf({cx:r,cy:n,radius:a,angle:u,sign:d,cornerRadius:o,cornerIsExternal:l}),p=h.circleTangency,v=h.lineTangency,m=h.theta,y=tf({cx:r,cy:n,radius:a,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:l}),b=y.circleTangency,g=y.lineTangency,x=y.theta,S=l?Math.abs(u-f):Math.abs(u-f)-m-x;if(S<0)return s?"M ".concat(v.x,",").concat(v.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):t2({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var w="M ".concat(v.x,",").concat(v.y,` + `):r2({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var w="M ".concat(v.x,",").concat(v.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,` A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(g.x,",").concat(g.y,` `);if(i>0){var j=tf({cx:r,cy:n,radius:i,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=j.circleTangency,P=j.lineTangency,A=j.theta,E=tf({cx:r,cy:n,radius:i,angle:f,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),N=E.circleTangency,T=E.lineTangency,M=E.theta,R=l?Math.abs(u-f):Math.abs(u-f)-A-M;if(R<0&&o===0)return"".concat(w,"L").concat(r,",").concat(n,"Z");w+="L".concat(T.x,",").concat(T.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(N.x,",").concat(N.y,` A`).concat(i,",").concat(i,",0,").concat(+(R>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,"Z")}else w+="L".concat(r,",").concat(n,"Z");return w},GY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},r2=function(t){var r=bj(bj({},GY),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,h=r.className;if(o0&&Math.abs(f-d)<360?y=VY({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:d}):y=t2({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:d}),_.createElement("path",Yy({},X(r,!0),{className:p,d:y,role:"img"}))};function Lu(e){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(e)}function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;tsX.call(e,t));function eo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const cX="__v",fX="__o",dX="_owner",{getOwnPropertyDescriptor:Pj,keys:_j}=Object;function hX(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e),new Uint8Array(t))}function pX(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function mX(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function vX(e,t){return eo(e.getTime(),t.getTime())}function yX(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function gX(e,t){return e===t}function kj(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let f=!1,d=0;for(;(s=u.next())&&!s.done;){if(i[d]){d++;continue}const h=o.value,p=s.value;if(r.equals(h[0],p[0],l,d,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=i[d]=!0;break}d++}if(!f)return!1;l++}return!0}const xX=eo;function bX(e,t,r){const n=_j(e);let i=n.length;if(_j(t).length!==i)return!1;for(;i-- >0;)if(!o2(e,t,r,n[i]))return!1;return!0}function bl(e,t,r){const n=Oj(e);let i=n.length;if(Oj(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!o2(e,t,r,a)||(o=Pj(e,a),s=Pj(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function wX(e,t){return eo(e.valueOf(),t.valueOf())}function SX(e,t){return e.source===t.source&&e.flags===t.flags}function Aj(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function Nd(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function jX(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function o2(e,t,r,n){return(n===dX||n===fX||n===cX)&&(e.$$typeof||t.$$typeof)?!0:uX(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const OX="[object ArrayBuffer]",PX="[object Arguments]",_X="[object Boolean]",kX="[object DataView]",AX="[object Date]",EX="[object Error]",NX="[object Map]",TX="[object Number]",$X="[object Object]",CX="[object RegExp]",MX="[object Set]",RX="[object String]",DX={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},IX="[object URL]",LX=Object.prototype.toString;function FX({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:v}){return function(y,b,g){if(y===b)return!0;if(y==null||b==null)return!1;const x=typeof y;if(x!==typeof b)return!1;if(x!=="object")return x==="number"?s(y,b,g):x==="function"?a(y,b,g):!1;const S=y.constructor;if(S!==b.constructor)return!1;if(S===Object)return l(y,b,g);if(Array.isArray(y))return t(y,b,g);if(S===Date)return n(y,b,g);if(S===RegExp)return f(y,b,g);if(S===Map)return o(y,b,g);if(S===Set)return d(y,b,g);const w=LX.call(y);if(w===AX)return n(y,b,g);if(w===CX)return f(y,b,g);if(w===NX)return o(y,b,g);if(w===MX)return d(y,b,g);if(w===$X)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,g);if(w===IX)return p(y,b,g);if(w===EX)return i(y,b,g);if(w===PX)return l(y,b,g);if(DX[w])return h(y,b,g);if(w===OX)return e(y,b,g);if(w===kX)return r(y,b,g);if(w===_X||w===TX||w===RX)return u(y,b,g);if(v){let j=v[w];if(!j){const O=lX(y);O&&(j=v[O])}if(j)return j(y,b,g)}return!1}}function BX({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:hX,areArraysEqual:r?bl:pX,areDataViewsEqual:mX,areDatesEqual:vX,areErrorsEqual:yX,areFunctionsEqual:gX,areMapsEqual:r?Tm(kj,bl):kj,areNumbersEqual:xX,areObjectsEqual:r?bl:bX,arePrimitiveWrappersEqual:wX,areRegExpsEqual:SX,areSetsEqual:r?Tm(Aj,bl):Aj,areTypedArraysEqual:r?Tm(Nd,bl):Nd,areUrlsEqual:jX,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=nf(n.areArraysEqual),a=nf(n.areMapsEqual),o=nf(n.areObjectsEqual),s=nf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function zX(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function UX({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const qX=Zi();Zi({strict:!0});Zi({circular:!0});Zi({circular:!0,strict:!0});Zi({createInternalComparator:()=>eo});Zi({strict:!0,createInternalComparator:()=>eo});Zi({circular:!0,createInternalComparator:()=>eo});Zi({circular:!0,createInternalComparator:()=>eo,strict:!0});function Zi(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=BX(e),o=FX(a),s=r?r(o):zX(o);return UX({circular:t,comparator:o,createState:n,equals:s,strict:i})}function WX(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Ej(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):WX(i)};requestAnimationFrame(n)}function Zy(e){"@babel/helpers - typeof";return Zy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zy(e)}function HX(e){return QX(e)||GX(e)||VX(e)||KX()}function KX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VX(e,t){if(e){if(typeof e=="string")return Nj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nj(e,t)}}function Nj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:b<0?0:b},m=function(b){for(var g=b>1?1:b,x=g,S=0;S<8;++S){var w=d(x)-g,j=p(x);if(Math.abs(w-g)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(f,d,h){var p=-(f-d)*n,v=h*a,m=h+(p-v)*s/1e3,y=h*s/1e3+f;return Math.abs(y-d)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _Z(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function $m(e){return NZ(e)||EZ(e)||AZ(e)||kZ()}function kZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AZ(e,t){if(e){if(typeof e=="string")return ng(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ng(e,t)}}function EZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NZ(e){if(Array.isArray(e))return ng(e)}function ng(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cd(e){return Cd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cd(e)}var xr=function(e){RZ(r,e);var t=DZ(r);function r(n,i){var a;TZ(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,d=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(og(a)),a.changeStyle=a.changeStyle.bind(og(a)),!s||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:f}),ag(a);if(d&&d.length)a.state={style:d[0].style};else if(u){if(typeof h=="function")return a.state={style:u},ag(a);a.state={style:l?Nl({},l,u):u}}else a.state={style:{}};return a}return CZ(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,d=a.from,h=this.state.style;if(s){if(!o){var p={style:l?Nl({},l,f):f};this.state&&h&&(l&&h[l]!==f||!l&&h!==f)&&this.setState(p);return}if(!(qX(i.to,f)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=v||u?d:i.to;if(this.state&&h){var y={style:l?Nl({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(y)}this.runAnimation(zr(zr({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,f=i.begin,d=i.onAnimationEnd,h=i.onAnimationStart,p=jZ(o,s,dZ(u),l,this.changeStyle),v=function(){a.stopJSAnimation=p()};this.manager.start([h,f,v,l,d])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,d=u.duration,h=d===void 0?0:d,p=function(m,y,b){if(b===0)return m;var g=y.duration,x=y.easing,S=x===void 0?"ease":x,w=y.style,j=y.properties,O=y.onAnimationEnd,P=b>0?o[b-1]:y,A=j||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat($m(m),[a.runJSAnimation.bind(a,{from:P.style,to:w,duration:g,easing:S}),g]);var E=Cj(A,g,S),N=zr(zr(zr({},P.style),w),{},{transition:E});return[].concat($m(m),[N,g,O]).filter(eZ)};return this.manager.start([l].concat($m(o.reduce(p,[f,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=YX());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,d=i.onAnimationEnd,h=i.steps,p=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=s?Nl({},s,l):l,y=Cj(Object.keys(m),o,u);v.start([f,a,zr(zr({},m),{},{transition:y}),o,d])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=PZ(i,OZ),u=k.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var d=function(p){var v=p.props,m=v.style,y=m===void 0?{}:m,b=v.className,g=k.cloneElement(p,zr(zr({},l),{},{style:zr(zr({},y),f),className:b}));return g};return u===1?d(k.Children.only(a)):_.createElement("div",null,k.Children.map(a,function(h){return d(h)}))}}]),r}(k.PureComponent);xr.displayName="Animate";xr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};xr.propTypes={from:xe.oneOfType([xe.object,xe.string]),to:xe.oneOfType([xe.object,xe.string]),attributeName:xe.string,duration:xe.number,begin:xe.number,easing:xe.oneOfType([xe.string,xe.func]),steps:xe.arrayOf(xe.shape({duration:xe.number.isRequired,style:xe.object.isRequired,easing:xe.oneOfType([xe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),xe.func]),properties:xe.arrayOf("string"),onAnimationEnd:xe.func})),children:xe.oneOfType([xe.node,xe.func]),isActive:xe.bool,canBegin:xe.bool,onAnimationEnd:xe.func,shouldReAnimate:xe.bool,onAnimationStart:xe.func,onAnimationReStart:xe.func};function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function Md(){return Md=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var d=[0,0,0,0],h=0,p=4;ho?o:a[h];f="M".concat(t,",").concat(r+s*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+l*d[0],",").concat(r)),f+="L ".concat(t+n-l*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,"Z")}else w+="L".concat(r,",").concat(n,"Z");return w},QY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},n2=function(t){var r=wj(wj({},QY),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,h=r.className;if(o0&&Math.abs(f-d)<360?y=GY({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:d}):y=r2({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:d}),_.createElement("path",Xy({},X(r,!0),{className:p,d:y,role:"img"}))};function Lu(e){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(e)}function Zy(){return Zy=Object.assign?Object.assign.bind():function(e){for(var t=1;tlX.call(e,t));function eo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const fX="__v",dX="__o",hX="_owner",{getOwnPropertyDescriptor:_j,keys:kj}=Object;function pX(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e),new Uint8Array(t))}function mX(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function vX(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function yX(e,t){return eo(e.getTime(),t.getTime())}function gX(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function xX(e,t){return e===t}function Aj(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let f=!1,d=0;for(;(s=u.next())&&!s.done;){if(i[d]){d++;continue}const h=o.value,p=s.value;if(r.equals(h[0],p[0],l,d,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=i[d]=!0;break}d++}if(!f)return!1;l++}return!0}const bX=eo;function wX(e,t,r){const n=kj(e);let i=n.length;if(kj(t).length!==i)return!1;for(;i-- >0;)if(!s2(e,t,r,n[i]))return!1;return!0}function bl(e,t,r){const n=Pj(e);let i=n.length;if(Pj(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!s2(e,t,r,a)||(o=_j(e,a),s=_j(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function SX(e,t){return eo(e.valueOf(),t.valueOf())}function jX(e,t){return e.source===t.source&&e.flags===t.flags}function Ej(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function Nd(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function OX(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function s2(e,t,r,n){return(n===hX||n===dX||n===fX)&&(e.$$typeof||t.$$typeof)?!0:cX(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const PX="[object ArrayBuffer]",_X="[object Arguments]",kX="[object Boolean]",AX="[object DataView]",EX="[object Date]",NX="[object Error]",TX="[object Map]",$X="[object Number]",CX="[object Object]",MX="[object RegExp]",RX="[object Set]",DX="[object String]",IX={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},LX="[object URL]",FX=Object.prototype.toString;function BX({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:v}){return function(y,b,g){if(y===b)return!0;if(y==null||b==null)return!1;const x=typeof y;if(x!==typeof b)return!1;if(x!=="object")return x==="number"?s(y,b,g):x==="function"?a(y,b,g):!1;const S=y.constructor;if(S!==b.constructor)return!1;if(S===Object)return l(y,b,g);if(Array.isArray(y))return t(y,b,g);if(S===Date)return n(y,b,g);if(S===RegExp)return f(y,b,g);if(S===Map)return o(y,b,g);if(S===Set)return d(y,b,g);const w=FX.call(y);if(w===EX)return n(y,b,g);if(w===MX)return f(y,b,g);if(w===TX)return o(y,b,g);if(w===RX)return d(y,b,g);if(w===CX)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,g);if(w===LX)return p(y,b,g);if(w===NX)return i(y,b,g);if(w===_X)return l(y,b,g);if(IX[w])return h(y,b,g);if(w===PX)return e(y,b,g);if(w===AX)return r(y,b,g);if(w===kX||w===$X||w===DX)return u(y,b,g);if(v){let j=v[w];if(!j){const O=uX(y);O&&(j=v[O])}if(j)return j(y,b,g)}return!1}}function zX({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:pX,areArraysEqual:r?bl:mX,areDataViewsEqual:vX,areDatesEqual:yX,areErrorsEqual:gX,areFunctionsEqual:xX,areMapsEqual:r?Tm(Aj,bl):Aj,areNumbersEqual:bX,areObjectsEqual:r?bl:wX,arePrimitiveWrappersEqual:SX,areRegExpsEqual:jX,areSetsEqual:r?Tm(Ej,bl):Ej,areTypedArraysEqual:r?Tm(Nd,bl):Nd,areUrlsEqual:OX,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=nf(n.areArraysEqual),a=nf(n.areMapsEqual),o=nf(n.areObjectsEqual),s=nf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function UX(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function qX({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const WX=Zi();Zi({strict:!0});Zi({circular:!0});Zi({circular:!0,strict:!0});Zi({createInternalComparator:()=>eo});Zi({strict:!0,createInternalComparator:()=>eo});Zi({circular:!0,createInternalComparator:()=>eo});Zi({circular:!0,createInternalComparator:()=>eo,strict:!0});function Zi(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=zX(e),o=BX(a),s=r?r(o):UX(o);return qX({circular:t,comparator:o,createState:n,equals:s,strict:i})}function HX(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Nj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):HX(i)};requestAnimationFrame(n)}function Jy(e){"@babel/helpers - typeof";return Jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jy(e)}function KX(e){return YX(e)||QX(e)||GX(e)||VX()}function VX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GX(e,t){if(e){if(typeof e=="string")return Tj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tj(e,t)}}function Tj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:b<0?0:b},m=function(b){for(var g=b>1?1:b,x=g,S=0;S<8;++S){var w=d(x)-g,j=p(x);if(Math.abs(w-g)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(f,d,h){var p=-(f-d)*n,v=h*a,m=h+(p-v)*s/1e3,y=h*s/1e3+f;return Math.abs(y-d)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kZ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function $m(e){return TZ(e)||NZ(e)||EZ(e)||AZ()}function AZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EZ(e,t){if(e){if(typeof e=="string")return ig(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ig(e,t)}}function NZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TZ(e){if(Array.isArray(e))return ig(e)}function ig(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cd(e){return Cd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cd(e)}var xr=function(e){DZ(r,e);var t=IZ(r);function r(n,i){var a;$Z(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,d=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(sg(a)),a.changeStyle=a.changeStyle.bind(sg(a)),!s||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:f}),og(a);if(d&&d.length)a.state={style:d[0].style};else if(u){if(typeof h=="function")return a.state={style:u},og(a);a.state={style:l?Nl({},l,u):u}}else a.state={style:{}};return a}return MZ(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,d=a.from,h=this.state.style;if(s){if(!o){var p={style:l?Nl({},l,f):f};this.state&&h&&(l&&h[l]!==f||!l&&h!==f)&&this.setState(p);return}if(!(WX(i.to,f)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=v||u?d:i.to;if(this.state&&h){var y={style:l?Nl({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(y)}this.runAnimation(zr(zr({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,f=i.begin,d=i.onAnimationEnd,h=i.onAnimationStart,p=OZ(o,s,hZ(u),l,this.changeStyle),v=function(){a.stopJSAnimation=p()};this.manager.start([h,f,v,l,d])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,d=u.duration,h=d===void 0?0:d,p=function(m,y,b){if(b===0)return m;var g=y.duration,x=y.easing,S=x===void 0?"ease":x,w=y.style,j=y.properties,O=y.onAnimationEnd,P=b>0?o[b-1]:y,A=j||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat($m(m),[a.runJSAnimation.bind(a,{from:P.style,to:w,duration:g,easing:S}),g]);var E=Mj(A,g,S),N=zr(zr(zr({},P.style),w),{},{transition:E});return[].concat($m(m),[N,g,O]).filter(tZ)};return this.manager.start([l].concat($m(o.reduce(p,[f,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=XX());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,d=i.onAnimationEnd,h=i.steps,p=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=s?Nl({},s,l):l,y=Mj(Object.keys(m),o,u);v.start([f,a,zr(zr({},m),{},{transition:y}),o,d])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=_Z(i,PZ),u=k.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var d=function(p){var v=p.props,m=v.style,y=m===void 0?{}:m,b=v.className,g=k.cloneElement(p,zr(zr({},l),{},{style:zr(zr({},y),f),className:b}));return g};return u===1?d(k.Children.only(a)):_.createElement("div",null,k.Children.map(a,function(h){return d(h)}))}}]),r}(k.PureComponent);xr.displayName="Animate";xr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};xr.propTypes={from:xe.oneOfType([xe.object,xe.string]),to:xe.oneOfType([xe.object,xe.string]),attributeName:xe.string,duration:xe.number,begin:xe.number,easing:xe.oneOfType([xe.string,xe.func]),steps:xe.arrayOf(xe.shape({duration:xe.number.isRequired,style:xe.object.isRequired,easing:xe.oneOfType([xe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),xe.func]),properties:xe.arrayOf("string"),onAnimationEnd:xe.func})),children:xe.oneOfType([xe.node,xe.func]),isActive:xe.bool,canBegin:xe.bool,onAnimationEnd:xe.func,shouldReAnimate:xe.bool,onAnimationStart:xe.func,onAnimationReStart:xe.func};function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function Md(){return Md=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var d=[0,0,0,0],h=0,p=4;ho?o:a[h];f="M".concat(t,",").concat(r+s*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+l*d[0],",").concat(r)),f+="L ".concat(t+n-l*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, `).concat(t+n,",").concat(r+s*d[1])),f+="L ".concat(t+n,",").concat(r+i-s*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`, `).concat(t+n-l*d[2],",").concat(r+i)),f+="L ".concat(t+l*d[3],",").concat(r+i),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`, `).concat(t,",").concat(r+i-s*d[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var v=Math.min(o,a);f="M ".concat(t,",").concat(r+s*v,` @@ -249,22 +249,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+n,",").concat(r+i-s*v,` A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-l*v,",").concat(r+i,` L `).concat(t+l*v,",").concat(r+i,` - A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*v," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},KZ=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),d=Math.min(o,o+l),h=Math.max(o,o+l);return n>=u&&n<=f&&i>=d&&i<=h}return!1},VZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ub=function(t){var r=zj(zj({},VZ),t),n=k.useRef(),i=k.useState(-1),a=LZ(i,2),o=a[0],s=a[1];k.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,d=r.height,h=r.radius,p=r.className,v=r.animationEasing,m=r.animationDuration,y=r.animationBegin,b=r.isAnimationActive,g=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var x=oe("recharts-rectangle",p);return g?_.createElement(xr,{canBegin:o>0,from:{width:f,height:d,x:l,y:u},to:{width:f,height:d,x:l,y:u},duration:m,animationEasing:v,isActive:g},function(S){var w=S.width,j=S.height,O=S.x,P=S.y;return _.createElement(xr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:b,easing:v},_.createElement("path",Md({},X(r,!0),{className:x,d:Uj(O,P,w,j,h),ref:n})))}):_.createElement("path",Md({},X(r,!0),{className:x,d:Uj(l,u,f,d,h)}))},GZ=["points","className","baseLinePoints","connectNulls"];function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function qj(e){return eJ(e)||JZ(e)||ZZ(e)||XZ()}function XZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZZ(e,t){if(e){if(typeof e=="string")return sg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sg(e,t)}}function JZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eJ(e){if(Array.isArray(e))return sg(e)}function sg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Wj(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Wj(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Wl=function(t,r){var n=tJ(t);r&&(n=[n.reduce(function(a,o){return[].concat(qj(a),qj(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},rJ=function(t,r,n){var i=Wl(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Wl(r.reverse(),n).slice(1))},h2=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=QZ(t,GZ);if(!r||!r.length)return null;var s=oe("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=rJ(r,i,a);return _.createElement("g",{className:s},_.createElement("path",So({},X(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?_.createElement("path",So({},X(o,!0),{fill:"none",d:Wl(r,a)})):null,l?_.createElement("path",So({},X(o,!0),{fill:"none",d:Wl(i,a)})):null)}var f=Wl(r,a);return _.createElement("path",So({},X(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var cJ=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},fJ=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,d=f===void 0?0:f,h=t.height,p=h===void 0?0:h,v=t.className,m=lJ(t,nJ),y=iJ({x:n,y:a,top:s,left:u,width:d,height:p},m);return!H(n)||!H(a)||!H(d)||!H(p)||!H(s)||!H(u)?null:_.createElement("path",ug({},X(y,!0),{className:oe("recharts-cross",v),d:cJ(n,a,d,p,s,u)}))},dJ=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function qu(e){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qu(e)}function hJ(e,t){if(e==null)return{};var r=pJ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function IJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function LJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qj(e,t){for(var r=0;rZj?o=i==="outer"?"start":"end":a<-Zj?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=ia(ia({},X(this.props,!1)),{},{fill:"none"},X(s,!1));if(l==="circle")return _.createElement(Xs,fa({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,d=f.map(function(h){return ge(i,a,o,h.coordinate)});return _.createElement(h2,fa({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=X(this.props,!1),d=X(o,!1),h=ia(ia({},f),{},{fill:"none"},X(s,!1)),p=a.map(function(v,m){var y=n.getTickLineCoord(v),b=n.getTickTextAnchor(v),g=ia(ia(ia({textAnchor:b},f),{},{stroke:"none",fill:u},d),{},{index:m,payload:v,x:y.x2,y:y.y2});return _.createElement(se,fa({className:oe("recharts-polar-angle-axis-tick",ZN(o)),key:"tick-".concat(v.coordinate)},zi(n.props,v,m)),s&&_.createElement("line",fa({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&t.renderTickItem(o,g,l?l(v.value,m):v.value))});return _.createElement(se,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:_.createElement(se,{className:oe("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return _.isValidElement(n)?o=_.cloneElement(n,i):te(n)?o=n(i):o=_.createElement(Wa,fa({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(k.PureComponent);mp(Js,"displayName","PolarAngleAxis");mp(Js,"axisType","angleAxis");mp(Js,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var JJ=xE,eee=JJ(Object.getPrototypeOf,Object),tee=eee,ree=Zn,nee=tee,iee=Jn,aee="[object Object]",oee=Function.prototype,see=Object.prototype,x2=oee.toString,lee=see.hasOwnProperty,uee=x2.call(Object);function cee(e){if(!iee(e)||ree(e)!=aee)return!1;var t=nee(e);if(t===null)return!0;var r=lee.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&x2.call(r)==uee}var fee=cee;const dee=Se(fee);var hee=Zn,pee=Jn,mee="[object Boolean]";function vee(e){return e===!0||e===!1||pee(e)&&hee(e)==mee}var yee=vee;const gee=Se(yee);function Hu(e){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(e)}function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:f,lowerWidth:d,height:h,x:l,y:u},duration:m,animationEasing:v,isActive:b},function(x){var S=x.upperWidth,w=x.lowerWidth,j=x.height,O=x.x,P=x.y;return _.createElement(xr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:v},_.createElement("path",Id({},X(r,!0),{className:g,d:rO(O,P,S,w,j),ref:n})))}):_.createElement("g",null,_.createElement("path",Id({},X(r,!0),{className:g,d:rO(l,u,f,d,h)})))},Eee=["option","shapeType","propTransformer","activeClassName","isActive"];function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function Nee(e,t){if(e==null)return{};var r=Tee(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ld(e){for(var t=1;t0?mr(x,"paddingAngle",0):0;if(w){var O=ke(w.endAngle-w.startAngle,x.endAngle-x.startAngle),P=Ne(Ne({},x),{},{startAngle:g+j,endAngle:g+O(m)+j});y.push(P),g=P.endAngle}else{var A=x.endAngle,E=x.startAngle,N=ke(0,A-E),T=N(m),M=Ne(Ne({},x),{},{startAngle:g+j,endAngle:g+T+j});y.push(M),g=M.endAngle}}),_.createElement(se,null,n.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Gn(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,f=i.cy,d=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,v=this.state.isAnimationFinished;if(a||!o||!o.length||!H(u)||!H(f)||!H(d)||!H(h))return null;var m=oe("recharts-pie",s);return _.createElement(se,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){n.pieRef=b}},this.renderSectors(),l&&this.renderLabels(o),bt.renderCallByParent(this.props,null,!1),(!p||v)&&Mr.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),d=Math.min(o,o+l),h=Math.max(o,o+l);return n>=u&&n<=f&&i>=d&&i<=h}return!1},GZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qb=function(t){var r=Uj(Uj({},GZ),t),n=k.useRef(),i=k.useState(-1),a=FZ(i,2),o=a[0],s=a[1];k.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,d=r.height,h=r.radius,p=r.className,v=r.animationEasing,m=r.animationDuration,y=r.animationBegin,b=r.isAnimationActive,g=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var x=oe("recharts-rectangle",p);return g?_.createElement(xr,{canBegin:o>0,from:{width:f,height:d,x:l,y:u},to:{width:f,height:d,x:l,y:u},duration:m,animationEasing:v,isActive:g},function(S){var w=S.width,j=S.height,O=S.x,P=S.y;return _.createElement(xr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:b,easing:v},_.createElement("path",Md({},X(r,!0),{className:x,d:qj(O,P,w,j,h),ref:n})))}):_.createElement("path",Md({},X(r,!0),{className:x,d:qj(l,u,f,d,h)}))},QZ=["points","className","baseLinePoints","connectNulls"];function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Wj(e){return tJ(e)||eJ(e)||JZ(e)||ZZ()}function ZZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JZ(e,t){if(e){if(typeof e=="string")return lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lg(e,t)}}function eJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tJ(e){if(Array.isArray(e))return lg(e)}function lg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Hj(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Hj(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Wl=function(t,r){var n=rJ(t);r&&(n=[n.reduce(function(a,o){return[].concat(Wj(a),Wj(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},nJ=function(t,r,n){var i=Wl(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Wl(r.reverse(),n).slice(1))},p2=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=YZ(t,QZ);if(!r||!r.length)return null;var s=oe("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=nJ(r,i,a);return _.createElement("g",{className:s},_.createElement("path",So({},X(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?_.createElement("path",So({},X(o,!0),{fill:"none",d:Wl(r,a)})):null,l?_.createElement("path",So({},X(o,!0),{fill:"none",d:Wl(i,a)})):null)}var f=Wl(r,a);return _.createElement("path",So({},X(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var fJ=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},dJ=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,d=f===void 0?0:f,h=t.height,p=h===void 0?0:h,v=t.className,m=uJ(t,iJ),y=aJ({x:n,y:a,top:s,left:u,width:d,height:p},m);return!H(n)||!H(a)||!H(d)||!H(p)||!H(s)||!H(u)?null:_.createElement("path",cg({},X(y,!0),{className:oe("recharts-cross",v),d:fJ(n,a,d,p,s,u)}))},hJ=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function qu(e){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qu(e)}function pJ(e,t){if(e==null)return{};var r=mJ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function FJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yj(e,t){for(var r=0;rJj?o=i==="outer"?"start":"end":a<-Jj?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=ia(ia({},X(this.props,!1)),{},{fill:"none"},X(s,!1));if(l==="circle")return _.createElement(Xs,fa({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,d=f.map(function(h){return ge(i,a,o,h.coordinate)});return _.createElement(p2,fa({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=X(this.props,!1),d=X(o,!1),h=ia(ia({},f),{},{fill:"none"},X(s,!1)),p=a.map(function(v,m){var y=n.getTickLineCoord(v),b=n.getTickTextAnchor(v),g=ia(ia(ia({textAnchor:b},f),{},{stroke:"none",fill:u},d),{},{index:m,payload:v,x:y.x2,y:y.y2});return _.createElement(se,fa({className:oe("recharts-polar-angle-axis-tick",JN(o)),key:"tick-".concat(v.coordinate)},zi(n.props,v,m)),s&&_.createElement("line",fa({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&t.renderTickItem(o,g,l?l(v.value,m):v.value))});return _.createElement(se,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:_.createElement(se,{className:oe("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return _.isValidElement(n)?o=_.cloneElement(n,i):te(n)?o=n(i):o=_.createElement(Wa,fa({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(k.PureComponent);mp(Js,"displayName","PolarAngleAxis");mp(Js,"axisType","angleAxis");mp(Js,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var eee=bE,tee=eee(Object.getPrototypeOf,Object),ree=tee,nee=Zn,iee=ree,aee=Jn,oee="[object Object]",see=Function.prototype,lee=Object.prototype,b2=see.toString,uee=lee.hasOwnProperty,cee=b2.call(Object);function fee(e){if(!aee(e)||nee(e)!=oee)return!1;var t=iee(e);if(t===null)return!0;var r=uee.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&b2.call(r)==cee}var dee=fee;const hee=Se(dee);var pee=Zn,mee=Jn,vee="[object Boolean]";function yee(e){return e===!0||e===!1||mee(e)&&pee(e)==vee}var gee=yee;const xee=Se(gee);function Hu(e){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(e)}function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:f,lowerWidth:d,height:h,x:l,y:u},duration:m,animationEasing:v,isActive:b},function(x){var S=x.upperWidth,w=x.lowerWidth,j=x.height,O=x.x,P=x.y;return _.createElement(xr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:v},_.createElement("path",Id({},X(r,!0),{className:g,d:nO(O,P,S,w,j),ref:n})))}):_.createElement("g",null,_.createElement("path",Id({},X(r,!0),{className:g,d:nO(l,u,f,d,h)})))},Nee=["option","shapeType","propTransformer","activeClassName","isActive"];function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function Tee(e,t){if(e==null)return{};var r=$ee(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $ee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ld(e){for(var t=1;t0?mr(x,"paddingAngle",0):0;if(w){var O=ke(w.endAngle-w.startAngle,x.endAngle-x.startAngle),P=Ne(Ne({},x),{},{startAngle:g+j,endAngle:g+O(m)+j});y.push(P),g=P.endAngle}else{var A=x.endAngle,E=x.startAngle,N=ke(0,A-E),T=N(m),M=Ne(Ne({},x),{},{startAngle:g+j,endAngle:g+T+j});y.push(M),g=M.endAngle}}),_.createElement(se,null,n.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Gn(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,f=i.cy,d=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,v=this.state.isAnimationFinished;if(a||!o||!o.length||!H(u)||!H(f)||!H(d)||!H(h))return null;var m=oe("recharts-pie",s);return _.createElement(se,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){n.pieRef=b}},this.renderSectors(),l&&this.renderLabels(o),bt.renderCallByParent(this.props,null,!1),(!p||v)&&Mr.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?g:g-1)*l,S=y-g*p-x,w=i.reduce(function(P,A){var E=Ae(A,b,0);return P+(H(E)?E:0)},0),j;if(w>0){var O;j=i.map(function(P,A){var E=Ae(P,b,0),N=Ae(P,f,A),T=(H(E)?E:0)/w,M;A?M=O.endAngle+Bt(m)*l*(E!==0?1:0):M=o;var R=M+Bt(m)*((E!==0?p:0)+T*S),D=(M+R)/2,L=(v.innerRadius+v.outerRadius)/2,z=[{name:N,value:E,payload:P,dataKey:b,type:h}],C=ge(v.cx,v.cy,L,D);return O=Ne(Ne(Ne({percent:T,cornerRadius:a,name:N,tooltipPayload:z,midAngle:D,middleRadius:L,tooltipPosition:C},P),v),{},{value:Ae(P,b),startAngle:M,endAngle:R,payload:P,paddingAngle:Bt(m)*l}),O})}return Ne(Ne({},v),{},{sectors:j,data:i})});function Zee(e){return e&&e.length?e[0]:void 0}var Jee=Zee,ete=Jee;const tte=Se(ete);var rte=["key"];function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}function nte(e,t){if(e==null)return{};var r=ite(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ite(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zd(){return zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=2&&(l=!0),u.push(Lt(Lt({},ge(o,s,g,y)),{},{name:v,value:m,cx:o,cy:s,radius:g,angle:y,payload:h}))});var d=[];return l&&u.forEach(function(h){if(Array.isArray(h.value)){var p=tte(h.value),v=re(p)?void 0:t.scale(p);d.push(Lt(Lt({},h),{},{radius:v},ge(o,s,v,h.angle)))}else d.push(h)}),{points:u,isRange:l,baseLinePoints:d}});var dte=Math.ceil,hte=Math.max;function pte(e,t,r,n){for(var i=-1,a=hte(dte((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var mte=pte,vte=LE,uO=1/0,yte=17976931348623157e292;function gte(e){if(!e)return e===0?e:0;if(e=vte(e),e===uO||e===-uO){var t=e<0?-1:1;return t*yte}return e===e?e:0}var O2=gte,xte=mte,bte=np,Cm=O2;function wte(e){return function(t,r,n){return n&&typeof n!="number"&&bte(t,r,n)&&(r=n=void 0),t=Cm(t),r===void 0?(r=t,t=0):r=Cm(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),ur(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),ur(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),ur(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),ur(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),ur(n,"handleSlideDragStart",function(i){var a=pO(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Rte(t,e),Tte(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,d=Math.min(i,a),h=Math.max(i,a),p=t.getIndexInRange(o,d),v=t.getIndexInRange(o,h);return{startIndex:p-p%l,endIndex:v===f?f:v-v%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=Ae(a[n],s,n);return te(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,f=l.width,d=l.travellerWidth,h=l.startIndex,p=l.endIndex,v=l.onChange,m=n.pageX-a;m>0?m=Math.min(m,u+f-d-s,u+f-d-o):m<0&&(m=Math.max(m,u-o,u-s));var y=this.getIndex({startX:o+m,endX:s+m});(y.startIndex!==h||y.endIndex!==p)&&v&&v(y),this.setState({startX:o+m,endX:s+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=pO(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],f=this.props,d=f.x,h=f.width,p=f.travellerWidth,v=f.onChange,m=f.gap,y=f.data,b={startX:this.state.startX,endX:this.state.endX},g=n.pageX-a;g>0?g=Math.min(g,d+h-p-u):g<0&&(g=Math.max(g,d-u)),b[o]=u+g;var x=this.getIndex(b),S=x.startIndex,w=x.endIndex,j=function(){var P=y.length-1;return o==="startX"&&(s>l?S%m===0:w%m===0)||sl?w%m===0:S%m===0)||s>l&&w===P};this.setState(ur(ur({},o,u+g),"brushMoveStartX",n.pageX),function(){v&&j()&&v(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],d=s.indexOf(f);if(d!==-1){var h=d+n;if(!(h===-1||h>=s.length)){var p=s[h];i==="startX"&&p>=u||i==="endX"&&p<=l||this.setState(ur({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return _.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,d=k.Children.only(u);return d?_.cloneElement(d,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,d=l.height,h=l.traveller,p=l.ariaLabel,v=l.data,m=l.startIndex,y=l.endIndex,b=Math.max(n,this.props.x),g=Mm(Mm({},X(this.props,!1)),{},{x:b,y:u,width:f,height:d}),x=p||"Min value: ".concat((a=v[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[y])===null||o===void 0?void 0:o.name);return _.createElement(se,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,g))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,d=Math.max(Math.abs(i-n)-u,0);return _.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:d,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,h=f.endX,p=5,v={pointerEvents:"none",fill:u};return _.createElement(se,{className:"recharts-brush-texts"},_.createElement(Wa,Wd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,h)-p,y:o+s/2},v),this.getTextOfTick(i)),_.createElement(Wa,Wd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,h)+l+p,y:o+s/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,d=n.alwaysShowText,h=this.state,p=h.startX,v=h.endX,m=h.isTextActive,y=h.isSlideMoving,b=h.isTravellerMoving,g=h.isTravellerFocused;if(!i||!i.length||!H(s)||!H(l)||!H(u)||!H(f)||u<=0||f<=0)return null;var x=oe("recharts-brush",a),S=_.Children.count(o)===1,w=Ete("userSelect","none");return _.createElement(se,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,v),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(v,"endX"),(m||y||b||g||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return _.createElement(_.Fragment,null,_.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),_.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),_.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return _.isValidElement(n)?a=_.cloneElement(n,i):te(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Mm({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?Ite({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(k.PureComponent);ur(ys,"displayName","Brush");ur(ys,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Lte=pb;function Fte(e,t){var r;return Lte(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var Bte=Fte,zte=fE,Ute=jn,qte=Bte,Wte=sr,Hte=np;function Kte(e,t,r){var n=Wte(e)?zte:qte;return r&&Hte(e,t,r)&&(t=void 0),n(e,Ute(t))}var Vte=Kte;const Gte=Se(Vte);var gn=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},mO=CE;function Qte(e,t,r){t=="__proto__"&&mO?mO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Yte=Qte,Xte=Yte,Zte=TE,Jte=jn;function ere(e,t){var r={};return t=Jte(t),Zte(e,function(n,i,a){Xte(r,i,t(n,i,a))}),r}var tre=ere;const rre=Se(tre);function nre(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wre(e,t){var r=e.x,n=e.y,i=xre(e,mre),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),d="".concat(t.width||i.width),h=parseInt(d,10);return wl(wl(wl(wl(wl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function yO(e){return _.createElement(Fd,mg({shapeType:"rectangle",propTransformer:wre,activeClassName:"recharts-active-bar"},e))}var Sre=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=H(n)||wF(n);return a?t(n,i):(a||Ka(),r)}},jre=["value","background"],E2;function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function Ore(e,t){if(e==null)return{};var r=Pre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(D)0&&Math.abs(R)0&&(M=Math.min((ce||0)-(R[V-1]||0),M))}),Number.isFinite(M)){var D=M/T,L=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(O=D*L/2),m.padding==="no-gap"){var z=zt(t.barCategoryGap,D*L),C=D*L/2;O=C-z-(C-z)/L*z}}}i==="xAxis"?P=[n.left+(x.left||0)+(O||0),n.left+n.width-(x.right||0)-(O||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(O||0),n.top+n.height-(x.bottom||0)-(O||0)]:P=m.range,w&&(P=[P[1],P[0]]);var B=WN(m,a,h),U=B.scale,G=B.realScaleType;U.domain(b).range(P),HN(U);var q=KN(U,Gr(Gr({},m),{},{realScaleType:G}));i==="xAxis"?(N=y==="top"&&!S||y==="bottom"&&S,A=n.left,E=d[j]-N*m.height):i==="yAxis"&&(N=y==="left"&&!S||y==="right"&&S,A=d[j]-N*m.width,E=n.top);var ee=Gr(Gr(Gr({},m),q),{},{realScaleType:G,x:A,y:E,scale:U,width:i==="xAxis"?n.width:m.width,height:i==="yAxis"?n.height:m.height});return ee.bandSize=kd(ee,q),!m.hide&&i==="xAxis"?d[j]+=(N?-1:1)*ee.height:m.hide||(d[j]+=(N?-1:1)*ee.width),Gr(Gr({},p),{},gp({},v,ee))},{})},C2=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},Dre=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return C2({x:r,y:n},{x:i,y:a})},M2=function(){function e(t){Cre(this,e),this.scale=t}return Mre(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();gp(M2,"EPS",1e-4);var qb=function(t){var r=Object.keys(t).reduce(function(n,i){return Gr(Gr({},n),{},gp({},i,M2.create(t[i])))},{});return Gr(Gr({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return rre(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return A2(i,function(a,o){return r[o].isInRange(a)})}})};function Ire(e){return(e%180+180)%180}var Lre=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Ire(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?i[a?t[o]:o]:void 0}}var qre=Ure,Wre=O2;function Hre(e){var t=Wre(e),r=t%1;return t===t?r?t-r:t:0}var Kre=Hre,Vre=PE,Gre=jn,Qre=Kre,Yre=Math.max;function Xre(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:Qre(r);return i<0&&(i=Yre(n+i,0)),Vre(e,Gre(t),i)}var Zre=Xre,Jre=qre,ene=Zre,tne=Jre(ene),rne=tne;const nne=Se(rne);var ine=k4(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Wb=k.createContext(void 0),Hb=k.createContext(void 0),R2=k.createContext(void 0),D2=k.createContext({}),I2=k.createContext(void 0),L2=k.createContext(0),F2=k.createContext(0),SO=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,f=ine(a);return _.createElement(Wb.Provider,{value:n},_.createElement(Hb.Provider,{value:i},_.createElement(D2.Provider,{value:a},_.createElement(R2.Provider,{value:f},_.createElement(I2.Provider,{value:o},_.createElement(L2.Provider,{value:u},_.createElement(F2.Provider,{value:l},s)))))))},ane=function(){return k.useContext(I2)},B2=function(t){var r=k.useContext(Wb);r==null&&Ka();var n=r[t];return n==null&&Ka(),n},one=function(){var t=k.useContext(Wb);return di(t)},sne=function(){var t=k.useContext(Hb),r=nne(t,function(n){return A2(n.domain,Number.isFinite)});return r||di(t)},z2=function(t){var r=k.useContext(Hb);r==null&&Ka();var n=r[t];return n==null&&Ka(),n},lne=function(){var t=k.useContext(R2);return t},une=function(){return k.useContext(D2)},Kb=function(){return k.useContext(F2)},Vb=function(){return k.useContext(L2)};function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function cne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fne(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function Kne(e,t){return G2(e,t+1)}function Vne(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,d=function(){var v=n==null?void 0:n[l];if(v===void 0)return{v:G2(n,u)};var m=l,y,b=function(){return y===void 0&&(y=r(v,m)),y},g=v.coordinate,x=l===0||Xd(e,g,b,f,s);x||(l=0,f=o,u+=1),x&&(f=g+e*(b()/2+i),l+=u)},h;u<=a.length;)if(h=d(),h)return h.v;return[]}function Xu(e){"@babel/helpers - typeof";return Xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xu(e)}function NO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t0?p.coordinate-y*e:p.coordinate})}else a[h]=p=Tt(Tt({},p),{},{tickCoord:p.coordinate});var b=Xd(e,p.tickCoord,m,s,l);b&&(l=p.tickCoord-e*(m()/2+i),a[h]=Tt(Tt({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function Zne(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],d=r(f,s-1),h=e*(f.coordinate+e*d/2-u);o[s-1]=f=Tt(Tt({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=Xd(e,f.tickCoord,function(){return d},l,u);p&&(u=f.tickCoord-e*(d/2+i),o[s-1]=Tt(Tt({},f),{},{isShow:!0}))}for(var v=a?s-1:s,m=function(g){var x=o[g],S,w=function(){return S===void 0&&(S=r(x,g)),S};if(g===0){var j=e*(x.coordinate-e*w()/2-l);o[g]=x=Tt(Tt({},x),{},{tickCoord:j<0?x.coordinate-j*e:x.coordinate})}else o[g]=x=Tt(Tt({},x),{},{tickCoord:x.coordinate});var O=Xd(e,x.tickCoord,w,l,u);O&&(l=x.tickCoord+e*(w()/2+i),o[g]=Tt(Tt({},x),{},{isShow:!0}))},y=0;y=2?Bt(i[1].coordinate-i[0].coordinate):1,b=Hne(a,y,p);return l==="equidistantPreserveStart"?Vne(y,b,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=Zne(y,b,m,i,o,l==="preserveStartEnd"):h=Xne(y,b,m,i,o),h.filter(function(g){return g.isShow}))}var Jne=["viewBox"],eie=["viewBox"],tie=["ticks"];function Ss(e){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(e)}function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $O(e,t){for(var r=0;r0?l(this.props):l(p)),o<=0||s<=0||!v||!v.length?null:_.createElement(se,{className:oe("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),bt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=oe(i.className,"recharts-cartesian-axis-tick-value");return _.isValidElement(n)?o=_.cloneElement(n,ut(ut({},i),{},{className:s})):te(n)?o=n(ut(ut({},i),{},{className:s})):o=_.createElement(Wa,Oo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(k.Component);Xb(el,"displayName","CartesianAxis");Xb(el,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var cie=["x1","y1","x2","y2","key"],fie=["offset"];function Va(e){"@babel/helpers - typeof";return Va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Va(e)}function CO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var vie=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,l=t.ry;return _.createElement("rect",{x:i,y:a,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function X2(e,t){var r;if(_.isValidElement(e))r=_.cloneElement(e,t);else if(te(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,l=MO(t,cie),u=X(l,!1);u.offset;var f=MO(u,fie);r=_.createElement("line",ba({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function yie(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var u=Ct(Ct({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return X2(i,u)});return _.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function gie(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var u=Ct(Ct({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return X2(i,u)});return _.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function xie(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var f=s.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var v=!f[p+1],m=v?i+o-h:f[p+1]-h;if(m<=0)return null;var y=p%t.length;return _.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:m,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return _.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function bie(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var v=!f[p+1],m=v?a+s-h:f[p+1]-h;if(m<=0)return null;var y=p%n.length;return _.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:l,stroke:"none",fill:n[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return _.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var wie=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return qN(Yb(Ct(Ct(Ct({},el.defaultProps),n),{},{ticks:In(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},Sie=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return qN(Yb(Ct(Ct(Ct({},el.defaultProps),n),{},{ticks:In(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},ao={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ht(e){var t,r,n,i,a,o,s=Kb(),l=Vb(),u=une(),f=Ct(Ct({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:ao.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:ao.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:ao.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:ao.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:ao.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:ao.verticalFill,x:H(e.x)?e.x:u.left,y:H(e.y)?e.y:u.top,width:H(e.width)?e.width:u.width,height:H(e.height)?e.height:u.height}),d=f.x,h=f.y,p=f.width,v=f.height,m=f.syncWithTicks,y=f.horizontalValues,b=f.verticalValues,g=one(),x=sne();if(!H(p)||p<=0||!H(v)||v<=0||!H(d)||d!==+d||!H(h)||h!==+h)return null;var S=f.verticalCoordinatesGenerator||wie,w=f.horizontalCoordinatesGenerator||Sie,j=f.horizontalPoints,O=f.verticalPoints;if((!j||!j.length)&&te(w)){var P=y&&y.length,A=w({yAxis:x?Ct(Ct({},x),{},{ticks:P?y:x.ticks}):void 0,width:s,height:l,offset:u},P?!0:m);en(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Va(A),"]")),Array.isArray(A)&&(j=A)}if((!O||!O.length)&&te(S)){var E=b&&b.length,N=S({xAxis:g?Ct(Ct({},g),{},{ticks:E?b:g.ticks}):void 0,width:s,height:l,offset:u},E?!0:m);en(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Va(N),"]")),Array.isArray(N)&&(O=N)}return _.createElement("g",{className:"recharts-cartesian-grid"},_.createElement(vie,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),_.createElement(yie,ba({},f,{offset:u,horizontalPoints:j,xAxis:g,yAxis:x})),_.createElement(gie,ba({},f,{offset:u,verticalPoints:O,xAxis:g,yAxis:x})),_.createElement(xie,ba({},f,{horizontalPoints:j})),_.createElement(bie,ba({},f,{verticalPoints:O})))}Ht.displayName="CartesianGrid";var jie=["type","layout","connectNulls","ref"],Oie=["key"];function js(e){"@babel/helpers - typeof";return js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},js(e)}function RO(e,t){if(e==null)return{};var r=Pie(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rd){p=[].concat(oo(l.slice(0,v)),[d-m]);break}var y=p.length%2===0?[0,h]:[h];return[].concat(oo(t.repeat(l,f)),oo(p),y).map(function(b){return"".concat(b,"px")}).join(", ")}),Qr(r,"id",Qi("recharts-line-")),Qr(r,"pathRef",function(o){r.mainCurve=o}),Qr(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Qr(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Rie(t,e),Tie(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,f=a.children,d=Wt(f,Ys);if(!d)return null;var h=function(m,y){return{x:m.x,y:m.y,value:m.value,errorVal:Ae(m.payload,y)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return _.createElement(se,p,d.map(function(v){return _.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,d=X(this.props,!1),h=X(l,!0),p=u.map(function(m,y){var b=lr(lr(lr({key:"dot-".concat(y),r:3},d),h),{},{index:y,cx:m.x,cy:m.y,value:m.value,dataKey:f,payload:m.payload,points:u});return t.renderDotItem(l,b)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return _.createElement(se,Kl({className:"recharts-line-dots",key:"dots"},v),p)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,f=s.connectNulls;s.ref;var d=RO(s,jie),h=lr(lr(lr({},X(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:f});return _.createElement(Li,Kl({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,h=o.animationEasing,p=o.animationId,v=o.animateNewValues,m=o.width,y=o.height,b=this.state,g=b.prevPoints,x=b.totalLength;return _.createElement(xr,{begin:f,duration:d,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(g){var j=g.length/s.length,O=s.map(function(T,M){var R=Math.floor(M*j);if(g[R]){var D=g[R],L=ke(D.x,T.x),z=ke(D.y,T.y);return lr(lr({},T),{},{x:L(w),y:z(w)})}if(v){var C=ke(m*2,T.x),B=ke(y/2,T.y);return lr(lr({},T),{},{x:C(w),y:B(w)})}return lr(lr({},T),{},{x:T.x,y:T.y})});return a.renderCurveStatically(O,n,i)}var P=ke(0,x),A=P(w),E;if(l){var N="".concat(l).split(/[,\s]+/gim).map(function(T){return parseFloat(T)});E=a.getStrokeDasharray(A,x,N)}else E=a.generateSimpleStrokeDasharray(x,A);return a.renderCurveStatically(s,n,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,f=l.totalLength;return s&&o&&o.length&&(!u&&f>0||!Gn(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.xAxis,f=i.yAxis,d=i.top,h=i.left,p=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,g=s.length===1,x=oe("recharts-line",l),S=u&&u.allowDataOverflow,w=f&&f.allowDataOverflow,j=S||w,O=re(y)?this.id:y,P=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=P.r,E=A===void 0?3:A,N=P.strokeWidth,T=N===void 0?2:N,M=DA(o)?o:{},R=M.clipDot,D=R===void 0?!0:R,L=E*2+T;return _.createElement(se,{className:x},S||w?_.createElement("defs",null,_.createElement("clipPath",{id:"clipPath-".concat(O)},_.createElement("rect",{x:S?h:h-p/2,y:w?d:d-v/2,width:S?p:p*2,height:w?v:v*2})),!D&&_.createElement("clipPath",{id:"clipPath-dots-".concat(O)},_.createElement("rect",{x:h-L/2,y:d-L/2,width:p+L,height:v+L}))):null,!g&&this.renderCurve(j,O),this.renderErrorBar(j,O),(g||o)&&this.renderDots(j,D,O),(!m||b)&&Mr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(oo(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Gn(f,o)||!Gn(d,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,f=i.left,d=i.xAxis,h=i.yAxis,p=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,g=s.length===1,x=oe("recharts-area",l),S=d&&d.allowDataOverflow,w=h&&h.allowDataOverflow,j=S||w,O=re(y)?this.id:y,P=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=P.r,E=A===void 0?3:A,N=P.strokeWidth,T=N===void 0?2:N,M=DA(o)?o:{},R=M.clipDot,D=R===void 0?!0:R,L=E*2+T;return _.createElement(se,{className:x},S||w?_.createElement("defs",null,_.createElement("clipPath",{id:"clipPath-".concat(O)},_.createElement("rect",{x:S?f:f-p/2,y:w?u:u-v/2,width:S?p:p*2,height:w?v:v*2})),!D&&_.createElement("clipPath",{id:"clipPath-dots-".concat(O)},_.createElement("rect",{x:f-L/2,y:u-L/2,width:p+L,height:v+L}))):null,g?null:this.renderArea(j,O),(o||g)&&this.renderDots(j,D,O),(!m||b)&&Mr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(k.PureComponent);eT=wn;pn(wn,"displayName","Area");pn(wn,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!On.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});pn(wn,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(H(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return s==="dataMin"?d:s==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});pn(wn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=t.layout,v=u&&u.length,m=eT.getBaseValue(t,r,n,i),y=p==="horizontal",b=!1,g=d.map(function(S,w){var j;v?j=u[f+w]:(j=Ae(S,l),Array.isArray(j)?b=!0:j=[m,j]);var O=j[1]==null||v&&Ae(S,l)==null;return y?{x:cs({axis:n,ticks:a,bandSize:s,entry:S,index:w}),y:O?null:i.scale(j[1]),value:j,payload:S}:{x:O?null:n.scale(j[1]),y:cs({axis:i,ticks:o,bandSize:s,entry:S,index:w}),value:j,payload:S}}),x;return v||b?x=g.map(function(S){var w=Array.isArray(S.value)?S.value[0]:null;return y?{x:S.x,y:w!=null&&S.y!=null?i.scale(w):null}:{x:w!=null?n.scale(w):null,y:S.y}}):x=y?i.scale(m):n.scale(m),oi({points:g,baseLine:x,layout:p,isRange:b},h)});pn(wn,"renderDotItem",function(e,t){var r;if(_.isValidElement(e))r=_.cloneElement(e,t);else if(te(e))r=e(t);else{var n=oe("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=tT(t,Lie);r=_.createElement(Xs,wa({},a,{key:i,className:n}))}return r});function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function Vie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gie(e,t){for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iae(e){var t=e.option,r=e.isActive,n=rae(e,tae);return typeof t=="string"?k.createElement(Fd,Vl({option:k.createElement(ep,Vl({type:t},n)),isActive:r,shapeType:"symbols"},n)):k.createElement(Fd,Vl({option:t,isActive:r,shapeType:"symbols"},n))}function _s(e){"@babel/helpers - typeof";return _s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(e)}function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Jae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function eoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function toe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&H(i)&&H(a)?t.slice(i,a+1):[]};function ST(e){return e==="number"?[0,"auto"]:void 0}var Ig=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Pp(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=d===void 0?s:d;h=Zf(p,o.dataKey,i)}else h=d&&d[n]||s[n];return h?[].concat(Ns(l),[GN(u,h)]):l},[])},VO=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=hoe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=MQ(o,s,u,l);if(f>=0&&u){var d=u[f]&&u[f].value,h=Ig(t,r,f,d),p=poe(n,s,f,a);return{activeTooltipIndex:f,activeLabel:d,activePayload:h,activeCoordinate:p}}return null},moe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=t.stackOffset,p=UN(f,a);return n.reduce(function(v,m){var y,b=m.type.defaultProps!==void 0?F(F({},m.type.defaultProps),m.props):m.props,g=b.type,x=b.dataKey,S=b.allowDataOverflow,w=b.allowDuplicatedCategory,j=b.scale,O=b.ticks,P=b.includeHidden,A=b[o];if(v[A])return v;var E=Pp(t.data,{graphicalItems:i.filter(function(q){var ee,ce=o in q.props?q.props[o]:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee[o];return ce===A}),dataStartIndex:l,dataEndIndex:u}),N=E.length,T,M,R;zae(b.domain,S,g)&&(T=Vy(b.domain,null,S),p&&(g==="number"||j!=="auto")&&(R=Ul(E,x,"category")));var D=ST(g);if(!T||T.length===0){var L,z=(L=b.domain)!==null&&L!==void 0?L:D;if(x){if(T=Ul(E,x,g),g==="category"&&p){var C=jF(T);w&&C?(M=T,T=qd(0,N)):w||(T=fj(z,T,m).reduce(function(q,ee){return q.indexOf(ee)>=0?q:[].concat(Ns(q),[ee])},[]))}else if(g==="category")w?T=T.filter(function(q){return q!==""&&!re(q)}):T=fj(z,T,m).reduce(function(q,ee){return q.indexOf(ee)>=0||ee===""||re(ee)?q:[].concat(Ns(q),[ee])},[]);else if(g==="number"){var B=FQ(E,i.filter(function(q){var ee,ce,V=o in q.props?q.props[o]:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee[o],ie="hide"in q.props?q.props.hide:(ce=q.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return V===A&&(P||!ie)}),x,a,f);B&&(T=B)}p&&(g==="number"||j!=="auto")&&(R=Ul(E,x,"category"))}else p?T=qd(0,N):s&&s[A]&&s[A].hasStack&&g==="number"?T=h==="expand"?[0,1]:VN(s[A].stackGroups,l,u):T=zN(E,i.filter(function(q){var ee=o in q.props?q.props[o]:q.type.defaultProps[o],ce="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return ee===A&&(P||!ce)}),g,f,!0);if(g==="number")T=Mg(d,T,A,a,O),z&&(T=Vy(z,T,S));else if(g==="category"&&z){var U=z,G=T.every(function(q){return U.indexOf(q)>=0});G&&(T=U)}}return F(F({},v),{},ae({},A,F(F({},b),{},{axisType:a,domain:T,categoricalDomain:R,duplicateDomain:M,originalDomain:(y=b.domain)!==null&&y!==void 0?y:D,isCategorical:p,layout:f})))},{})},voe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=Pp(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),p=h.length,v=UN(f,a),m=-1;return n.reduce(function(y,b){var g=b.type.defaultProps!==void 0?F(F({},b.type.defaultProps),b.props):b.props,x=g[o],S=ST("number");if(!y[x]){m++;var w;return v?w=qd(0,p):s&&s[x]&&s[x].hasStack?(w=VN(s[x].stackGroups,l,u),w=Mg(d,w,x,a)):(w=Vy(S,zN(h,n.filter(function(j){var O,P,A=o in j.props?j.props[o]:(O=j.type.defaultProps)===null||O===void 0?void 0:O[o],E="hide"in j.props?j.props.hide:(P=j.type.defaultProps)===null||P===void 0?void 0:P.hide;return A===x&&!E}),"number",f),i.defaultProps.allowDataOverflow),w=Mg(d,w,x,a)),F(F({},y),{},ae({},x,F(F({axisType:a},i.defaultProps),{},{hide:!0,orientation:mr(foe,"".concat(a,".").concat(m%2),null),domain:w,originalDomain:S,isCategorical:v,layout:f})))}return y},{})},yoe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(i,"Id"),h=Wt(f,a),p={};return h&&h.length?p=moe(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(p=voe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),p},goe=function(t){var r=di(t),n=In(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:mb(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:kd(r,n)}},GO=function(t){var r=t.children,n=t.defaultShowTooltip,i=fr(r,ys),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},xoe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Fn(r&&r.type);return n&&n.indexOf("Bar")>=0})},QO=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},boe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,d=n.children,h=n.margin||{},p=fr(d,ys),v=fr(d,ar),m=Object.keys(l).reduce(function(w,j){var O=l[j],P=O.orientation;return!O.mirror&&!O.hide?F(F({},w),{},ae({},P,w[P]+O.width)):w},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(w,j){var O=o[j],P=O.orientation;return!O.mirror&&!O.hide?F(F({},w),{},ae({},P,mr(w,"".concat(P))+O.height)):w},{top:h.top||0,bottom:h.bottom||0}),b=F(F({},y),m),g=b.bottom;p&&(b.bottom+=p.props.height||ys.defaultProps.height),v&&r&&(b=IQ(b,i,n,r));var x=u-b.left-b.right,S=f-b.top-b.bottom;return F(F({brushBottom:g},b),{},{width:Math.max(x,0),height:Math.max(S,0)})},woe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},rl=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,h=function(b,g){var x=g.graphicalItems,S=g.stackGroups,w=g.offset,j=g.updateId,O=g.dataStartIndex,P=g.dataEndIndex,A=b.barSize,E=b.layout,N=b.barGap,T=b.barCategoryGap,M=b.maxBarSize,R=QO(E),D=R.numericAxisName,L=R.cateAxisName,z=xoe(x),C=[];return x.forEach(function(B,U){var G=Pp(b.data,{graphicalItems:[B],dataStartIndex:O,dataEndIndex:P}),q=B.type.defaultProps!==void 0?F(F({},B.type.defaultProps),B.props):B.props,ee=q.dataKey,ce=q.maxBarSize,V=q["".concat(D,"Id")],ie=q["".concat(L,"Id")],Le={},ot=l.reduce(function(ea,ta){var Ep=g["".concat(ta.axisType,"Map")],Zb=q["".concat(ta.axisType,"Id")];Ep&&Ep[Zb]||ta.axisType==="zAxis"||Ka();var Jb=Ep[Zb];return F(F({},ea),{},ae(ae({},ta.axisType,Jb),"".concat(ta.axisType,"Ticks"),In(Jb)))},Le),Q=ot[L],le=ot["".concat(L,"Ticks")],fe=S&&S[V]&&S[V].hasStack&&GQ(B,S[V].stackGroups),W=Fn(B.type).indexOf("Bar")>=0,We=kd(Q,le),me=[],st=z&&RQ({barSize:A,stackGroups:S,totalSize:woe(ot,L)});if(W){var lt,Gt,ti=re(ce)?M:ce,to=(lt=(Gt=kd(Q,le,!0))!==null&&Gt!==void 0?Gt:ti)!==null&<!==void 0?lt:0;me=DQ({barGap:N,barCategoryGap:T,bandSize:to!==We?to:We,sizeList:st[ie],maxBarSize:ti}),to!==We&&(me=me.map(function(ea){return F(F({},ea),{},{position:F(F({},ea.position),{},{offset:ea.position.offset-to/2})})}))}var Oc=B&&B.type&&B.type.getComposedData;Oc&&C.push({props:F(F({},Oc(F(F({},ot),{},{displayedData:G,props:b,dataKey:ee,item:B,bandSize:We,barPosition:me,offset:w,stackedData:fe,layout:E,dataStartIndex:O,dataEndIndex:P}))),{},ae(ae(ae({key:B.key||"item-".concat(U)},D,ot[D]),L,ot[L]),"animationId",j)),childIndex:DF(B,b.children),item:B})}),C},p=function(b,g){var x=b.props,S=b.dataStartIndex,w=b.dataEndIndex,j=b.updateId;if(!a1({props:x}))return null;var O=x.children,P=x.layout,A=x.stackOffset,E=x.data,N=x.reverseStackOrder,T=QO(P),M=T.numericAxisName,R=T.cateAxisName,D=Wt(O,n),L=KQ(E,D,"".concat(M,"Id"),"".concat(R,"Id"),A,N),z=l.reduce(function(q,ee){var ce="".concat(ee.axisType,"Map");return F(F({},q),{},ae({},ce,yoe(x,F(F({},ee),{},{graphicalItems:D,stackGroups:ee.axisType===M&&L,dataStartIndex:S,dataEndIndex:w}))))},{}),C=boe(F(F({},z),{},{props:x,graphicalItems:D}),g==null?void 0:g.legendBBox);Object.keys(z).forEach(function(q){z[q]=f(x,z[q],C,q.replace("Map",""),r)});var B=z["".concat(R,"Map")],U=goe(B),G=h(x,F(F({},z),{},{dataStartIndex:S,dataEndIndex:w,updateId:j,graphicalItems:D,stackGroups:L,offset:C}));return F(F({formattedGraphicalItems:G,graphicalItems:D,offset:C,stackGroups:L},U),z)},v=function(y){function b(g){var x,S,w;return eoe(this,b),w=noe(this,b,[g]),ae(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ae(w,"accessibilityManager",new Bae),ae(w,"handleLegendBBoxUpdate",function(j){if(j){var O=w.state,P=O.dataStartIndex,A=O.dataEndIndex,E=O.updateId;w.setState(F({legendBBox:j},p({props:w.props,dataStartIndex:P,dataEndIndex:A,updateId:E},F(F({},w.state),{},{legendBBox:j}))))}}),ae(w,"handleReceiveSyncEvent",function(j,O,P){if(w.props.syncId===j){if(P===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),ae(w,"handleBrushChange",function(j){var O=j.startIndex,P=j.endIndex;if(O!==w.state.dataStartIndex||P!==w.state.dataEndIndex){var A=w.state.updateId;w.setState(function(){return F({dataStartIndex:O,dataEndIndex:P},p({props:w.props,dataStartIndex:O,dataEndIndex:P,updateId:A},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:P})}}),ae(w,"handleMouseEnter",function(j){var O=w.getMouseInfo(j);if(O){var P=F(F({},O),{},{isTooltipActive:!0});w.setState(P),w.triggerSyncEvent(P);var A=w.props.onMouseEnter;te(A)&&A(P,j)}}),ae(w,"triggeredAfterMouseMove",function(j){var O=w.getMouseInfo(j),P=O?F(F({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(P),w.triggerSyncEvent(P);var A=w.props.onMouseMove;te(A)&&A(P,j)}),ae(w,"handleItemMouseEnter",function(j){w.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),ae(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),ae(w,"handleMouseMove",function(j){j.persist(),w.throttleTriggeredAfterMouseMove(j)}),ae(w,"handleMouseLeave",function(j){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var P=w.props.onMouseLeave;te(P)&&P(O,j)}),ae(w,"handleOuterEvent",function(j){var O=RF(j),P=mr(w.props,"".concat(O));if(O&&te(P)){var A,E;/.*touch.*/i.test(O)?E=w.getMouseInfo(j.changedTouches[0]):E=w.getMouseInfo(j),P((A=E)!==null&&A!==void 0?A:{},j)}}),ae(w,"handleClick",function(j){var O=w.getMouseInfo(j);if(O){var P=F(F({},O),{},{isTooltipActive:!0});w.setState(P),w.triggerSyncEvent(P);var A=w.props.onClick;te(A)&&A(P,j)}}),ae(w,"handleMouseDown",function(j){var O=w.props.onMouseDown;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleMouseUp",function(j){var O=w.props.onMouseUp;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),ae(w,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseDown(j.changedTouches[0])}),ae(w,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseUp(j.changedTouches[0])}),ae(w,"handleDoubleClick",function(j){var O=w.props.onDoubleClick;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleContextMenu",function(j){var O=w.props.onContextMenu;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"triggerSyncEvent",function(j){w.props.syncId!==void 0&&Dm.emit(Im,w.props.syncId,j,w.eventEmitterSymbol)}),ae(w,"applySyncEvent",function(j){var O=w.props,P=O.layout,A=O.syncMethod,E=w.state.updateId,N=j.dataStartIndex,T=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)w.setState(F({dataStartIndex:N,dataEndIndex:T},p({props:w.props,dataStartIndex:N,dataEndIndex:T,updateId:E},w.state)));else if(j.activeTooltipIndex!==void 0){var M=j.chartX,R=j.chartY,D=j.activeTooltipIndex,L=w.state,z=L.offset,C=L.tooltipTicks;if(!z)return;if(typeof A=="function")D=A(C,j);else if(A==="value"){D=-1;for(var B=0;B=0){var fe,W;if(M.dataKey&&!M.allowDuplicatedCategory){var We=typeof M.dataKey=="function"?le:"payload.".concat(M.dataKey.toString());fe=Zf(B,We,D),W=U&&G&&Zf(G,We,D)}else fe=B==null?void 0:B[R],W=U&&G&&G[R];if(ie||V){var me=j.props.activeIndex!==void 0?j.props.activeIndex:R;return[k.cloneElement(j,F(F(F({},A.props),ot),{},{activeIndex:me})),null,null]}if(!re(fe))return[Q].concat(Ns(w.renderActivePoints({item:A,activePoint:fe,basePoint:W,childIndex:R,isRange:U})))}else{var st,lt=(st=w.getItemByXY(w.state.activeCoordinate))!==null&&st!==void 0?st:{graphicalItem:Q},Gt=lt.graphicalItem,ti=Gt.item,to=ti===void 0?j:ti,Oc=Gt.childIndex,ea=F(F(F({},A.props),ot),{},{activeIndex:Oc});return[k.cloneElement(to,ea),null,null]}return U?[Q,null,null]:[Q,null]}),ae(w,"renderCustomized",function(j,O,P){return k.cloneElement(j,F(F({key:"recharts-customized-".concat(P)},w.props),w.state))}),ae(w,"renderMap",{CartesianGrid:{handler:of,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:of},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:of},YAxis:{handler:of},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=g.id)!==null&&x!==void 0?x:Qi("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=FE(w.triggeredAfterMouseMove,(S=g.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return ooe(b,y),roe(b,[{key:"componentDidMount",value:function(){var x,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,S=x.children,w=x.data,j=x.height,O=x.layout,P=fr(S,$e);if(P){var A=P.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var E=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,N=Ig(this.state,w,A,E),T=this.state.tooltipTicks[A].coordinate,M=(this.state.offset.top+j)/2,R=O==="horizontal",D=R?{x:T,y:M}:{y:T,x:M},L=this.state.formattedGraphicalItems.find(function(C){var B=C.item;return B.type.name==="Scatter"});L&&(D=F(F({},D),L.props.points[A].tooltipPosition),N=L.props.points[A].tooltipPayload);var z={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:E,activePayload:N,activeCoordinate:D};this.setState(z),this.renderCursor(P),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,j;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(x){ly([fr(x.children,$e)],[fr(this.props.children,$e)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=fr(this.props.children,$e);if(x&&typeof x.props.shared=="boolean"){var S=x.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),j=lK(w),O={chartX:Math.round(x.pageX-j.left),chartY:Math.round(x.pageY-j.top)},P=w.width/S.offsetWidth||1,A=this.inRange(O.chartX,O.chartY,P);if(!A)return null;var E=this.state,N=E.xAxisMap,T=E.yAxisMap,M=this.getTooltipEventType(),R=VO(this.state,this.props.data,this.props.layout,A);if(M!=="axis"&&N&&T){var D=di(N).scale,L=di(T).scale,z=D&&D.invert?D.invert(O.chartX):null,C=L&&L.invert?L.invert(O.chartY):null;return F(F({},O),{},{xValue:z,yValue:C},R)}return R?F(F({},O),R):null}},{key:"inRange",value:function(x,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,O=x/w,P=S/w;if(j==="horizontal"||j==="vertical"){var A=this.state.offset,E=O>=A.left&&O<=A.left+A.width&&P>=A.top&&P<=A.top+A.height;return E?{x:O,y:P}:null}var N=this.state,T=N.angleAxisMap,M=N.radiusAxisMap;if(T&&M){var R=di(T);return pj({x:O,y:P},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,S=this.getTooltipEventType(),w=fr(x,$e),j={};w&&S==="axis"&&(w.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Jf(this.props,this.handleOuterEvent);return F(F({},O),j)}},{key:"addListener",value:function(){Dm.on(Im,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dm.removeListener(Im,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,S,w){for(var j=this.state.formattedGraphicalItems,O=0,P=j.length;O{const u=e.reduce((f,d)=>(f[d.status]=(f[d.status]||0)+1,f),{});return Object.entries(u).map(([f,d])=>({name:f.charAt(0).toUpperCase()+f.slice(1),value:d,status:f,color:YO[f]||YO.default}))},[e]),i=u=>{u&&u.status&&(t?t(u.status):r(`/?status=${u.status}`))};if(n.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const a=n.reduce((u,f)=>u+f.value,0),o=n.length>1,s=u=>`${u.name}: ${u.value}`,l=({active:u,payload:f})=>{if(u&&f&&f.length){const d=f[0].payload,h=a>0?(d.value/a*100).toFixed(1):0;return c.jsxs("div",{className:"bg-dark-surface border border-dark-border rounded-lg p-3 shadow-lg",children:[c.jsx("p",{className:"text-white font-semibold",children:d.name}),c.jsxs("p",{className:"text-dark-text-muted text-sm",children:["Count: ",c.jsx("span",{className:"text-white font-medium",children:d.value})]}),c.jsxs("p",{className:"text-dark-text-muted text-sm",children:["Percentage: ",c.jsxs("span",{className:"text-white font-medium",children:[h,"%"]})]})]})}return null};return c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ql,{children:[c.jsx(yr,{data:n,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:o?2:0,dataKey:"value",onClick:i,style:{cursor:"pointer"},label:s,labelLine:!1,children:n.map((u,f)=>c.jsx(vr,{fill:u.color},`cell-${f}`))}),c.jsx($e,{content:c.jsx(l,{})}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"},iconType:"circle",formatter:(u,f)=>{const d=a>0?(f.payload.value/a*100).toFixed(1):0;return`${u} (${f.payload.value}, ${d}%)`}})]})})}function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function Ui(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function At(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function an(e){At(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||oh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ooe(e,t){At(2,arguments);var r=an(e).getTime(),n=Ui(t);return new Date(r+n)}var Poe={};function kp(){return Poe}function _oe(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function PT(e){At(1,arguments);var t=an(e);return t.setHours(0,0,0,0),t}var _T=6e4,kT=36e5;function koe(e){return At(1,arguments),e instanceof Date||oh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Aoe(e){if(At(1,arguments),!koe(e)&&typeof e!="number")return!1;var t=an(e);return!isNaN(Number(t))}function Eoe(e,t){At(2,arguments);var r=Ui(t);return Ooe(e,-r)}var Noe=864e5;function Toe(e){At(1,arguments);var t=an(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=r-n;return Math.floor(i/Noe)+1}function sh(e){At(1,arguments);var t=1,r=an(e),n=r.getUTCDay(),i=(n=i.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function $oe(e){At(1,arguments);var t=AT(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=sh(r);return n}var Coe=6048e5;function Moe(e){At(1,arguments);var t=an(e),r=sh(t).getTime()-$oe(t).getTime();return Math.round(r/Coe)+1}function lh(e,t){var r,n,i,a,o,s,l,u;At(1,arguments);var f=kp(),d=Ui((r=(n=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:f.weekStartsOn)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=an(e),p=h.getUTCDay(),v=(p=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,p),v.setUTCHours(0,0,0,0);var m=lh(v,t),y=new Date(0);y.setUTCFullYear(d,0,p),y.setUTCHours(0,0,0,0);var b=lh(y,t);return f.getTime()>=m.getTime()?d+1:f.getTime()>=b.getTime()?d:d-1}function Roe(e,t){var r,n,i,a,o,s,l,u;At(1,arguments);var f=kp(),d=Ui((r=(n=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1),h=ET(e,t),p=new Date(0);p.setUTCFullYear(h,0,d),p.setUTCHours(0,0,0,0);var v=lh(p,t);return v}var Doe=6048e5;function Ioe(e,t){At(1,arguments);var r=an(e),n=lh(r,t).getTime()-Roe(r,t).getTime();return Math.round(n/Doe)+1}function je(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return je(r==="yy"?i%100:i,r.length)},M:function(t,r){var n=t.getUTCMonth();return r==="M"?String(n+1):je(n+1,2)},d:function(t,r){return je(t.getUTCDate(),r.length)},a:function(t,r){var n=t.getUTCHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,r){return je(t.getUTCHours()%12||12,r.length)},H:function(t,r){return je(t.getUTCHours(),r.length)},m:function(t,r){return je(t.getUTCMinutes(),r.length)},s:function(t,r){return je(t.getUTCSeconds(),r.length)},S:function(t,r){var n=r.length,i=t.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return je(a,r.length)}},so={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Loe={G:function(t,r,n){var i=t.getUTCFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,r,n){if(r==="yo"){var i=t.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return ii.y(t,r)},Y:function(t,r,n,i){var a=ET(t,i),o=a>0?a:1-a;if(r==="YY"){var s=o%100;return je(s,2)}return r==="Yo"?n.ordinalNumber(o,{unit:"year"}):je(o,r.length)},R:function(t,r){var n=AT(t);return je(n,r.length)},u:function(t,r){var n=t.getUTCFullYear();return je(n,r.length)},Q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"Q":return String(i);case"QQ":return je(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"q":return String(i);case"qq":return je(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,r,n){var i=t.getUTCMonth();switch(r){case"M":case"MM":return ii.M(t,r);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,r,n){var i=t.getUTCMonth();switch(r){case"L":return String(i+1);case"LL":return je(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,r,n,i){var a=Ioe(t,i);return r==="wo"?n.ordinalNumber(a,{unit:"week"}):je(a,r.length)},I:function(t,r,n){var i=Moe(t);return r==="Io"?n.ordinalNumber(i,{unit:"week"}):je(i,r.length)},d:function(t,r,n){return r==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):ii.d(t,r)},D:function(t,r,n){var i=Toe(t);return r==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):je(i,r.length)},E:function(t,r,n){var i=t.getUTCDay();switch(r){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,r,n,i){var a=t.getUTCDay(),o=(a-i.weekStartsOn+8)%7||7;switch(r){case"e":return String(o);case"ee":return je(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,r,n,i){var a=t.getUTCDay(),o=(a-i.weekStartsOn+8)%7||7;switch(r){case"c":return String(o);case"cc":return je(o,r.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,r,n){var i=t.getUTCDay(),a=i===0?7:i;switch(r){case"i":return String(a);case"ii":return je(a,r.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,r,n){var i=t.getUTCHours(),a=i/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,r,n){var i=t.getUTCHours(),a;switch(i===12?a=so.noon:i===0?a=so.midnight:a=i/12>=1?"pm":"am",r){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,r,n){var i=t.getUTCHours(),a;switch(i>=17?a=so.evening:i>=12?a=so.afternoon:i>=4?a=so.morning:a=so.night,r){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,r,n){if(r==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return ii.h(t,r)},H:function(t,r,n){return r==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):ii.H(t,r)},K:function(t,r,n){var i=t.getUTCHours()%12;return r==="Ko"?n.ordinalNumber(i,{unit:"hour"}):je(i,r.length)},k:function(t,r,n){var i=t.getUTCHours();return i===0&&(i=24),r==="ko"?n.ordinalNumber(i,{unit:"hour"}):je(i,r.length)},m:function(t,r,n){return r==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):ii.m(t,r)},s:function(t,r,n){return r==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):ii.s(t,r)},S:function(t,r){return ii.S(t,r)},X:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();if(o===0)return"Z";switch(r){case"X":return ZO(o);case"XXXX":case"XX":return ca(o);case"XXXXX":case"XXX":default:return ca(o,":")}},x:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"x":return ZO(o);case"xxxx":case"xx":return ca(o);case"xxxxx":case"xxx":default:return ca(o,":")}},O:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+XO(o,":");case"OOOO":default:return"GMT"+ca(o,":")}},z:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+XO(o,":");case"zzzz":default:return"GMT"+ca(o,":")}},t:function(t,r,n,i){var a=i._originalDate||t,o=Math.floor(a.getTime()/1e3);return je(o,r.length)},T:function(t,r,n,i){var a=i._originalDate||t,o=a.getTime();return je(o,r.length)}};function XO(e,t){var r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return r+String(i);var o=t;return r+String(i)+o+je(a,2)}function ZO(e,t){if(e%60===0){var r=e>0?"-":"+";return r+je(Math.abs(e)/60,2)}return ca(e,t)}function ca(e,t){var r=t||"",n=e>0?"-":"+",i=Math.abs(e),a=je(Math.floor(i/60),2),o=je(i%60,2);return n+a+r+o}var JO=function(t,r){switch(t){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},NT=function(t,r){switch(t){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Foe=function(t,r){var n=t.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return JO(t,r);var o;switch(i){case"P":o=r.dateTime({width:"short"});break;case"PP":o=r.dateTime({width:"medium"});break;case"PPP":o=r.dateTime({width:"long"});break;case"PPPP":default:o=r.dateTime({width:"full"});break}return o.replace("{{date}}",JO(i,r)).replace("{{time}}",NT(a,r))},Boe={p:NT,P:Foe},zoe=["D","DD"],Uoe=["YY","YYYY"];function qoe(e){return zoe.indexOf(e)!==-1}function Woe(e){return Uoe.indexOf(e)!==-1}function eP(e,t,r){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Hoe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Koe=function(t,r,n){var i,a=Hoe[t];return typeof a=="string"?i=a:r===1?i=a.one:i=a.other.replace("{{count}}",r.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Fm(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var Voe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Goe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yoe={date:Fm({formats:Voe,defaultWidth:"full"}),time:Fm({formats:Goe,defaultWidth:"full"}),dateTime:Fm({formats:Qoe,defaultWidth:"full"})},Xoe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zoe=function(t,r,n,i){return Xoe[t]};function Sl(e){return function(t,r){var n=r!=null&&r.context?String(r.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,o=r!=null&&r.width?String(r.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{var s=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[s]}var u=e.argumentCallback?e.argumentCallback(t):t;return i[u]}}var Joe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ese={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},rse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ise={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ase=function(t,r){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ose={ordinalNumber:ase,era:Sl({values:Joe,defaultWidth:"wide"}),quarter:Sl({values:ese,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Sl({values:tse,defaultWidth:"wide"}),day:Sl({values:rse,defaultWidth:"wide"}),dayPeriod:Sl({values:nse,defaultWidth:"wide",formattingValues:ise,defaultFormattingWidth:"wide"})};function jl(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;var o=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?lse(s,function(d){return d.test(o)}):sse(s,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u;var f=t.slice(o.length);return{value:u,rest:f}}}function sse(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function lse(e,t){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(e.matchPattern);if(!n)return null;var i=n[0],a=t.match(e.parsePattern);if(!a)return null;var o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;var s=t.slice(i.length);return{value:o,rest:s}}}var cse=/^(\d+)(th|st|nd|rd)?/i,fse=/\d+/i,dse={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hse={any:[/^b/i,/^(a|c)/i]},pse={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mse={any:[/1/i,/2/i,/3/i,/4/i]},vse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},yse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},gse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sse={ordinalNumber:use({matchPattern:cse,parsePattern:fse,valueCallback:function(t){return parseInt(t,10)}}),era:jl({matchPatterns:dse,defaultMatchWidth:"wide",parsePatterns:hse,defaultParseWidth:"any"}),quarter:jl({matchPatterns:pse,defaultMatchWidth:"wide",parsePatterns:mse,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:jl({matchPatterns:vse,defaultMatchWidth:"wide",parsePatterns:yse,defaultParseWidth:"any"}),day:jl({matchPatterns:gse,defaultMatchWidth:"wide",parsePatterns:xse,defaultParseWidth:"any"}),dayPeriod:jl({matchPatterns:bse,defaultMatchWidth:"any",parsePatterns:wse,defaultParseWidth:"any"})},jse={code:"en-US",formatDistance:Koe,formatLong:Yoe,formatRelative:Zoe,localize:ose,match:Sse,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ose=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pse=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_se=/^'([^]*?)'?$/,kse=/''/g,Ase=/[a-zA-Z]/;function Yn(e,t,r){var n,i,a,o,s,l,u,f,d,h,p,v,m,y;At(2,arguments);var b=String(t),g=kp(),x=(n=(i=void 0)!==null&&i!==void 0?i:g.locale)!==null&&n!==void 0?n:jse,S=Ui((a=(o=(s=(l=void 0)!==null&&l!==void 0?l:void 0)!==null&&s!==void 0?s:g.firstWeekContainsDate)!==null&&o!==void 0?o:(u=g.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=Ui((d=(h=(p=(v=void 0)!==null&&v!==void 0?v:void 0)!==null&&p!==void 0?p:g.weekStartsOn)!==null&&h!==void 0?h:(m=g.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&d!==void 0?d:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var j=an(e);if(!Aoe(j))throw new RangeError("Invalid time value");var O=_oe(j),P=Eoe(j,O),A={firstWeekContainsDate:S,weekStartsOn:w,locale:x,_originalDate:j},E=b.match(Pse).map(function(N){var T=N[0];if(T==="p"||T==="P"){var M=Boe[T];return M(N,x.formatLong)}return N}).join("").match(Ose).map(function(N){if(N==="''")return"'";var T=N[0];if(T==="'")return Ese(N);var M=Loe[T];if(M)return Woe(N)&&eP(N,t,String(e)),qoe(N)&&eP(N,t,String(e)),M(P,N,x.localize,A);if(T.match(Ase))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return N}).join("");return E}function Ese(e){var t=e.match(_se);return t?t[1].replace(kse,"'"):e}function uh(e,t){var r;At(1,arguments);var n=Ui((r=void 0)!==null&&r!==void 0?r:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var i=Cse(e),a;if(i.date){var o=Mse(i.date,n);a=Rse(o.restDateString,o.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var s=a.getTime(),l=0,u;if(i.time&&(l=Dse(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(u=Ise(i.timezone),isNaN(u))return new Date(NaN)}else{var f=new Date(s+l),d=new Date(0);return d.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),d.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),d}return new Date(s+l+u)}var sf={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Nse=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tse=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,$se=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Cse(e){var t={},r=e.split(sf.dateTimeDelimiter),n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],sf.timeZoneDelimiter.test(t.date)&&(t.date=e.split(sf.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){var i=sf.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function Mse(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function Rse(e,t){if(t===null)return new Date(NaN);var r=e.match(Nse);if(!r)return new Date(NaN);var n=!!r[4],i=Ol(r[1]),a=Ol(r[2])-1,o=Ol(r[3]),s=Ol(r[4]),l=Ol(r[5])-1;if(n)return Use(t,s,l)?Lse(t,s,l):new Date(NaN);var u=new Date(0);return!Bse(t,a,o)||!zse(t,i)?new Date(NaN):(u.setUTCFullYear(t,a,Math.max(i,o)),u)}function Ol(e){return e?parseInt(e):1}function Dse(e){var t=e.match(Tse);if(!t)return NaN;var r=Bm(t[1]),n=Bm(t[2]),i=Bm(t[3]);return qse(r,n,i)?r*kT+n*_T+i*1e3:NaN}function Bm(e){return e&&parseFloat(e.replace(",","."))||0}function Ise(e){if(e==="Z")return 0;var t=e.match($se);if(!t)return 0;var r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Wse(n,i)?r*(n*kT+i*_T):NaN}function Lse(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var i=n.getUTCDay()||7,a=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}var Fse=[31,null,31,30,31,30,31,31,30,31,30,31];function TT(e){return e%400===0||e%4===0&&e%100!==0}function Bse(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(Fse[t]||(TT(e)?29:28))}function zse(e,t){return t>=1&&t<=(TT(e)?366:365)}function Use(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function qse(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Wse(e,t){return t>=0&&t<=59}function Ap({runId:e,truncate:t=!0,className:r="",showFullOnHover:n=!1}){const[i,a]=k.useState(!1),[o,s]=k.useState(!1),l=async f=>{f.stopPropagation();try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch(d){console.error("Failed to copy:",d)}},u=t&&!o?`${e.substring(0,12)}...`:e;return c.jsxs("div",{className:`flex items-center gap-2 group ${r}`,onMouseEnter:()=>n&&s(!0),onMouseLeave:()=>n&&s(!1),children:[c.jsx("span",{className:"font-mono text-xs text-dark-text",title:e,children:u}),c.jsx("button",{onClick:l,className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-dark-bg rounded text-dark-text-muted hover:text-primary",title:"Copy run ID to clipboard",children:i?c.jsx(eD,{size:14,className:"text-success"}):c.jsx(rD,{size:14})})]})}function ch({runs:e,highlightShots:t=!1,title:r,showDownloadButton:n=!1}){const i=mt(),a=s=>{i(`/runs/${s}`)},o=()=>{const s=r?`qobserva-${r.toLowerCase().replace(/\s+/g,"-")}`:"qobserva-runs";Kx(e,s)};return c.jsxs("div",{children:[n&&c.jsx("div",{className:"flex justify-end mb-4",children:c.jsxs("button",{onClick:o,className:"btn-secondary flex items-center gap-2",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Run ID"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Time"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Project"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Status"}),c.jsx("th",{className:`text-left py-3 px-4 text-sm font-semibold ${t?"text-primary bg-primary/10":"text-dark-text-muted"}`,children:"Shots"})]})}),c.jsx("tbody",{children:e.slice(0,50).map(s=>c.jsxs("tr",{onClick:()=>a(s.run_id),className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 cursor-pointer transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:c.jsx(Ap,{runId:s.run_id})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:Yn(new Date(s.created_at),"MMM dd, HH:mm")}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.project}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.backend_name}),c.jsx("td",{className:"py-3 px-4",children:c.jsx("span",{className:`px-2 py-1 rounded text-xs font-semibold ${s.status==="success"?"bg-success/20 text-success":s.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:s.status})}),c.jsx("td",{className:`py-3 px-4 text-sm font-semibold ${t?"text-primary bg-primary/5":"text-dark-text"}`,children:s.shots.toLocaleString()})]},s.run_id))})]})})]})}function Lg({runs:e,title:t}){const r=()=>{const n=t?`qobserva-${t.toLowerCase().replace(/\s+/g,"-")}`:"qobserva-runs";Kx(e,n)};return c.jsxs("button",{onClick:r,className:"btn-secondary flex items-center gap-2 ml-auto",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}function Hse({runs:e}){const t=k.useMemo(()=>{const r=e.reduce((n,i)=>{const a=new Date(i.created_at).toLocaleDateString();return n[a]||(n[a]={date:a,success:0,failed:0,total:0}),n[a].total++,i.status==="success"?n[a].success++:i.status==="failed"&&n[a].failed++,n},{});return Object.values(r).map(n=>({date:n.date,successRate:n.total>0?n.success/n.total*100:0,failureRate:n.total>0?n.failed/n.total*100:0})).sort((n,i)=>new Date(n.date).getTime()-new Date(i.date).getTime())},[e]);return t.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"}):c.jsx(tt,{width:"100%",height:300,children:c.jsxs(OT,{data:t,children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"colorSuccess",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#10b981",stopOpacity:.3}),c.jsx("stop",{offset:"95%",stopColor:"#10b981",stopOpacity:0})]}),c.jsxs("linearGradient",{id:"colorFailed",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#ef4444",stopOpacity:.3}),c.jsx("stop",{offset:"95%",stopColor:"#ef4444",stopOpacity:0})]})]}),c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"date",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},domain:[0,100],label:{value:"Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},formatter:r=>[`${r.toFixed(1)}%`,""]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"},iconType:"circle"}),c.jsx(wn,{type:"monotone",dataKey:"successRate",name:"Success Rate",stroke:"#10b981",strokeWidth:2,fill:"url(#colorSuccess)"}),c.jsx(wn,{type:"monotone",dataKey:"failureRate",name:"Failure Rate",stroke:"#ef4444",strokeWidth:2,fill:"url(#colorFailed)"})]})})}function Kse({filters:e={}}){const t=mt(),[r,n]=k.useState(null),i=k.useMemo(()=>["runs",JSON.stringify(e)],[e]),{data:a=[],isLoading:o}=Qe({queryKey:i,queryFn:()=>(console.log("Fetching runs with filters:",JSON.stringify(e,null,2)),Ye.getRuns({limit:1e3,...e})),staleTime:0,refetchOnWindowFocus:!1});if(o)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});const s=a.length,l=a.filter(m=>m.status==="success").length,u=s>0?l/s*100:0,f=a.reduce((m,y)=>m+y.shots,0),d=s>0?Math.round(f/s):0,h=new Set(a.map(m=>m.backend_name)).size,p=r?a.filter(m=>m.status===r):a,v=m=>{const y=new URLSearchParams({type:m});return e.project&&y.set("project",e.project),e.provider&&y.set("provider",e.provider),e.status&&y.set("status",e.status),e.startDate&&y.set("startDate",e.startDate),e.endDate&&y.set("endDate",e.endDate),`/runs-filtered?${y.toString()}`};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"grid grid-cols-5 gap-6",children:[c.jsx(be,{label:"Total Runs",value:s.toLocaleString(),clickable:!0,onClick:()=>t(v("all"))}),c.jsx(be,{label:"Success Rate",value:`${u.toFixed(1)}%`,clickable:!0,onClick:()=>t(v("success"))}),c.jsx(be,{label:"Avg Shots",value:d.toLocaleString(),clickable:!0,onClick:()=>t(v("shots"))}),c.jsx(be,{label:"Backends",value:h.toString(),clickable:!0,onClick:()=>t(v("backends"))}),c.jsx(be,{label:"Total Shots",value:f.toLocaleString(),clickable:!0,onClick:()=>t(v("shots"))})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Success Rate Trend"}),c.jsx(Hse,{runs:a})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runs by Status"}),c.jsx(joe,{runs:a,onSliceClick:m=>{n(m)}})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("h3",{className:"text-lg font-semibold text-white",children:[r?`${r.charAt(0).toUpperCase()+r.slice(1)} Runs`:"Recent Runs",r&&c.jsx("button",{onClick:()=>n(null),className:"ml-4 text-sm text-primary hover:underline",children:"Clear filter"})]}),c.jsx(Lg,{runs:p})]}),c.jsx(ch,{runs:p})]})]})}function Fg({counts:e}){const t=Object.entries(e).sort(([,r],[,n])=>n-r).slice(0,20).map(([r,n])=>({bitstring:r,count:n}));return t.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No counts available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Ts,{data:t,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"bitstring",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80,label:{value:"Bitstring (Measurement Outcome)",position:"insideBottom",offset:-5,fill:"#94a3b8",style:{textAnchor:"middle"}}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Count (Number of Observations)",angle:-90,position:"insideLeft",fill:"#94a3b8",style:{textAnchor:"middle"}}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0",fontWeight:"bold"},formatter:r=>[r.toLocaleString(),"Count"]}),c.jsx(or,{dataKey:"count",fill:"#3b82f6",radius:[8,8,0,0]})]})})}function Vse({queueTime:e,runtime:t}){const r=(e||0)+(t||0);return!e&&!t?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No timeline data"}):c.jsxs("div",{className:"space-y-4",children:[e&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("span",{className:"text-sm text-dark-text-muted",children:"Queue Time"}),c.jsxs("span",{className:"text-sm text-dark-text",children:[e,"ms"]})]}),c.jsx("div",{className:"h-4 bg-dark-bg rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-warning",style:{width:`${e/r*100}%`}})})]}),t&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("span",{className:"text-sm text-dark-text-muted",children:"Runtime"}),c.jsxs("span",{className:"text-sm text-dark-text",children:[t,"ms"]})]}),c.jsx("div",{className:"h-4 bg-dark-bg rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-success",style:{width:`${t/r*100}%`}})})]})]})}function Gse({top1:e,top5:t,top10:r}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Top-K Dominance"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Probability mass in top states. High values indicate algorithm convergence; low values suggest noise-dominated output."}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(be,{label:"Top-1 Probability",value:`${(e*100).toFixed(3)}%`}),c.jsx(be,{label:"Top-5 Cumulative",value:`${(t*100).toFixed(3)}%`}),c.jsx(be,{label:"Top-10 Cumulative",value:`${(r*100).toFixed(3)}%`})]}),e<.01&&r<.05&&c.jsx("p",{className:"text-sm text-warning mt-4",children:"⚠️ Highly uniform distribution → likely noise-dominated"})]})}function Qse({effectiveSupportSize:e,totalStates:t}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Effective Support Size"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Number of states covering 95% of probability mass. More intuitive than entropy for understanding algorithm sharpness vs noise."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(be,{label:"Effective Support (95%)",value:e.toLocaleString()}),c.jsx(be,{label:"Total Unique States",value:t.toLocaleString()})]}),c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Coverage:"}),c.jsxs("span",{className:"text-dark-text",children:[t>0?(e/t*100).toFixed(1):0,"% of states"]})]}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-2",children:c.jsx("div",{className:"bg-primary h-2 rounded-full transition-all",style:{width:`${t>0?e/t*100:0}%`}})})]})]})}function Yse({entropy:e,idealEntropy:t,entropyRatio:r}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Entropy Analysis"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:'Measured entropy vs ideal (max) entropy. Ratio shows "how random" relative to expectation.'}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(be,{label:"Shannon Entropy",value:`${e.toFixed(4)} bits`}),t!==void 0&&c.jsx(be,{label:"Ideal Entropy (Max)",value:`${t.toFixed(4)} bits`}),r!==void 0&&c.jsx(be,{label:"Entropy Ratio",value:`${(r*100).toFixed(1)}%`,change:r>.9?"Highly random":r>.5?"Moderately random":"Concentrated"})]}),r!==void 0&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Randomness:"}),c.jsx("span",{className:`font-semibold ${r>.9?"text-warning":r>.5?"text-primary":"text-success"}`,children:r>.9?"Highly Random":r>.5?"Moderately Random":"Concentrated"})]}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-2",children:c.jsx("div",{className:`h-2 rounded-full transition-all ${r>.9?"bg-warning":r>.5?"bg-primary":"bg-success"}`,style:{width:`${r*100}%`}})})]})]})}function Xse({uniqueStates:e,shots:t,uniqueStatesRatio:r,collisionRate:n}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shot Efficiency & Sampling Quality"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Unique states vs total shots. High unique ratio indicates undersampling; low ratio with high collisions suggests concentration."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[c.jsx(be,{label:"Unique States",value:e.toLocaleString()}),c.jsx(be,{label:"Total Shots",value:t.toLocaleString()})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(be,{label:"Unique/Shots Ratio",value:`${(r*100).toFixed(2)}%`,change:r>.9?"Undersampled":r<.1?"Oversampled":"Balanced"}),c.jsx(be,{label:"Collision Rate",value:`${(n*100).toFixed(2)}%`,change:n>.5?"High concentration":"Low concentration"})]}),r>.9&&c.jsxs("p",{className:"text-sm text-warning mt-4",children:["⚠️ High unique ratio (",r>.9?">90%":">50%",") - Additional shots unlikely to improve signal"]})]})}function Zse({runtimeMs:e,queueMs:t,runtimePerShot:r,classification:n}){const i=o=>{switch(o){case"queue-dominated":return"text-warning";case"execution-dominated":return"text-primary";case"cpu-bound":return"text-success";default:return"text-dark-text-muted"}},a=o=>{switch(o){case"queue-dominated":return"Queue-Dominated";case"execution-dominated":return"Execution-Dominated";case"cpu-bound":return"CPU-Bound";default:return"Unknown"}};return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runtime & Execution Behavior"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Runtime analysis helps identify if backend is slow or circuit is slow. Classification is heuristic."}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-4",children:[c.jsx(be,{label:"Runtime",value:`${e.toLocaleString()}ms`}),c.jsx(be,{label:"Queue Time",value:`${t.toLocaleString()}ms`}),c.jsx(be,{label:"Runtime/Shot",value:`${r.toFixed(3)}ms`}),c.jsxs("div",{className:"metric-card",children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Classification"}),c.jsx("div",{className:`text-2xl font-bold ${i(n)}`,children:a(n)})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("div",{className:"flex items-center justify-between text-sm mb-2",children:c.jsx("span",{className:"text-dark-text-muted",children:"Time Distribution:"})}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-4 flex overflow-hidden",children:e>0&&t>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"bg-primary h-4 transition-all",style:{width:`${e/(e+t)*100}%`},title:`Execution: ${e}ms`}),c.jsx("div",{className:"bg-warning h-4 transition-all",style:{width:`${t/(e+t)*100}%`},title:`Queue: ${t}ms`})]})}),c.jsxs("div",{className:"flex justify-between text-xs text-dark-text-muted mt-2",children:[c.jsxs("span",{children:["Execution: ",e,"ms"]}),c.jsxs("span",{children:["Queue: ",t,"ms"]})]})]}),n==="queue-dominated"&&c.jsx("p",{className:"text-sm text-warning mt-4",children:"⚠️ Queue time dominates - Backend may be heavily loaded"})]})}function Jse({cpuTimeS:e,qpuTimeS:t,queueTimeS:r,postProcessingTimeS:n}){const i=a=>`${a.toFixed(2)} s`;return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Execution time breakdown"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Provider-reported time spent in CPU, QPU, queue, and post-processing. Shown when the backend supplies this metadata (e.g. IBM cloud/hardware)."}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e!=null&&c.jsx(be,{label:"CPU",value:i(e)}),t!=null&&c.jsx(be,{label:"QPU",value:i(t)}),r!=null&&c.jsx(be,{label:"Queue (provider)",value:i(r)}),n!=null&&c.jsx(be,{label:"Post-processing",value:i(n)})]})]})}function ec(e,t){var v,m,y,b,g,x,S,w;const r={},n=((m=(v=e.artifacts)==null?void 0:v.counts)==null?void 0:m.histogram)||{},i=((y=e.execution)==null?void 0:y.shots)||0,a=((b=e.execution)==null?void 0:b.runtime_ms)||0,o=((g=e.execution)==null?void 0:g.queue_ms)||0,s=(S=(x=e.program)==null?void 0:x.circuit_metrics)==null?void 0:S.num_qubits;if(!n||i===0)return r;const l=Object.entries(n).map(([j,O])=>({state:j,count:parseInt(O,10),probability:parseInt(O,10)/i})).sort((j,O)=>O.probability-j.probability);if(l.length>0){r.top1Probability=l[0].probability;const j=l.slice(0,5).reduce((P,A)=>P+A.probability,0);r.top5Probability=j;const O=l.slice(0,10).reduce((P,A)=>P+A.probability,0);r.top10Probability=O}let u=0,f=0;for(const j of l)if(u+=j.probability,f++,u>=.95)break;r.effectiveSupportSize=f;const d=(w=t.metrics)==null?void 0:w["qc.quality.shannon_entropy_bits"];if(d!=null&&(r.entropy=d,s&&s>0)){const j=s;r.idealEntropy=j,r.entropyRatio=d/j}const h=Object.keys(n).length;r.uniqueStates=h,r.uniqueStatesRatio=i>0?h/i:0;let p=0;for(const j of Object.values(n)){const O=parseInt(String(j),10);O>1&&(p+=O-1)}if(r.collisionRate=i>0?p/i:0,a>0&&i>0&&(r.runtimePerShot=a/i),a>0){const j=a+o;if(j>0){const O=o/j,P=a/j;O>.5?r.runtimeClassification="queue-dominated":P>.7?r.runtimeClassification="execution-dominated":a<100&&o<100?r.runtimeClassification="cpu-bound":r.runtimeClassification="unknown"}else r.runtimeClassification="unknown"}else r.runtimeClassification="unknown";return r}function ele(e){var n,i,a,o,s;if(!e||Object.keys(e).length===0)return null;if(e.algorithm==="error_test"){const l=e.error_type||"error scenario";return{severity:"warn",message:`This run is tagged as an error test (${l}). Results may not represent normal execution and should be interpreted accordingly.`,tagContext:`algorithm: error_test, error_type: ${l}`}}if(e.error_type&&e.error_type!=="none"&&e.error_type!==""&&(e.algorithm==="error_test"||((n=e.test)==null?void 0:n.toLowerCase().includes("error"))||((i=e.purpose)==null?void 0:i.toLowerCase().includes("error"))||((a=e.scenario)==null?void 0:a.toLowerCase().includes("error"))))return{severity:"warn",message:`This run is tagged with error_type: "${e.error_type}". This appears to be an intentional error test scenario - results may not be meaningful for normal analysis.`,tagContext:`error_type: ${e.error_type}`};if(e.test&&e.test.toLowerCase().includes("error"))return{severity:"info",message:'This run is tagged as a test with "error" in the tag value. Results may be from an error handling test scenario.',tagContext:`test: ${e.test}`};const t=((o=e.purpose)==null?void 0:o.toLowerCase())||"",r=((s=e.scenario)==null?void 0:s.toLowerCase())||"";return(t.includes("error")||r.includes("error"))&&(t.includes("test")||r.includes("test"))?{severity:"info",message:"This run appears to be an error test scenario based on tags. Results should be interpreted in that context.",tagContext:t?`purpose: ${e.purpose}`:`scenario: ${e.scenario}`}:null}function tle(){var g,x,S,w,j,O,P,A,E,N,T,M,R,D;const{runId:e}=xR(),[t,r]=k.useState({rawMetadata:!1,rawEvent:!1,rawAnalysis:!1}),{data:n=[]}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3})}),i=n.find(L=>L.run_id===e),a=(i==null?void 0:i.project)||"default",{data:o,isLoading:s,error:l}=Qe({queryKey:["run",e],queryFn:()=>Ye.getRun(a,e),enabled:!!e,retry:2}),u=k.useMemo(()=>o?ec(o.event,o.analysis):{},[o]),f=o==null?void 0:o.event,d=o==null?void 0:o.analysis,h=(d==null?void 0:d.metrics)||{},p=h["qc.quality.shannon_entropy_bits"],v=((x=(g=f==null?void 0:f.artifacts)==null?void 0:g.counts)==null?void 0:x.histogram)||{},m=Object.keys(v).length,y=k.useMemo(()=>f!=null&&f.tags?ele(f.tags):null,[f==null?void 0:f.tags]);if(s)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});if(l||!o||!f||!d)return c.jsxs("div",{className:"text-center py-12",children:[c.jsx("p",{className:"text-dark-text-muted mb-4",children:"Run not found"}),c.jsxs("p",{className:"text-sm text-dark-text-muted",children:["Run ID: ",e]})]});const b=L=>{r(z=>({...z,[L]:!z[L]}))};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Run Details"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Run ID:"}),c.jsx(Ap,{runId:e||"",truncate:!1})]})]}),y&&c.jsx("div",{className:`card border-l-4 ${y.severity==="warn"?"border-warning bg-warning/10":"border-primary bg-primary/10"}`,children:c.jsxs("div",{className:"flex items-start gap-3",children:[y.severity==="warn"?c.jsx(YR,{className:"text-warning mt-0.5 flex-shrink-0",size:20}):c.jsx(Yk,{className:"text-primary mt-0.5 flex-shrink-0",size:20}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h4",{className:`font-semibold mb-1 ${y.severity==="warn"?"text-warning":"text-primary"}`,children:y.severity==="warn"?"Test Scenario Warning":"Tag Information"}),c.jsx("p",{className:"text-sm text-dark-text",children:y.message}),y.tagContext&&c.jsxs("p",{className:"text-xs text-dark-text-muted mt-2",children:["Tag context: ",y.tagContext]})]})]})}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Run Information"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Project"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.project})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Provider"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.backend.provider})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Backend"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.backend.name})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Status"}),c.jsx("span",{className:`font-medium ${f.execution.status==="success"?"text-success":f.execution.status==="failed"?"text-error":"text-dark-text-muted"}`,children:f.execution.status})]})]}),(((S=f.software)==null?void 0:S.sdk)||((w=f.software)==null?void 0:w.python_version))&&c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("h4",{className:"text-sm font-semibold text-white mb-3",children:"Software Environment"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[((j=f.software.sdk)==null?void 0:j.name)&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"SDK"}),c.jsxs("span",{className:"text-dark-text font-medium",children:[f.software.sdk.name,f.software.sdk.version&&c.jsxs("span",{className:"text-dark-text-muted ml-1",children:["v",f.software.sdk.version]})]})]}),f.software.python_version&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Python"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.software.python_version})]}),f.software.agent_version&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"QObserva Agent"}),c.jsxs("span",{className:"text-dark-text font-medium",children:["v",f.software.agent_version]})]})]})]}),f.event_id&&c.jsx("div",{className:"mt-4 pt-4 border-t border-dark-border",children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted text-sm mb-1",children:"Event ID"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.event_id})]})})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[h["qc.quality.success_probability"]!==void 0?c.jsx(be,{label:"Success Rate",value:`${(h["qc.quality.success_probability"]*100).toFixed(1)}%`}):h["qc.optimization.energy"]!==void 0?c.jsx(be,{label:"Energy",value:h["qc.optimization.energy"].toFixed(4)}):c.jsx(be,{label:"Success Rate",value:"N/A"}),c.jsx(be,{label:"Shots",value:f.execution.shots.toLocaleString()}),c.jsx(be,{label:"Runtime",value:f.execution.runtime_ms?`${f.execution.runtime_ms}ms`:"N/A"}),c.jsx(be,{label:"Cost",value:h["qc.cost.estimated_usd"]?`$${h["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]}),h["qc.optimization.energy"]!==void 0&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Optimization Results"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Energy"}),c.jsx("span",{className:"text-dark-text font-medium text-lg",children:h["qc.optimization.energy"].toFixed(6)})]}),h["qc.optimization.energy_stderr"]!==void 0&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Energy Std Error"}),c.jsx("span",{className:"text-dark-text font-medium",children:h["qc.optimization.energy_stderr"].toFixed(6)})]}),h["qc.optimization.approximation_ratio"]!==void 0&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Approximation Ratio"}),c.jsxs("span",{className:`font-medium ${h["qc.optimization.approximation_ratio"]<=1.1?"text-success":h["qc.optimization.approximation_ratio"]<=2?"text-warning":"text-error"}`,children:[h["qc.optimization.approximation_ratio"].toFixed(4),"x"]}),c.jsx("span",{className:"text-xs text-dark-text-muted mt-1",children:h["qc.optimization.approximation_ratio"]<=1.1?"Excellent (near ground state)":h["qc.optimization.approximation_ratio"]<=2?"Good":"Needs improvement"})]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Measurement Results"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Distribution of measurement outcomes (bitstrings) and how many times each was observed. Shows the top 20 most frequent outcomes."}),c.jsx(Fg,{counts:((P=(O=f.artifacts)==null?void 0:O.counts)==null?void 0:P.histogram)||{}})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Execution Timeline"}),c.jsx(Vse,{queueTime:f.execution.queue_ms,runtime:f.execution.runtime_ms})]})]}),u.top1Probability!==void 0&&c.jsx(Gse,{top1:u.top1Probability,top5:u.top5Probability||0,top10:u.top10Probability||0}),u.effectiveSupportSize!==void 0&&c.jsx(Qse,{effectiveSupportSize:u.effectiveSupportSize,totalStates:m}),p!=null&&c.jsx(Yse,{entropy:p,idealEntropy:u.idealEntropy,entropyRatio:u.entropyRatio}),u.uniqueStates!==void 0&&((A=f.execution)==null?void 0:A.shots)&&c.jsx(Xse,{uniqueStates:u.uniqueStates,shots:f.execution.shots,uniqueStatesRatio:u.uniqueStatesRatio||0,collisionRate:u.collisionRate||0}),u.runtimePerShot!==void 0&&((E=f.execution)==null?void 0:E.runtime_ms)!==void 0&&c.jsx(Zse,{runtimeMs:f.execution.runtime_ms||0,queueMs:f.execution.queue_ms||0,shots:f.execution.shots||0,runtimePerShot:u.runtimePerShot,classification:u.runtimeClassification||"unknown"}),(h["qc.time.cpu_s"]!=null||h["qc.time.qpu_s"]!=null||h["qc.time.queue_s"]!=null||h["qc.time.post_processing_s"]!=null)&&c.jsx(Jse,{cpuTimeS:h["qc.time.cpu_s"],qpuTimeS:h["qc.time.qpu_s"],queueTimeS:h["qc.time.queue_s"],postProcessingTimeS:h["qc.time.post_processing_s"]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawMetadata"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detailed Metadata"}),t.rawMetadata?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawMetadata&&c.jsxs("div",{className:"mt-4 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Run ID:"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.run_id})]}),f.event_id&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Event ID:"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.event_id})]}),f.created_at&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Created At:"}),c.jsx("span",{className:"text-dark-text",children:new Date(f.created_at).toLocaleString()})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Raw Metadata (JSON)"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-96",children:JSON.stringify({project:f.project,backend:f.backend,run_id:f.run_id,event_id:f.event_id||void 0,created_at:f.created_at||void 0,execution:{status:f.execution.status,shots:f.execution.shots,runtime_ms:f.execution.runtime_ms,queue_ms:f.execution.queue_ms}},null,2)})]})]})]}),d.insights&&d.insights.length>0&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Insights"}),c.jsx("div",{className:"space-y-2",children:d.insights.map((L,z)=>c.jsx("div",{className:`p-3 rounded-lg ${L.severity==="critical"?"bg-error/20 border border-error/30 text-error":L.severity==="warn"?"bg-warning/20 border border-warning/30 text-warning":"bg-primary/20 border border-primary/30 text-primary"}`,children:L.summary},z))})]}),((N=f.artifacts)==null?void 0:N.energies)&&c.jsxs("div",{className:"card border-l-4 border-primary",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Energy Artifacts (Debug)"}),c.jsxs("div",{className:"text-sm",children:[c.jsxs("div",{className:"mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Energy Value:"}),c.jsx("span",{className:"text-dark-text font-mono ml-2",children:((T=f.artifacts.energies)==null?void 0:T.value)!==null&&((M=f.artifacts.energies)==null?void 0:M.value)!==void 0?String(f.artifacts.energies.value):"null/undefined"})]}),c.jsxs("div",{className:"mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Energy Std Error:"}),c.jsx("span",{className:"text-dark-text font-mono ml-2",children:((R=f.artifacts.energies)==null?void 0:R.stderr)!==null&&((D=f.artifacts.energies)==null?void 0:D.stderr)!==void 0?String(f.artifacts.energies.stderr):"null/undefined"})]}),c.jsx("div",{className:"text-xs text-dark-text-muted mt-2",children:"If energy value is null/undefined, the adapter didn't extract it. If it has a value but metrics don't show it, the analysis needs to be re-run."})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawEvent"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Raw Event Data"}),t.rawEvent?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawEvent&&c.jsx("div",{className:"mt-4",children:c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-96",children:JSON.stringify(f,null,2)})})]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawAnalysis"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Raw Analytics Data"}),t.rawAnalysis?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawAnalysis&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Metrics"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-64",children:JSON.stringify(h,null,2)})]}),d.insights&&d.insights.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Insights"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-64",children:JSON.stringify(d.insights,null,2)})]})]})]})]})}function tP({runs:e,value:t,onChange:r,label:n,placeholder:i="Search by run ID, project, backend..."}){const[a,o]=k.useState(!1),[s,l]=k.useState(""),u=e.find(p=>p.run_id===t),f=k.useMemo(()=>{if(!s.trim())return e.slice(0,50);const p=s.toLowerCase();return e.filter(v=>v.run_id.toLowerCase().includes(p)||v.project.toLowerCase().includes(p)||v.provider.toLowerCase().includes(p)||v.backend_name.toLowerCase().includes(p)||v.status.toLowerCase().includes(p)).slice(0,50)},[e,s]),d=p=>{r(p),o(!1),l("")},h=()=>{r(""),l("")};return c.jsxs("div",{className:"relative",children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:n}),c.jsxs("div",{className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>o(!a),className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm flex items-center justify-between hover:border-primary/50 transition-colors",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[c.jsx(Yf,{size:16,className:"text-dark-text-muted flex-shrink-0"}),u?c.jsxs("span",{className:"truncate",children:[c.jsxs("span",{className:"font-mono text-xs text-primary",children:[u.run_id.substring(0,12),"..."]})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{children:u.project})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{children:u.backend_name})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{className:"text-xs",children:Yn(new Date(u.created_at),"MMM dd, HH:mm")})]}):c.jsx("span",{className:"text-dark-text-muted",children:i})]}),u&&c.jsx("div",{onClick:p=>{p.stopPropagation(),h()},className:"ml-2 text-dark-text-muted hover:text-dark-text transition-colors cursor-pointer flex items-center",role:"button",tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),h())},children:c.jsx(Xk,{size:16})})]}),a&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),c.jsxs("div",{className:"absolute z-20 w-full mt-1 bg-dark-surface border border-dark-border rounded-lg shadow-xl max-h-96 overflow-hidden",children:[c.jsx("div",{className:"p-2 border-b border-dark-border",children:c.jsxs("div",{className:"relative",children:[c.jsx(Yf,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-dark-text-muted"}),c.jsx("input",{type:"text",value:s,onChange:p=>l(p.target.value),placeholder:"Type to search...",className:"w-full bg-dark-bg border border-dark-border rounded-lg pl-10 pr-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50",autoFocus:!0,onClick:p=>p.stopPropagation()})]})}),c.jsx("div",{className:"overflow-y-auto max-h-80",children:f.length===0?c.jsx("div",{className:"p-4 text-center text-dark-text-muted text-sm",children:"No runs found"}):c.jsx("div",{className:"p-1",children:f.map(p=>c.jsx("button",{onClick:()=>d(p.run_id),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${p.run_id===t?"bg-primary/20 text-primary border border-primary/30":"text-dark-text hover:bg-dark-bg"}`,children:c.jsx("div",{className:"flex items-center justify-between gap-2",children:c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsxs("span",{className:"font-mono text-xs text-primary font-semibold",children:[p.run_id.substring(0,12),"..."]}),c.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${p.status==="success"?"bg-success/20 text-success":p.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:p.status})]}),c.jsxs("div",{className:"text-xs text-dark-text-muted space-x-2",children:[c.jsx("span",{children:p.project}),c.jsx("span",{children:"•"}),c.jsx("span",{children:p.provider}),c.jsx("span",{children:"•"}),c.jsx("span",{children:p.backend_name}),c.jsx("span",{children:"•"}),c.jsx("span",{children:Yn(new Date(p.created_at),"MMM dd, HH:mm")})]})]})})},p.run_id))})})]})]})]})]})}function rP({event:e,runId:t,label:r}){const n=mt();return c.jsx("div",{className:"card",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:r}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ap,{runId:t}),c.jsx("button",{onClick:()=>n(`/runs/${t}`),className:"flex items-center gap-1 text-primary hover:text-primary/80 text-sm transition-colors",title:"View run details",children:c.jsx(nD,{size:14})})]})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Project:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.project})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Provider:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.backend.provider})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Backend:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.backend.name})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Time:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.created_at?Yn(new Date(e.created_at),"MMM dd, HH:mm"):"N/A"})]})]})]})})})}function rle({runA:e,runB:t}){var l,u,f,d,h,p,v,m,y,b;const r=k.useMemo(()=>ec(e.event,e.analysis),[e]),n=k.useMemo(()=>ec(t.event,t.analysis),[t]),i=e.analysis.metrics||{},a=t.analysis.metrics||{},o=(g,x,S="number")=>{if(g===void 0||x===void 0)return"N/A";const w=x-g,j=w>=0?"+":"";return S==="percent"?`${j}${(w*100).toFixed(1)}%`:S==="ms"?`${j}${w.toFixed(0)}ms`:S==="usd"?`${j}$${w.toFixed(4)}`:S==="s"?`${j}${w.toFixed(2)} s`:`${j}${w.toLocaleString()}`},s=(g,x,S=!1)=>{if(g===void 0||x===void 0)return"text-dark-text-muted";const w=x-g;return w===0?"text-dark-text-muted":S?w<0?"text-success":"text-error":w>0?"text-success":"text-error"};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Basic Execution Metrics"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Comparing Run A vs Run B. Delta shows change from Run A to Run B (positive = Run B is higher, negative = Run B is lower)."}),c.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Shots"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:e.event.execution.shots.toLocaleString()})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:t.event.execution.shots.toLocaleString()})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.shots,t.event.execution.shots)}`,children:["Δ: ",o(e.event.execution.shots,t.event.execution.shots)]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Success Rate"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:i["qc.quality.success_probability"]?`${(i["qc.quality.success_probability"]*100).toFixed(1)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:a["qc.quality.success_probability"]?`${(a["qc.quality.success_probability"]*100).toFixed(1)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.quality.success_probability"],a["qc.quality.success_probability"])}`,children:["Δ: ",o(i["qc.quality.success_probability"],a["qc.quality.success_probability"],"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Runtime"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:e.event.execution.runtime_ms?`${e.event.execution.runtime_ms.toLocaleString()}ms`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:t.event.execution.runtime_ms?`${t.event.execution.runtime_ms.toLocaleString()}ms`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.runtime_ms,t.event.execution.runtime_ms,!0)}`,children:["Δ: ",o(e.event.execution.runtime_ms,t.event.execution.runtime_ms,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Cost"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:i["qc.cost.estimated_usd"]?`$${i["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:a["qc.cost.estimated_usd"]?`$${a["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.cost.estimated_usd"],a["qc.cost.estimated_usd"],!0)}`,children:["Δ: ",o(i["qc.cost.estimated_usd"],a["qc.cost.estimated_usd"],"usd")]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Quality Metrics"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Entropy"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((l=i["qc.quality.shannon_entropy_bits"])==null?void 0:l.toFixed(4))||"N/A"," bits"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((u=a["qc.quality.shannon_entropy_bits"])==null?void 0:u.toFixed(4))||"N/A"," bits"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.quality.shannon_entropy_bits"],a["qc.quality.shannon_entropy_bits"])}`,children:["Δ: ",o(i["qc.quality.shannon_entropy_bits"],a["qc.quality.shannon_entropy_bits"])]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Top-1 Probability"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.top1Probability?`${(r.top1Probability*100).toFixed(3)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.top1Probability?`${(n.top1Probability*100).toFixed(3)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.top1Probability,n.top1Probability)}`,children:["Δ: ",o(r.top1Probability,n.top1Probability,"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Effective Support"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((f=r.effectiveSupportSize)==null?void 0:f.toLocaleString())||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((d=n.effectiveSupportSize)==null?void 0:d.toLocaleString())||"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.effectiveSupportSize,n.effectiveSupportSize)}`,children:["Δ: ",o(r.effectiveSupportSize,n.effectiveSupportSize)]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shot Efficiency"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Unique States"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((h=r.uniqueStates)==null?void 0:h.toLocaleString())||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((p=n.uniqueStates)==null?void 0:p.toLocaleString())||"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.uniqueStates,n.uniqueStates)}`,children:["Δ: ",o(r.uniqueStates,n.uniqueStates)]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Unique/Shots Ratio"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.uniqueStatesRatio?`${(r.uniqueStatesRatio*100).toFixed(2)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.uniqueStatesRatio?`${(n.uniqueStatesRatio*100).toFixed(2)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.uniqueStatesRatio,n.uniqueStatesRatio)}`,children:["Δ: ",o(r.uniqueStatesRatio,n.uniqueStatesRatio,"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Collision Rate"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.collisionRate?`${(r.collisionRate*100).toFixed(2)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.collisionRate?`${(n.collisionRate*100).toFixed(2)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.collisionRate,n.collisionRate,!0)}`,children:["Δ: ",o(r.collisionRate,n.collisionRate,"percent")]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runtime Analysis"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Runtime/Shot"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((v=r.runtimePerShot)==null?void 0:v.toFixed(3))||"N/A"," ms"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((m=n.runtimePerShot)==null?void 0:m.toFixed(3))||"N/A"," ms"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.runtimePerShot,n.runtimePerShot,!0)}`,children:["Δ: ",o(r.runtimePerShot,n.runtimePerShot,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Queue Time"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((y=e.event.execution.queue_ms)==null?void 0:y.toLocaleString())||"N/A"," ms"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((b=t.event.execution.queue_ms)==null?void 0:b.toLocaleString())||"N/A"," ms"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.queue_ms,t.event.execution.queue_ms,!0)}`,children:["Δ: ",o(e.event.execution.queue_ms,t.event.execution.queue_ms,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Classification"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white capitalize",children:r.runtimeClassification||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white capitalize",children:n.runtimeClassification||"N/A"})]})]})]})]})]}),(i["qc.time.cpu_s"]!=null||a["qc.time.cpu_s"]!=null||i["qc.time.qpu_s"]!=null||a["qc.time.qpu_s"]!=null||i["qc.time.queue_s"]!=null||a["qc.time.queue_s"]!=null||i["qc.time.post_processing_s"]!=null||a["qc.time.post_processing_s"]!=null)&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Execution time breakdown"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Provider-reported CPU, QPU, queue, and post-processing time (seconds). Shown when the backend supplies this metadata."}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(i["qc.time.cpu_s"]!=null||a["qc.time.cpu_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"CPU"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.cpu_s"]!=null?`${Number(i["qc.time.cpu_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.cpu_s"]!=null?`${Number(a["qc.time.cpu_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.cpu_s"],a["qc.time.cpu_s"],!0)}`,children:["Δ: ",o(i["qc.time.cpu_s"],a["qc.time.cpu_s"],"s")]})})]}),(i["qc.time.qpu_s"]!=null||a["qc.time.qpu_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"QPU"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.qpu_s"]!=null?`${Number(i["qc.time.qpu_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.qpu_s"]!=null?`${Number(a["qc.time.qpu_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.qpu_s"],a["qc.time.qpu_s"],!0)}`,children:["Δ: ",o(i["qc.time.qpu_s"],a["qc.time.qpu_s"],"s")]})})]}),(i["qc.time.queue_s"]!=null||a["qc.time.queue_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Queue (provider)"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.queue_s"]!=null?`${Number(i["qc.time.queue_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.queue_s"]!=null?`${Number(a["qc.time.queue_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.queue_s"],a["qc.time.queue_s"],!0)}`,children:["Δ: ",o(i["qc.time.queue_s"],a["qc.time.queue_s"],"s")]})})]}),(i["qc.time.post_processing_s"]!=null||a["qc.time.post_processing_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Post-processing"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.post_processing_s"]!=null?`${Number(i["qc.time.post_processing_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.post_processing_s"]!=null?`${Number(a["qc.time.post_processing_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.post_processing_s"],a["qc.time.post_processing_s"],!0)}`,children:["Δ: ",o(i["qc.time.post_processing_s"],a["qc.time.post_processing_s"],"s")]})})]})]})]})]})}function nle({runA:e,runB:t}){var r,n,i,a;return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Measurement Results Comparison"}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:e.label}),c.jsx(Fg,{counts:((n=(r=e.event.artifacts)==null?void 0:r.counts)==null?void 0:n.histogram)||{}})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:t.label}),c.jsx(Fg,{counts:((a=(i=t.event.artifacts)==null?void 0:i.counts)==null?void 0:a.histogram)||{}})]})]})]})}function ile({runA:e,runB:t}){const r=k.useMemo(()=>ec(e.event,e.analysis),[e]),n=k.useMemo(()=>ec(t.event,t.analysis),[t]),i=[{category:"Top-1",[e.label]:r.top1Probability?r.top1Probability*100:0,[t.label]:n.top1Probability?n.top1Probability*100:0},{category:"Top-5",[e.label]:r.top5Probability?r.top5Probability*100:0,[t.label]:n.top5Probability?n.top5Probability*100:0},{category:"Top-10",[e.label]:r.top10Probability?r.top10Probability*100:0,[t.label]:n.top10Probability?n.top10Probability*100:0}];return!r.top1Probability&&!n.top1Probability?null:c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Top-K Dominance Comparison"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Probability mass in top states. Higher values indicate better algorithm convergence."}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:i,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"category",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Probability (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"},formatter:a=>[`${a.toFixed(3)}%`,"Probability"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(or,{dataKey:e.label,fill:"#3b82f6",radius:[8,8,0,0]}),c.jsx(or,{dataKey:t.label,fill:"#10b981",radius:[8,8,0,0]})]})})]})}function ale({runA:e,runB:t}){const r=k.useMemo(()=>{var a;return{entropy:(a=e.analysis.metrics)==null?void 0:a["qc.quality.shannon_entropy_bits"],entropyRatio:void 0}},[e]),n=k.useMemo(()=>{var a;return{entropy:(a=t.analysis.metrics)==null?void 0:a["qc.quality.shannon_entropy_bits"],entropyRatio:void 0}},[t]);if(r.entropy===void 0&&n.entropy===void 0)return null;const i=[{metric:"Shannon Entropy",[e.label]:r.entropy||0,[t.label]:n.entropy||0}];return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Entropy Comparison"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Shannon entropy measures the randomness/uniformity of measurement distributions."}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:i,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"metric",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Entropy (bits)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"},formatter:a=>[`${a.toFixed(4)} bits`,"Entropy"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(or,{dataKey:e.label,fill:"#3b82f6",radius:[8,8,0,0]}),c.jsx(or,{dataKey:t.label,fill:"#10b981",radius:[8,8,0,0]})]})})]})}function ole(){const[e,t]=Ah(),{data:r=[],isLoading:n}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3}),staleTime:5e3}),[i,a]=k.useState(()=>e.get("runA")||""),[o,s]=k.useState(()=>e.get("runB")||"");k.useEffect(()=>{var g,x;if(r.length>0&&!i&&!o&&!e.get("runA")&&!e.get("runB")){const S=((g=r[0])==null?void 0:g.run_id)||"",w=r.length>1?((x=r[1])==null?void 0:x.run_id)||"":S;a(S),s(w),t({runA:S,runB:w},{replace:!0})}},[r,i,o,e,t]),k.useEffect(()=>{const g=new URLSearchParams;i&&g.set("runA",i),o&&g.set("runB",o),t(g,{replace:!0})},[i,o,t]);const l=r.find(g=>g.run_id===i),u=r.find(g=>g.run_id===o),f=(l==null?void 0:l.project)||"default",d=(u==null?void 0:u.project)||"default",{data:h,isLoading:p}=Qe({queryKey:["run",i],queryFn:()=>Ye.getRun(f,i),enabled:!!i,retry:2}),{data:v,isLoading:m}=Qe({queryKey:["run",o],queryFn:()=>Ye.getRun(d,o),enabled:!!o,retry:2});if(n)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading runs..."});const y=p||m,b=h&&v;return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Compare Runs"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Select two runs to compare metrics, quality, and performance"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx(tP,{runs:r,value:i,onChange:a,label:"Run A",placeholder:"Search for first run..."}),c.jsx(tP,{runs:r,value:o,onChange:s,label:"Run B",placeholder:"Search for second run..."})]}),y&&c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading run data..."}),!y&&b&&i&&o&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx(rP,{event:h.event,runId:i,label:"Run A"}),c.jsx(rP,{event:v.event,runId:o,label:"Run B"})]}),c.jsx(rle,{runA:h,runB:v}),c.jsx(ile,{runA:{event:h.event,analysis:h.analysis,runId:i,label:"Run A"},runB:{event:v.event,analysis:v.analysis,runId:o,label:"Run B"}}),c.jsx(ale,{runA:{analysis:h.analysis,runId:i,label:"Run A"},runB:{analysis:v.analysis,runId:o,label:"Run B"}}),c.jsx(nle,{runA:{event:h.event,runId:i,label:"Run A"},runB:{event:v.event,runId:o,label:"Run B"}})]}),!y&&!b&&(i||o)&&c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Please select both runs to compare"})]})}function sle({runs:e}){var i;const t=mt(),n=((i=Qe({queryKey:["runs-analyses",e.map(a=>a.run_id)],queryFn:async()=>(await Promise.all(e.slice(0,50).map(async o=>{const s=await Ye.getRun(o.project,o.run_id).catch(()=>null);return s?{run:o,res:s}:null}))).filter(Boolean)}).data)==null?void 0:i.map(({run:a,res:o})=>{var u,f,d,h;const s=(f=(u=o==null?void 0:o.analysis)==null?void 0:u.metrics)==null?void 0:f["qc.circuit.depth.post"],l=(h=(d=o==null?void 0:o.analysis)==null?void 0:d.metrics)==null?void 0:h["qc.quality.success_probability"];return s&&l!==void 0?{depth:s,success:l*100,backend:a.backend_name,runId:a.run_id,project:a.project}:null}).filter(Boolean))||[];return n.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(jT,{data:n,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"depth",name:"Circuit Depth",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Circuit Depth",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"success",name:"Success Rate",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Success Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{cursor:{strokeDasharray:"3 3"},contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"}}),c.jsx(tl,{dataKey:"success",fill:"#3b82f6",onClick:a=>{const o=a==null?void 0:a.payload;o!=null&&o.runId&&t(`/runs/${o.runId}`)},style:{cursor:"pointer"},children:n.map((a,o)=>c.jsx(vr,{fill:"#3b82f6"},`cell-${o}`))})]})})}function lle({runs:e}){var i;const t=mt(),n=((i=Qe({queryKey:["runs-analyses-cost",e.map(a=>a.run_id)],queryFn:async()=>(await Promise.all(e.slice(0,50).map(async o=>{const s=await Ye.getRun(o.project,o.run_id).catch(()=>null);return s?{run:o,res:s}:null}))).filter(Boolean)}).data)==null?void 0:i.map(({run:a,res:o})=>{var u,f,d,h;const s=(f=(u=o==null?void 0:o.analysis)==null?void 0:u.metrics)==null?void 0:f["qc.cost.estimated_usd"],l=(h=(d=o==null?void 0:o.analysis)==null?void 0:d.metrics)==null?void 0:h["qc.quality.success_probability"];return s&&s>0&&l!==void 0?{cost:s,success:l*100,backend:a.backend_name,runId:a.run_id,project:a.project}:null}).filter(Boolean))||[];return n.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No cost data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(jT,{data:n,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"cost",name:"Cost (USD)",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Cost (USD)",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"success",name:"Success Rate",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Success Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{cursor:{strokeDasharray:"3 3"},contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"}}),c.jsx(tl,{dataKey:"success",fill:"#8b5cf6",onClick:a=>{const o=a==null?void 0:a.payload;o!=null&&o.runId&&t(`/runs/${o.runId}`)},style:{cursor:"pointer"},children:n.map((a,o)=>c.jsx(vr,{fill:"#8b5cf6"},`cell-${o}`))})]})})}function ule({runs:e}){const t=k.useMemo(()=>{const n=e.reduce((i,a)=>(i[a.backend_name]||(i[a.backend_name]={success:0,total:0}),i[a.backend_name].total++,a.status==="success"&&i[a.backend_name].success++,i),{});return Object.entries(n).map(([i,a])=>({backend:i,successRate:a.total>0?a.success/a.total*100:0,totalRuns:a.total}))},[e]);if(t.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const r=Math.max(...t.map(n=>n.successRate));return c.jsx("div",{className:"space-y-4",children:t.map(n=>c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("div",{className:"w-32 text-sm text-dark-text",children:n.backend}),c.jsxs("div",{className:"flex-1 h-8 bg-dark-bg rounded-full overflow-hidden relative",children:[c.jsx("div",{className:"h-full transition-all",style:{width:`${n.successRate/r*100}%`,backgroundColor:n.successRate>70?"#10b981":n.successRate>40?"#f59e0b":"#ef4444"}}),c.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-dark-text",children:[n.successRate.toFixed(1),"% (",n.totalRuns," runs)"]})]})]},n.backend))})}function zm({value:e,label:t,max:r=100}){const n=Math.min(e/r*100,100),i=2*Math.PI*90,a=i,o=i-n/100*i,s=()=>n>=70?"#10b981":n>=40?"#f59e0b":"#ef4444";return c.jsx("div",{className:"flex flex-col items-center justify-center",children:c.jsxs("div",{className:"relative",children:[c.jsxs("svg",{width:"200",height:"200",className:"transform -rotate-90",children:[c.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:"#334155",strokeWidth:"12"}),c.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:s(),strokeWidth:"12",strokeDasharray:a,strokeDashoffset:o,strokeLinecap:"round",className:"transition-all duration-500"})]}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c.jsx("div",{className:"text-4xl font-bold text-white",children:e.toFixed(1)}),c.jsx("div",{className:"text-sm text-dark-text-muted",children:t})]})]})})}function cle(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function fle({runs:e,baseFilters:t}){const r=mt(),n=k.useMemo(()=>{const o=new Map;e.forEach(u=>{if(!u.created_at)return;const f=Yn(PT(uh(u.created_at)),"yyyy-MM-dd"),d=u.provider;o.has(f)||o.set(f,new Map);const h=o.get(f);h.has(d)||h.set(d,{total:0,count:0});const p=h.get(d);p.count+=1});const s=Array.from(o.keys()).sort(),l=Array.from(new Set(e.map(u=>u.provider))).filter(Boolean);return s.map(u=>{const f={dateLabel:Yn(uh(u),"MMM dd"),dateIso:u},d=o.get(u);return l.forEach(h=>{const p=d==null?void 0:d.get(h);p&&p.count>0&&(f[h]=p.count)}),f})},[e]);if(n.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const i=Array.from(new Set(e.map(o=>o.provider))).filter(Boolean),a=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#14b8a6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(_p,{data:n,onClick:o=>{var f,d,h;const s=o==null?void 0:o.activePayload;if(!s||s.length===0)return;const l=(f=s[0])==null?void 0:f.dataKey,u=(h=(d=s[0])==null?void 0:d.payload)==null?void 0:h.dateIso;!l||!u||r(`/runs-filtered${cle(t,{provider:String(l),startDate:`${u}T00:00:00Z`,endDate:`${u}T23:59:59Z`})}`)},children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"dateLabel",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Runs per Day",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"}}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),i.map((o,s)=>c.jsx(Ji,{type:"monotone",dataKey:o,stroke:a[s%a.length],strokeWidth:2,dot:{r:4},activeDot:{r:6},style:{cursor:"pointer"}},o))]})})}function dle(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function hle({runs:e,baseFilters:t}){const r=mt(),n=e.slice(0,50),i=Qe({queryKey:["run-details-analytics",n.map(o=>o.run_id)],queryFn:async()=>(await Promise.all(n.map(async s=>{try{const l=await Ye.getRun(s.project,s.run_id);return{run_id:s.run_id,created_at:s.created_at,runtime_ms:l.event.execution.runtime_ms||0,provider:s.provider}}catch{return null}}))).filter(Boolean),enabled:n.length>0}),a=k.useMemo(()=>{if(!i.data)return[];const o=new Map;return i.data.forEach(s=>{if(!s)return;const l=Yn(PT(uh(s.created_at)),"yyyy-MM-dd");o.has(l)||o.set(l,{total:0,count:0});const u=o.get(l);u.total+=s.runtime_ms||0,u.count+=1}),Array.from(o.entries()).map(([s,l])=>({dateLabel:Yn(uh(s),"MMM dd"),dateIso:s,avgRuntime:l.count>0?l.total/l.count:0})).sort((s,l)=>s.dateIso.localeCompare(l.dateIso))},[i.data]);return i.isLoading?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading runtime data..."}):a.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No runtime data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(OT,{data:a,onClick:o=>{var u,f;const s=o==null?void 0:o.activePayload;if(!s||s.length===0)return;const l=(f=(u=s[0])==null?void 0:u.payload)==null?void 0:f.dateIso;l&&r(`/runs-filtered${dle(t,{startDate:`${l}T00:00:00Z`,endDate:`${l}T23:59:59Z`})}`)},children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:"colorRuntime",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#3b82f6",stopOpacity:.8}),c.jsx("stop",{offset:"95%",stopColor:"#3b82f6",stopOpacity:.1})]})}),c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"dateLabel",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Avg Runtime (ms)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},formatter:o=>[`${o.toFixed(0)} ms`,"Average Runtime"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(wn,{type:"monotone",dataKey:"avgRuntime",stroke:"#3b82f6",strokeWidth:2,fillOpacity:1,fill:"url(#colorRuntime)",style:{cursor:"pointer"}})]})})}function nP(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function ple({runs:e,baseFilters:t}){const r=mt(),{chartData:n,backends:i}=k.useMemo(()=>{const o=new Map;e.forEach(p=>{const v=p.backend_name;o.has(v)||o.set(v,{total:0,success:0,totalShots:0});const m=o.get(v);m.total+=1,p.status==="success"&&(m.success+=1),m.totalShots+=p.shots||0});const s=Array.from(o.entries()).sort((p,v)=>v[1].total-p[1].total).slice(0,5),l=Math.max(...s.map(([p,v])=>v.total),1),u=Math.max(...s.map(([p,v])=>v.totalShots/v.total),1),f=s.map(([p,v])=>({backend:p.length>15?p.substring(0,15)+"...":p,"Success Rate":v.total>0?v.success/v.total*100:0,"Total Runs":v.total/l*100,"Avg Shots":v.total>0?Math.min(v.totalShots/v.total/u*100,100):0}));return{chartData:["Success Rate","Total Runs","Avg Shots"].map(p=>{const v={metric:p};return f.forEach(m=>{v[m.backend]=m[p]}),v}),backends:f.map(p=>p.backend)}},[e]);if(n.length===0||i.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const a=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Soe,{data:n,children:[c.jsx(p2,{stroke:"#334155"}),c.jsx(Js,{dataKey:"metric",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(Zs,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"}}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0",cursor:"pointer"},onClick:()=>r(`/runs-filtered${nP(t,{type:"backends"})}`)}),i.map((o,s)=>c.jsx(jc,{name:o,dataKey:o,stroke:a[s%a.length],fill:a[s%a.length],fillOpacity:.3,style:{cursor:"pointer"},onClick:()=>r(`/runs-filtered${nP(t,{type:"backends"})}`)},o))]})})}function mle({runs:e}){const t=k.useMemo(()=>{const n={"0-100":0,"101-1K":0,"1K-10K":0,"10K-100K":0,"100K+":0};return e.forEach(i=>{const a=i.shots||0;a<=100?n["0-100"]++:a<=1e3?n["101-1K"]++:a<=1e4?n["1K-10K"]++:a<=1e5?n["10K-100K"]++:n["100K+"]++}),Object.entries(n).filter(([i,a])=>a>0).map(([i,a])=>({name:i,value:a}))},[e]);if(t.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const r=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Ql,{children:[c.jsx(yr,{data:t,cx:"50%",cy:"50%",labelLine:!1,label:({name:n,percent:i})=>`${n}: ${(i*100).toFixed(0)}%`,outerRadius:120,fill:"#8884d8",dataKey:"value",children:t.map((n,i)=>c.jsx(vr,{fill:r[i%r.length]},`cell-${i}`))}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},formatter:n=>[n,"Runs"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}})]})})}function Um(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function vle({filters:e}){const t=mt(),{data:r=[],isLoading:n}=Qe({queryKey:["runs",e],queryFn:()=>Ye.getRuns({limit:1e3,...e||{}}),staleTime:5e3});if(n)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});const i=s=>{s==="success"?t(`/runs-filtered${Um(e,{type:"success"})}`):s==="backends"?t(`/runs-filtered${Um(e,{type:"backends"})}`):s==="runs"&&t(`/runs-filtered${Um(e)}`)},a=r.length>0?r.filter(s=>s.status==="success").length/r.length*100:0,o=new Set(r.map(s=>s.backend_name)).size;return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Run Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Comprehensive analysis and trends of quantum run performance"})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("success"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Overall Success Rate"}),c.jsx(zm,{value:a,label:"Success Rate"}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view successful runs"})]}),c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("backends"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Active Backends"}),c.jsx(zm,{value:o,label:"Backends",max:Math.max(o,10)}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view backend statistics"})]}),c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("runs"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Total Runs"}),c.jsx(zm,{value:r.length,label:"Runs",max:Math.max(r.length,1e3)}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view all runs"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Provider Performance Over Time"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Track run volume across different providers over time"}),c.jsx(fle,{runs:r,baseFilters:e})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Average Runtime Trend"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Monitor average execution time trends over time"}),c.jsx(hle,{runs:r,baseFilters:e})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Backend Multi-Dimensional Analysis"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Compare backends across multiple performance dimensions"}),c.jsx(ple,{runs:r,baseFilters:e})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Circuit Depth vs Success"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Relationship between circuit complexity and success rate"}),c.jsx(sle,{runs:r})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Cost vs Quality Trade-off"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Analyze the balance between execution cost and result quality"}),c.jsx(lle,{runs:r})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shots Distribution"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Distribution of runs by shots range"}),c.jsx(mle,{runs:r})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Backend Performance Heatmap"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Heatmap showing backend performance patterns"}),c.jsx(ule,{runs:r})]})]})]})}function yle({filters:e}){const t=mt(),[r,n]=k.useState(""),{data:i=[],isLoading:a}=Qe({queryKey:["algorithms"],queryFn:()=>Ye.getAlgorithms()});k.useEffect(()=>{i.length>0&&!r&&n(i[0].name)},[i,r]);const{data:o=[],isLoading:s}=Qe({queryKey:["runs",e,r],queryFn:()=>Ye.getRuns({limit:1e3,...e||{},algorithm:r||void 0}),enabled:!!r}),{data:l=[]}=Qe({queryKey:["runs",e],queryFn:()=>Ye.getRuns({limit:1e3,...e||{}})}),u=o,f=k.useMemo(()=>u.map(x=>x.run_id),[u]),{data:d}=Qe({queryKey:["run-events",f],queryFn:async()=>{const x=new Map,S=u.slice(0,100);return await Promise.all(S.map(async w=>{try{const j=await Ye.getRun(w.project,w.run_id);x.set(w.run_id,j.event)}catch(j){console.error(`Error loading event for ${w.run_id}:`,j)}})),x},enabled:u.length>0&&u.length<=100}),h=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{var O,P,A,E;let w=S.provider;if(d){const N=d.get(S.run_id);(P=(O=N==null?void 0:N.software)==null?void 0:O.sdk)!=null&&P.name?w=N.software.sdk.name:(A=N==null?void 0:N.tags)!=null&&A.sdk&&(w=N.tags.sdk)}x.has(w)||x.set(w,{success:0,total:0,totalRuntime:0,totalShots:0});const j=x.get(w);if(j.total++,S.status==="success"&&j.success++,j.totalShots+=S.shots,d){const N=d.get(S.run_id);(E=N==null?void 0:N.execution)!=null&&E.runtime_ms&&(j.totalRuntime+=N.execution.runtime_ms)}}),Array.from(x.entries()).map(([S,w])=>({sdk:S,successRate:w.total>0?w.success/w.total*100:0,avgShots:w.total>0?w.totalShots/w.total:0,avgRuntime:w.total>0&&w.totalRuntime>0?w.totalRuntime/w.total:0,totalRuns:w.total})).sort((S,w)=>w.totalRuns-S.totalRuns)},[u,d]),p=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{const w=new Date(S.created_at).toISOString().split("T")[0];x.has(w)||x.set(w,{success:0,total:0});const j=x.get(w);j.total++,S.status==="success"&&j.success++}),Array.from(x.entries()).map(([S,w])=>({date:S,successRate:w.total>0?w.success/w.total*100:0,totalRuns:w.total})).sort((S,w)=>S.date.localeCompare(w.date)).slice(-30)},[u]),v=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{const w=`${S.provider}/${S.backend_name}`;x.has(w)||x.set(w,{success:0,total:0});const j=x.get(w);j.total++,S.status==="success"&&j.success++}),Array.from(x.entries()).map(([S,w])=>({backend:S,successRate:w.total>0?w.success/w.total*100:0,totalRuns:w.total})).sort((S,w)=>w.totalRuns-S.totalRuns).slice(0,10)},[u]),m=k.useMemo(()=>{if(!d||u.length===0)return null;const x={vqe:{energies:[]},grover:{targetSuccessRates:[]},optimization:{approximationRatios:[]}};return u.slice(0,50).forEach(w=>{var A;const j=d.get(w.run_id);if(!((A=j==null?void 0:j.program)!=null&&A.benchmark_params))return;const O=j.program.benchmark_params,P=r.toLowerCase();P.includes("vqe")&&O.energy!==void 0&&x.vqe.energies.push(O.energy),P.includes("grover")&&O.expected_success_rate!==void 0&&x.grover.targetSuccessRates.push(O.expected_success_rate),(P.includes("optimization")||P.includes("qubo")||P.includes("ising"))&&O.approximation_ratio!==void 0&&x.optimization.approximationRatios.push(O.approximation_ratio)}),x.vqe.energies.length>0||x.grover.targetSuccessRates.length>0||x.optimization.approximationRatios.length>0?x:null},[u,d,r]),y=l.length>0?l.filter(x=>x.status==="success").length/l.length*100:0,b=u.length>0?u.filter(x=>x.status==="success").length/u.length*100:0,g=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#06b6d4"];return a?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading algorithms..."}):i.length===0?c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Algorithm Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:h-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Algorithm-specific performance analysis and benchmarking"})]}),c.jsxs("div",{className:"card text-center py-12",children:[c.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"No Algorithm-Tagged Runs Found"}),c.jsxs("p",{className:"text-dark-text-muted mb-4",children:["Tag your runs with an ",c.jsx("code",{className:"bg-dark-bg px-2 py-1 rounded text-primary",children:"algorithm"})," tag to see algorithm-specific metrics."]}),c.jsx("p",{className:"text-sm text-dark-text-muted",children:"Example:"}),c.jsx("pre",{className:"bg-dark-bg p-4 rounded-lg text-left text-sm text-dark-text overflow-x-auto mt-4",children:`@observe_run( + the props "valueKey" will be deprecated in 1.1.0`),b=d);var g=i.filter(function(P){return Ae(P,b,0)!==0}).length,x=(y>=360?g:g-1)*l,S=y-g*p-x,w=i.reduce(function(P,A){var E=Ae(A,b,0);return P+(H(E)?E:0)},0),j;if(w>0){var O;j=i.map(function(P,A){var E=Ae(P,b,0),N=Ae(P,f,A),T=(H(E)?E:0)/w,M;A?M=O.endAngle+Bt(m)*l*(E!==0?1:0):M=o;var R=M+Bt(m)*((E!==0?p:0)+T*S),D=(M+R)/2,L=(v.innerRadius+v.outerRadius)/2,U=[{name:N,value:E,payload:P,dataKey:b,type:h}],C=ge(v.cx,v.cy,L,D);return O=Ne(Ne(Ne({percent:T,cornerRadius:a,name:N,tooltipPayload:U,midAngle:D,middleRadius:L,tooltipPosition:C},P),v),{},{value:Ae(P,b),startAngle:M,endAngle:R,payload:P,paddingAngle:Bt(m)*l}),O})}return Ne(Ne({},v),{},{sectors:j,data:i})});function Jee(e){return e&&e.length?e[0]:void 0}var ete=Jee,tte=ete;const rte=Se(tte);var nte=["key"];function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}function ite(e,t){if(e==null)return{};var r=ate(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ate(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zd(){return zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=2&&(l=!0),u.push(Lt(Lt({},ge(o,s,g,y)),{},{name:v,value:m,cx:o,cy:s,radius:g,angle:y,payload:h}))});var d=[];return l&&u.forEach(function(h){if(Array.isArray(h.value)){var p=rte(h.value),v=re(p)?void 0:t.scale(p);d.push(Lt(Lt({},h),{},{radius:v},ge(o,s,v,h.angle)))}else d.push(h)}),{points:u,isRange:l,baseLinePoints:d}});var hte=Math.ceil,pte=Math.max;function mte(e,t,r,n){for(var i=-1,a=pte(hte((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var vte=mte,yte=FE,cO=1/0,gte=17976931348623157e292;function xte(e){if(!e)return e===0?e:0;if(e=yte(e),e===cO||e===-cO){var t=e<0?-1:1;return t*gte}return e===e?e:0}var P2=xte,bte=vte,wte=np,Cm=P2;function Ste(e){return function(t,r,n){return n&&typeof n!="number"&&wte(t,r,n)&&(r=n=void 0),t=Cm(t),r===void 0?(r=t,t=0):r=Cm(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),ur(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),ur(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),ur(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),ur(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),ur(n,"handleSlideDragStart",function(i){var a=mO(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Dte(t,e),$te(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,d=Math.min(i,a),h=Math.max(i,a),p=t.getIndexInRange(o,d),v=t.getIndexInRange(o,h);return{startIndex:p-p%l,endIndex:v===f?f:v-v%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=Ae(a[n],s,n);return te(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,f=l.width,d=l.travellerWidth,h=l.startIndex,p=l.endIndex,v=l.onChange,m=n.pageX-a;m>0?m=Math.min(m,u+f-d-s,u+f-d-o):m<0&&(m=Math.max(m,u-o,u-s));var y=this.getIndex({startX:o+m,endX:s+m});(y.startIndex!==h||y.endIndex!==p)&&v&&v(y),this.setState({startX:o+m,endX:s+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=mO(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],f=this.props,d=f.x,h=f.width,p=f.travellerWidth,v=f.onChange,m=f.gap,y=f.data,b={startX:this.state.startX,endX:this.state.endX},g=n.pageX-a;g>0?g=Math.min(g,d+h-p-u):g<0&&(g=Math.max(g,d-u)),b[o]=u+g;var x=this.getIndex(b),S=x.startIndex,w=x.endIndex,j=function(){var P=y.length-1;return o==="startX"&&(s>l?S%m===0:w%m===0)||sl?w%m===0:S%m===0)||s>l&&w===P};this.setState(ur(ur({},o,u+g),"brushMoveStartX",n.pageX),function(){v&&j()&&v(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],d=s.indexOf(f);if(d!==-1){var h=d+n;if(!(h===-1||h>=s.length)){var p=s[h];i==="startX"&&p>=u||i==="endX"&&p<=l||this.setState(ur({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return _.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,d=k.Children.only(u);return d?_.cloneElement(d,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,d=l.height,h=l.traveller,p=l.ariaLabel,v=l.data,m=l.startIndex,y=l.endIndex,b=Math.max(n,this.props.x),g=Mm(Mm({},X(this.props,!1)),{},{x:b,y:u,width:f,height:d}),x=p||"Min value: ".concat((a=v[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[y])===null||o===void 0?void 0:o.name);return _.createElement(se,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,g))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,d=Math.max(Math.abs(i-n)-u,0);return _.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:d,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,h=f.endX,p=5,v={pointerEvents:"none",fill:u};return _.createElement(se,{className:"recharts-brush-texts"},_.createElement(Wa,Wd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,h)-p,y:o+s/2},v),this.getTextOfTick(i)),_.createElement(Wa,Wd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,h)+l+p,y:o+s/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,d=n.alwaysShowText,h=this.state,p=h.startX,v=h.endX,m=h.isTextActive,y=h.isSlideMoving,b=h.isTravellerMoving,g=h.isTravellerFocused;if(!i||!i.length||!H(s)||!H(l)||!H(u)||!H(f)||u<=0||f<=0)return null;var x=oe("recharts-brush",a),S=_.Children.count(o)===1,w=Nte("userSelect","none");return _.createElement(se,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,v),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(v,"endX"),(m||y||b||g||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return _.createElement(_.Fragment,null,_.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),_.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),_.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return _.isValidElement(n)?a=_.cloneElement(n,i):te(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Mm({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?Lte({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(k.PureComponent);ur(ys,"displayName","Brush");ur(ys,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Fte=mb;function Bte(e,t){var r;return Fte(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var zte=Bte,Ute=dE,qte=jn,Wte=zte,Hte=sr,Kte=np;function Vte(e,t,r){var n=Hte(e)?Ute:Wte;return r&&Kte(e,t,r)&&(t=void 0),n(e,qte(t))}var Gte=Vte;const Qte=Se(Gte);var gn=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},vO=ME;function Yte(e,t,r){t=="__proto__"&&vO?vO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Xte=Yte,Zte=Xte,Jte=$E,ere=jn;function tre(e,t){var r={};return t=ere(t),Jte(e,function(n,i,a){Zte(r,i,t(n,i,a))}),r}var rre=tre;const nre=Se(rre);function ire(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Sre(e,t){var r=e.x,n=e.y,i=bre(e,vre),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),d="".concat(t.width||i.width),h=parseInt(d,10);return wl(wl(wl(wl(wl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function gO(e){return _.createElement(Fd,vg({shapeType:"rectangle",propTransformer:Sre,activeClassName:"recharts-active-bar"},e))}var jre=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=H(n)||SF(n);return a?t(n,i):(a||Ka(),r)}},Ore=["value","background"],N2;function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function Pre(e,t){if(e==null)return{};var r=_re(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _re(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(D)0&&Math.abs(R)0&&(M=Math.min((ce||0)-(R[V-1]||0),M))}),Number.isFinite(M)){var D=M/T,L=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(O=D*L/2),m.padding==="no-gap"){var U=zt(t.barCategoryGap,D*L),C=D*L/2;O=C-U-(C-U)/L*U}}}i==="xAxis"?P=[n.left+(x.left||0)+(O||0),n.left+n.width-(x.right||0)-(O||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(O||0),n.top+n.height-(x.bottom||0)-(O||0)]:P=m.range,w&&(P=[P[1],P[0]]);var F=HN(m,a,h),z=F.scale,G=F.realScaleType;z.domain(b).range(P),KN(z);var q=VN(z,Gr(Gr({},m),{},{realScaleType:G}));i==="xAxis"?(N=y==="top"&&!S||y==="bottom"&&S,A=n.left,E=d[j]-N*m.height):i==="yAxis"&&(N=y==="left"&&!S||y==="right"&&S,A=d[j]-N*m.width,E=n.top);var ee=Gr(Gr(Gr({},m),q),{},{realScaleType:G,x:A,y:E,scale:z,width:i==="xAxis"?n.width:m.width,height:i==="yAxis"?n.height:m.height});return ee.bandSize=kd(ee,q),!m.hide&&i==="xAxis"?d[j]+=(N?-1:1)*ee.height:m.hide||(d[j]+=(N?-1:1)*ee.width),Gr(Gr({},p),{},gp({},v,ee))},{})},M2=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},Ire=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return M2({x:r,y:n},{x:i,y:a})},R2=function(){function e(t){Mre(this,e),this.scale=t}return Rre(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();gp(R2,"EPS",1e-4);var Wb=function(t){var r=Object.keys(t).reduce(function(n,i){return Gr(Gr({},n),{},gp({},i,R2.create(t[i])))},{});return Gr(Gr({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return nre(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return E2(i,function(a,o){return r[o].isInRange(a)})}})};function Lre(e){return(e%180+180)%180}var Fre=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Lre(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?i[a?t[o]:o]:void 0}}var Wre=qre,Hre=P2;function Kre(e){var t=Hre(e),r=t%1;return t===t?r?t-r:t:0}var Vre=Kre,Gre=_E,Qre=jn,Yre=Vre,Xre=Math.max;function Zre(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:Yre(r);return i<0&&(i=Xre(n+i,0)),Gre(e,Qre(t),i)}var Jre=Zre,ene=Wre,tne=Jre,rne=ene(tne),nne=rne;const ine=Se(nne);var ane=A4(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Hb=k.createContext(void 0),Kb=k.createContext(void 0),D2=k.createContext(void 0),I2=k.createContext({}),L2=k.createContext(void 0),F2=k.createContext(0),B2=k.createContext(0),jO=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,f=ane(a);return _.createElement(Hb.Provider,{value:n},_.createElement(Kb.Provider,{value:i},_.createElement(I2.Provider,{value:a},_.createElement(D2.Provider,{value:f},_.createElement(L2.Provider,{value:o},_.createElement(F2.Provider,{value:u},_.createElement(B2.Provider,{value:l},s)))))))},one=function(){return k.useContext(L2)},z2=function(t){var r=k.useContext(Hb);r==null&&Ka();var n=r[t];return n==null&&Ka(),n},sne=function(){var t=k.useContext(Hb);return di(t)},lne=function(){var t=k.useContext(Kb),r=ine(t,function(n){return E2(n.domain,Number.isFinite)});return r||di(t)},U2=function(t){var r=k.useContext(Kb);r==null&&Ka();var n=r[t];return n==null&&Ka(),n},une=function(){var t=k.useContext(D2);return t},cne=function(){return k.useContext(I2)},Vb=function(){return k.useContext(B2)},Gb=function(){return k.useContext(F2)};function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function fne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dne(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function Vne(e,t){return Q2(e,t+1)}function Gne(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,d=function(){var v=n==null?void 0:n[l];if(v===void 0)return{v:Q2(n,u)};var m=l,y,b=function(){return y===void 0&&(y=r(v,m)),y},g=v.coordinate,x=l===0||Xd(e,g,b,f,s);x||(l=0,f=o,u+=1),x&&(f=g+e*(b()/2+i),l+=u)},h;u<=a.length;)if(h=d(),h)return h.v;return[]}function Xu(e){"@babel/helpers - typeof";return Xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xu(e)}function TO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t0?p.coordinate-y*e:p.coordinate})}else a[h]=p=Tt(Tt({},p),{},{tickCoord:p.coordinate});var b=Xd(e,p.tickCoord,m,s,l);b&&(l=p.tickCoord-e*(m()/2+i),a[h]=Tt(Tt({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function Jne(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],d=r(f,s-1),h=e*(f.coordinate+e*d/2-u);o[s-1]=f=Tt(Tt({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=Xd(e,f.tickCoord,function(){return d},l,u);p&&(u=f.tickCoord-e*(d/2+i),o[s-1]=Tt(Tt({},f),{},{isShow:!0}))}for(var v=a?s-1:s,m=function(g){var x=o[g],S,w=function(){return S===void 0&&(S=r(x,g)),S};if(g===0){var j=e*(x.coordinate-e*w()/2-l);o[g]=x=Tt(Tt({},x),{},{tickCoord:j<0?x.coordinate-j*e:x.coordinate})}else o[g]=x=Tt(Tt({},x),{},{tickCoord:x.coordinate});var O=Xd(e,x.tickCoord,w,l,u);O&&(l=x.tickCoord+e*(w()/2+i),o[g]=Tt(Tt({},x),{},{isShow:!0}))},y=0;y=2?Bt(i[1].coordinate-i[0].coordinate):1,b=Kne(a,y,p);return l==="equidistantPreserveStart"?Gne(y,b,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=Jne(y,b,m,i,o,l==="preserveStartEnd"):h=Zne(y,b,m,i,o),h.filter(function(g){return g.isShow}))}var eie=["viewBox"],tie=["viewBox"],rie=["ticks"];function Ss(e){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(e)}function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CO(e,t){for(var r=0;r0?l(this.props):l(p)),o<=0||s<=0||!v||!v.length?null:_.createElement(se,{className:oe("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),bt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=oe(i.className,"recharts-cartesian-axis-tick-value");return _.isValidElement(n)?o=_.cloneElement(n,ut(ut({},i),{},{className:s})):te(n)?o=n(ut(ut({},i),{},{className:s})):o=_.createElement(Wa,Oo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(k.Component);Zb(el,"displayName","CartesianAxis");Zb(el,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var fie=["x1","y1","x2","y2","key"],die=["offset"];function Va(e){"@babel/helpers - typeof";return Va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Va(e)}function MO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var yie=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,l=t.ry;return _.createElement("rect",{x:i,y:a,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Z2(e,t){var r;if(_.isValidElement(e))r=_.cloneElement(e,t);else if(te(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,l=RO(t,fie),u=X(l,!1);u.offset;var f=RO(u,die);r=_.createElement("line",ba({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function gie(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var u=Ct(Ct({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return Z2(i,u)});return _.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function xie(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var u=Ct(Ct({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return Z2(i,u)});return _.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function bie(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var f=s.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var v=!f[p+1],m=v?i+o-h:f[p+1]-h;if(m<=0)return null;var y=p%t.length;return _.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:m,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return _.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function wie(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var v=!f[p+1],m=v?a+s-h:f[p+1]-h;if(m<=0)return null;var y=p%n.length;return _.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:l,stroke:"none",fill:n[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return _.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var Sie=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return WN(Xb(Ct(Ct(Ct({},el.defaultProps),n),{},{ticks:In(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},jie=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return WN(Xb(Ct(Ct(Ct({},el.defaultProps),n),{},{ticks:In(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},ao={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ht(e){var t,r,n,i,a,o,s=Vb(),l=Gb(),u=cne(),f=Ct(Ct({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:ao.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:ao.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:ao.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:ao.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:ao.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:ao.verticalFill,x:H(e.x)?e.x:u.left,y:H(e.y)?e.y:u.top,width:H(e.width)?e.width:u.width,height:H(e.height)?e.height:u.height}),d=f.x,h=f.y,p=f.width,v=f.height,m=f.syncWithTicks,y=f.horizontalValues,b=f.verticalValues,g=sne(),x=lne();if(!H(p)||p<=0||!H(v)||v<=0||!H(d)||d!==+d||!H(h)||h!==+h)return null;var S=f.verticalCoordinatesGenerator||Sie,w=f.horizontalCoordinatesGenerator||jie,j=f.horizontalPoints,O=f.verticalPoints;if((!j||!j.length)&&te(w)){var P=y&&y.length,A=w({yAxis:x?Ct(Ct({},x),{},{ticks:P?y:x.ticks}):void 0,width:s,height:l,offset:u},P?!0:m);en(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Va(A),"]")),Array.isArray(A)&&(j=A)}if((!O||!O.length)&&te(S)){var E=b&&b.length,N=S({xAxis:g?Ct(Ct({},g),{},{ticks:E?b:g.ticks}):void 0,width:s,height:l,offset:u},E?!0:m);en(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Va(N),"]")),Array.isArray(N)&&(O=N)}return _.createElement("g",{className:"recharts-cartesian-grid"},_.createElement(yie,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),_.createElement(gie,ba({},f,{offset:u,horizontalPoints:j,xAxis:g,yAxis:x})),_.createElement(xie,ba({},f,{offset:u,verticalPoints:O,xAxis:g,yAxis:x})),_.createElement(bie,ba({},f,{horizontalPoints:j})),_.createElement(wie,ba({},f,{verticalPoints:O})))}Ht.displayName="CartesianGrid";var Oie=["type","layout","connectNulls","ref"],Pie=["key"];function js(e){"@babel/helpers - typeof";return js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},js(e)}function DO(e,t){if(e==null)return{};var r=_ie(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _ie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rd){p=[].concat(oo(l.slice(0,v)),[d-m]);break}var y=p.length%2===0?[0,h]:[h];return[].concat(oo(t.repeat(l,f)),oo(p),y).map(function(b){return"".concat(b,"px")}).join(", ")}),Qr(r,"id",Qi("recharts-line-")),Qr(r,"pathRef",function(o){r.mainCurve=o}),Qr(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Qr(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Die(t,e),$ie(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,f=a.children,d=Wt(f,Ys);if(!d)return null;var h=function(m,y){return{x:m.x,y:m.y,value:m.value,errorVal:Ae(m.payload,y)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return _.createElement(se,p,d.map(function(v){return _.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,d=X(this.props,!1),h=X(l,!0),p=u.map(function(m,y){var b=lr(lr(lr({key:"dot-".concat(y),r:3},d),h),{},{index:y,cx:m.x,cy:m.y,value:m.value,dataKey:f,payload:m.payload,points:u});return t.renderDotItem(l,b)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return _.createElement(se,Kl({className:"recharts-line-dots",key:"dots"},v),p)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,f=s.connectNulls;s.ref;var d=DO(s,Oie),h=lr(lr(lr({},X(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:f});return _.createElement(Li,Kl({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,h=o.animationEasing,p=o.animationId,v=o.animateNewValues,m=o.width,y=o.height,b=this.state,g=b.prevPoints,x=b.totalLength;return _.createElement(xr,{begin:f,duration:d,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(g){var j=g.length/s.length,O=s.map(function(T,M){var R=Math.floor(M*j);if(g[R]){var D=g[R],L=ke(D.x,T.x),U=ke(D.y,T.y);return lr(lr({},T),{},{x:L(w),y:U(w)})}if(v){var C=ke(m*2,T.x),F=ke(y/2,T.y);return lr(lr({},T),{},{x:C(w),y:F(w)})}return lr(lr({},T),{},{x:T.x,y:T.y})});return a.renderCurveStatically(O,n,i)}var P=ke(0,x),A=P(w),E;if(l){var N="".concat(l).split(/[,\s]+/gim).map(function(T){return parseFloat(T)});E=a.getStrokeDasharray(A,x,N)}else E=a.generateSimpleStrokeDasharray(x,A);return a.renderCurveStatically(s,n,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,f=l.totalLength;return s&&o&&o.length&&(!u&&f>0||!Gn(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.xAxis,f=i.yAxis,d=i.top,h=i.left,p=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,g=s.length===1,x=oe("recharts-line",l),S=u&&u.allowDataOverflow,w=f&&f.allowDataOverflow,j=S||w,O=re(y)?this.id:y,P=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=P.r,E=A===void 0?3:A,N=P.strokeWidth,T=N===void 0?2:N,M=IA(o)?o:{},R=M.clipDot,D=R===void 0?!0:R,L=E*2+T;return _.createElement(se,{className:x},S||w?_.createElement("defs",null,_.createElement("clipPath",{id:"clipPath-".concat(O)},_.createElement("rect",{x:S?h:h-p/2,y:w?d:d-v/2,width:S?p:p*2,height:w?v:v*2})),!D&&_.createElement("clipPath",{id:"clipPath-dots-".concat(O)},_.createElement("rect",{x:h-L/2,y:d-L/2,width:p+L,height:v+L}))):null,!g&&this.renderCurve(j,O),this.renderErrorBar(j,O),(g||o)&&this.renderDots(j,D,O),(!m||b)&&Mr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(oo(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Gn(f,o)||!Gn(d,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,f=i.left,d=i.xAxis,h=i.yAxis,p=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,g=s.length===1,x=oe("recharts-area",l),S=d&&d.allowDataOverflow,w=h&&h.allowDataOverflow,j=S||w,O=re(y)?this.id:y,P=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=P.r,E=A===void 0?3:A,N=P.strokeWidth,T=N===void 0?2:N,M=IA(o)?o:{},R=M.clipDot,D=R===void 0?!0:R,L=E*2+T;return _.createElement(se,{className:x},S||w?_.createElement("defs",null,_.createElement("clipPath",{id:"clipPath-".concat(O)},_.createElement("rect",{x:S?f:f-p/2,y:w?u:u-v/2,width:S?p:p*2,height:w?v:v*2})),!D&&_.createElement("clipPath",{id:"clipPath-dots-".concat(O)},_.createElement("rect",{x:f-L/2,y:u-L/2,width:p+L,height:v+L}))):null,g?null:this.renderArea(j,O),(o||g)&&this.renderDots(j,D,O),(!m||b)&&Mr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(k.PureComponent);tT=wn;pn(wn,"displayName","Area");pn(wn,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!On.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});pn(wn,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(H(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return s==="dataMin"?d:s==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});pn(wn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=t.layout,v=u&&u.length,m=tT.getBaseValue(t,r,n,i),y=p==="horizontal",b=!1,g=d.map(function(S,w){var j;v?j=u[f+w]:(j=Ae(S,l),Array.isArray(j)?b=!0:j=[m,j]);var O=j[1]==null||v&&Ae(S,l)==null;return y?{x:cs({axis:n,ticks:a,bandSize:s,entry:S,index:w}),y:O?null:i.scale(j[1]),value:j,payload:S}:{x:O?null:n.scale(j[1]),y:cs({axis:i,ticks:o,bandSize:s,entry:S,index:w}),value:j,payload:S}}),x;return v||b?x=g.map(function(S){var w=Array.isArray(S.value)?S.value[0]:null;return y?{x:S.x,y:w!=null&&S.y!=null?i.scale(w):null}:{x:w!=null?n.scale(w):null,y:S.y}}):x=y?i.scale(m):n.scale(m),oi({points:g,baseLine:x,layout:p,isRange:b},h)});pn(wn,"renderDotItem",function(e,t){var r;if(_.isValidElement(e))r=_.cloneElement(e,t);else if(te(e))r=e(t);else{var n=oe("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=rT(t,Fie);r=_.createElement(Xs,wa({},a,{key:i,className:n}))}return r});function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function Gie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qie(e,t){for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function aae(e){var t=e.option,r=e.isActive,n=nae(e,rae);return typeof t=="string"?k.createElement(Fd,Vl({option:k.createElement(ep,Vl({type:t},n)),isActive:r,shapeType:"symbols"},n)):k.createElement(Fd,Vl({option:t,isActive:r,shapeType:"symbols"},n))}function _s(e){"@babel/helpers - typeof";return _s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(e)}function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function toe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function roe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&H(i)&&H(a)?t.slice(i,a+1):[]};function jT(e){return e==="number"?[0,"auto"]:void 0}var Lg=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Pp(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=d===void 0?s:d;h=Zf(p,o.dataKey,i)}else h=d&&d[n]||s[n];return h?[].concat(Ns(l),[QN(u,h)]):l},[])},GO=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=poe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=RQ(o,s,u,l);if(f>=0&&u){var d=u[f]&&u[f].value,h=Lg(t,r,f,d),p=moe(n,s,f,a);return{activeTooltipIndex:f,activeLabel:d,activePayload:h,activeCoordinate:p}}return null},voe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=t.stackOffset,p=qN(f,a);return n.reduce(function(v,m){var y,b=m.type.defaultProps!==void 0?B(B({},m.type.defaultProps),m.props):m.props,g=b.type,x=b.dataKey,S=b.allowDataOverflow,w=b.allowDuplicatedCategory,j=b.scale,O=b.ticks,P=b.includeHidden,A=b[o];if(v[A])return v;var E=Pp(t.data,{graphicalItems:i.filter(function(q){var ee,ce=o in q.props?q.props[o]:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee[o];return ce===A}),dataStartIndex:l,dataEndIndex:u}),N=E.length,T,M,R;Uae(b.domain,S,g)&&(T=Gy(b.domain,null,S),p&&(g==="number"||j!=="auto")&&(R=Ul(E,x,"category")));var D=jT(g);if(!T||T.length===0){var L,U=(L=b.domain)!==null&&L!==void 0?L:D;if(x){if(T=Ul(E,x,g),g==="category"&&p){var C=OF(T);w&&C?(M=T,T=qd(0,N)):w||(T=dj(U,T,m).reduce(function(q,ee){return q.indexOf(ee)>=0?q:[].concat(Ns(q),[ee])},[]))}else if(g==="category")w?T=T.filter(function(q){return q!==""&&!re(q)}):T=dj(U,T,m).reduce(function(q,ee){return q.indexOf(ee)>=0||ee===""||re(ee)?q:[].concat(Ns(q),[ee])},[]);else if(g==="number"){var F=BQ(E,i.filter(function(q){var ee,ce,V=o in q.props?q.props[o]:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee[o],ie="hide"in q.props?q.props.hide:(ce=q.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return V===A&&(P||!ie)}),x,a,f);F&&(T=F)}p&&(g==="number"||j!=="auto")&&(R=Ul(E,x,"category"))}else p?T=qd(0,N):s&&s[A]&&s[A].hasStack&&g==="number"?T=h==="expand"?[0,1]:GN(s[A].stackGroups,l,u):T=UN(E,i.filter(function(q){var ee=o in q.props?q.props[o]:q.type.defaultProps[o],ce="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return ee===A&&(P||!ce)}),g,f,!0);if(g==="number")T=Rg(d,T,A,a,O),U&&(T=Gy(U,T,S));else if(g==="category"&&U){var z=U,G=T.every(function(q){return z.indexOf(q)>=0});G&&(T=z)}}return B(B({},v),{},ae({},A,B(B({},b),{},{axisType:a,domain:T,categoricalDomain:R,duplicateDomain:M,originalDomain:(y=b.domain)!==null&&y!==void 0?y:D,isCategorical:p,layout:f})))},{})},yoe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=Pp(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),p=h.length,v=qN(f,a),m=-1;return n.reduce(function(y,b){var g=b.type.defaultProps!==void 0?B(B({},b.type.defaultProps),b.props):b.props,x=g[o],S=jT("number");if(!y[x]){m++;var w;return v?w=qd(0,p):s&&s[x]&&s[x].hasStack?(w=GN(s[x].stackGroups,l,u),w=Rg(d,w,x,a)):(w=Gy(S,UN(h,n.filter(function(j){var O,P,A=o in j.props?j.props[o]:(O=j.type.defaultProps)===null||O===void 0?void 0:O[o],E="hide"in j.props?j.props.hide:(P=j.type.defaultProps)===null||P===void 0?void 0:P.hide;return A===x&&!E}),"number",f),i.defaultProps.allowDataOverflow),w=Rg(d,w,x,a)),B(B({},y),{},ae({},x,B(B({axisType:a},i.defaultProps),{},{hide:!0,orientation:mr(doe,"".concat(a,".").concat(m%2),null),domain:w,originalDomain:S,isCategorical:v,layout:f})))}return y},{})},goe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(i,"Id"),h=Wt(f,a),p={};return h&&h.length?p=voe(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(p=yoe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),p},xoe=function(t){var r=di(t),n=In(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:vb(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:kd(r,n)}},QO=function(t){var r=t.children,n=t.defaultShowTooltip,i=fr(r,ys),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},boe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Fn(r&&r.type);return n&&n.indexOf("Bar")>=0})},YO=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},woe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,d=n.children,h=n.margin||{},p=fr(d,ys),v=fr(d,ar),m=Object.keys(l).reduce(function(w,j){var O=l[j],P=O.orientation;return!O.mirror&&!O.hide?B(B({},w),{},ae({},P,w[P]+O.width)):w},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(w,j){var O=o[j],P=O.orientation;return!O.mirror&&!O.hide?B(B({},w),{},ae({},P,mr(w,"".concat(P))+O.height)):w},{top:h.top||0,bottom:h.bottom||0}),b=B(B({},y),m),g=b.bottom;p&&(b.bottom+=p.props.height||ys.defaultProps.height),v&&r&&(b=LQ(b,i,n,r));var x=u-b.left-b.right,S=f-b.top-b.bottom;return B(B({brushBottom:g},b),{},{width:Math.max(x,0),height:Math.max(S,0)})},Soe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},rl=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,h=function(b,g){var x=g.graphicalItems,S=g.stackGroups,w=g.offset,j=g.updateId,O=g.dataStartIndex,P=g.dataEndIndex,A=b.barSize,E=b.layout,N=b.barGap,T=b.barCategoryGap,M=b.maxBarSize,R=YO(E),D=R.numericAxisName,L=R.cateAxisName,U=boe(x),C=[];return x.forEach(function(F,z){var G=Pp(b.data,{graphicalItems:[F],dataStartIndex:O,dataEndIndex:P}),q=F.type.defaultProps!==void 0?B(B({},F.type.defaultProps),F.props):F.props,ee=q.dataKey,ce=q.maxBarSize,V=q["".concat(D,"Id")],ie=q["".concat(L,"Id")],Le={},ot=l.reduce(function(ea,ta){var Ep=g["".concat(ta.axisType,"Map")],Jb=q["".concat(ta.axisType,"Id")];Ep&&Ep[Jb]||ta.axisType==="zAxis"||Ka();var e0=Ep[Jb];return B(B({},ea),{},ae(ae({},ta.axisType,e0),"".concat(ta.axisType,"Ticks"),In(e0)))},Le),Q=ot[L],le=ot["".concat(L,"Ticks")],fe=S&&S[V]&&S[V].hasStack&&QQ(F,S[V].stackGroups),W=Fn(F.type).indexOf("Bar")>=0,We=kd(Q,le),me=[],st=U&&DQ({barSize:A,stackGroups:S,totalSize:Soe(ot,L)});if(W){var lt,Gt,ti=re(ce)?M:ce,to=(lt=(Gt=kd(Q,le,!0))!==null&&Gt!==void 0?Gt:ti)!==null&<!==void 0?lt:0;me=IQ({barGap:N,barCategoryGap:T,bandSize:to!==We?to:We,sizeList:st[ie],maxBarSize:ti}),to!==We&&(me=me.map(function(ea){return B(B({},ea),{},{position:B(B({},ea.position),{},{offset:ea.position.offset-to/2})})}))}var Oc=F&&F.type&&F.type.getComposedData;Oc&&C.push({props:B(B({},Oc(B(B({},ot),{},{displayedData:G,props:b,dataKey:ee,item:F,bandSize:We,barPosition:me,offset:w,stackedData:fe,layout:E,dataStartIndex:O,dataEndIndex:P}))),{},ae(ae(ae({key:F.key||"item-".concat(z)},D,ot[D]),L,ot[L]),"animationId",j)),childIndex:IF(F,b.children),item:F})}),C},p=function(b,g){var x=b.props,S=b.dataStartIndex,w=b.dataEndIndex,j=b.updateId;if(!o1({props:x}))return null;var O=x.children,P=x.layout,A=x.stackOffset,E=x.data,N=x.reverseStackOrder,T=YO(P),M=T.numericAxisName,R=T.cateAxisName,D=Wt(O,n),L=VQ(E,D,"".concat(M,"Id"),"".concat(R,"Id"),A,N),U=l.reduce(function(q,ee){var ce="".concat(ee.axisType,"Map");return B(B({},q),{},ae({},ce,goe(x,B(B({},ee),{},{graphicalItems:D,stackGroups:ee.axisType===M&&L,dataStartIndex:S,dataEndIndex:w}))))},{}),C=woe(B(B({},U),{},{props:x,graphicalItems:D}),g==null?void 0:g.legendBBox);Object.keys(U).forEach(function(q){U[q]=f(x,U[q],C,q.replace("Map",""),r)});var F=U["".concat(R,"Map")],z=xoe(F),G=h(x,B(B({},U),{},{dataStartIndex:S,dataEndIndex:w,updateId:j,graphicalItems:D,stackGroups:L,offset:C}));return B(B({formattedGraphicalItems:G,graphicalItems:D,offset:C,stackGroups:L},z),U)},v=function(y){function b(g){var x,S,w;return toe(this,b),w=ioe(this,b,[g]),ae(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ae(w,"accessibilityManager",new zae),ae(w,"handleLegendBBoxUpdate",function(j){if(j){var O=w.state,P=O.dataStartIndex,A=O.dataEndIndex,E=O.updateId;w.setState(B({legendBBox:j},p({props:w.props,dataStartIndex:P,dataEndIndex:A,updateId:E},B(B({},w.state),{},{legendBBox:j}))))}}),ae(w,"handleReceiveSyncEvent",function(j,O,P){if(w.props.syncId===j){if(P===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),ae(w,"handleBrushChange",function(j){var O=j.startIndex,P=j.endIndex;if(O!==w.state.dataStartIndex||P!==w.state.dataEndIndex){var A=w.state.updateId;w.setState(function(){return B({dataStartIndex:O,dataEndIndex:P},p({props:w.props,dataStartIndex:O,dataEndIndex:P,updateId:A},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:P})}}),ae(w,"handleMouseEnter",function(j){var O=w.getMouseInfo(j);if(O){var P=B(B({},O),{},{isTooltipActive:!0});w.setState(P),w.triggerSyncEvent(P);var A=w.props.onMouseEnter;te(A)&&A(P,j)}}),ae(w,"triggeredAfterMouseMove",function(j){var O=w.getMouseInfo(j),P=O?B(B({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(P),w.triggerSyncEvent(P);var A=w.props.onMouseMove;te(A)&&A(P,j)}),ae(w,"handleItemMouseEnter",function(j){w.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),ae(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),ae(w,"handleMouseMove",function(j){j.persist(),w.throttleTriggeredAfterMouseMove(j)}),ae(w,"handleMouseLeave",function(j){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var P=w.props.onMouseLeave;te(P)&&P(O,j)}),ae(w,"handleOuterEvent",function(j){var O=DF(j),P=mr(w.props,"".concat(O));if(O&&te(P)){var A,E;/.*touch.*/i.test(O)?E=w.getMouseInfo(j.changedTouches[0]):E=w.getMouseInfo(j),P((A=E)!==null&&A!==void 0?A:{},j)}}),ae(w,"handleClick",function(j){var O=w.getMouseInfo(j);if(O){var P=B(B({},O),{},{isTooltipActive:!0});w.setState(P),w.triggerSyncEvent(P);var A=w.props.onClick;te(A)&&A(P,j)}}),ae(w,"handleMouseDown",function(j){var O=w.props.onMouseDown;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleMouseUp",function(j){var O=w.props.onMouseUp;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),ae(w,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseDown(j.changedTouches[0])}),ae(w,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseUp(j.changedTouches[0])}),ae(w,"handleDoubleClick",function(j){var O=w.props.onDoubleClick;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleContextMenu",function(j){var O=w.props.onContextMenu;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"triggerSyncEvent",function(j){w.props.syncId!==void 0&&Dm.emit(Im,w.props.syncId,j,w.eventEmitterSymbol)}),ae(w,"applySyncEvent",function(j){var O=w.props,P=O.layout,A=O.syncMethod,E=w.state.updateId,N=j.dataStartIndex,T=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)w.setState(B({dataStartIndex:N,dataEndIndex:T},p({props:w.props,dataStartIndex:N,dataEndIndex:T,updateId:E},w.state)));else if(j.activeTooltipIndex!==void 0){var M=j.chartX,R=j.chartY,D=j.activeTooltipIndex,L=w.state,U=L.offset,C=L.tooltipTicks;if(!U)return;if(typeof A=="function")D=A(C,j);else if(A==="value"){D=-1;for(var F=0;F=0){var fe,W;if(M.dataKey&&!M.allowDuplicatedCategory){var We=typeof M.dataKey=="function"?le:"payload.".concat(M.dataKey.toString());fe=Zf(F,We,D),W=z&&G&&Zf(G,We,D)}else fe=F==null?void 0:F[R],W=z&&G&&G[R];if(ie||V){var me=j.props.activeIndex!==void 0?j.props.activeIndex:R;return[k.cloneElement(j,B(B(B({},A.props),ot),{},{activeIndex:me})),null,null]}if(!re(fe))return[Q].concat(Ns(w.renderActivePoints({item:A,activePoint:fe,basePoint:W,childIndex:R,isRange:z})))}else{var st,lt=(st=w.getItemByXY(w.state.activeCoordinate))!==null&&st!==void 0?st:{graphicalItem:Q},Gt=lt.graphicalItem,ti=Gt.item,to=ti===void 0?j:ti,Oc=Gt.childIndex,ea=B(B(B({},A.props),ot),{},{activeIndex:Oc});return[k.cloneElement(to,ea),null,null]}return z?[Q,null,null]:[Q,null]}),ae(w,"renderCustomized",function(j,O,P){return k.cloneElement(j,B(B({key:"recharts-customized-".concat(P)},w.props),w.state))}),ae(w,"renderMap",{CartesianGrid:{handler:of,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:of},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:of},YAxis:{handler:of},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=g.id)!==null&&x!==void 0?x:Qi("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=BE(w.triggeredAfterMouseMove,(S=g.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return soe(b,y),noe(b,[{key:"componentDidMount",value:function(){var x,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,S=x.children,w=x.data,j=x.height,O=x.layout,P=fr(S,$e);if(P){var A=P.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var E=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,N=Lg(this.state,w,A,E),T=this.state.tooltipTicks[A].coordinate,M=(this.state.offset.top+j)/2,R=O==="horizontal",D=R?{x:T,y:M}:{y:T,x:M},L=this.state.formattedGraphicalItems.find(function(C){var F=C.item;return F.type.name==="Scatter"});L&&(D=B(B({},D),L.props.points[A].tooltipPosition),N=L.props.points[A].tooltipPayload);var U={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:E,activePayload:N,activeCoordinate:D};this.setState(U),this.renderCursor(P),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,j;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(x){uy([fr(x.children,$e)],[fr(this.props.children,$e)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=fr(this.props.children,$e);if(x&&typeof x.props.shared=="boolean"){var S=x.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),j=uK(w),O={chartX:Math.round(x.pageX-j.left),chartY:Math.round(x.pageY-j.top)},P=w.width/S.offsetWidth||1,A=this.inRange(O.chartX,O.chartY,P);if(!A)return null;var E=this.state,N=E.xAxisMap,T=E.yAxisMap,M=this.getTooltipEventType(),R=GO(this.state,this.props.data,this.props.layout,A);if(M!=="axis"&&N&&T){var D=di(N).scale,L=di(T).scale,U=D&&D.invert?D.invert(O.chartX):null,C=L&&L.invert?L.invert(O.chartY):null;return B(B({},O),{},{xValue:U,yValue:C},R)}return R?B(B({},O),R):null}},{key:"inRange",value:function(x,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,O=x/w,P=S/w;if(j==="horizontal"||j==="vertical"){var A=this.state.offset,E=O>=A.left&&O<=A.left+A.width&&P>=A.top&&P<=A.top+A.height;return E?{x:O,y:P}:null}var N=this.state,T=N.angleAxisMap,M=N.radiusAxisMap;if(T&&M){var R=di(T);return mj({x:O,y:P},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,S=this.getTooltipEventType(),w=fr(x,$e),j={};w&&S==="axis"&&(w.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Jf(this.props,this.handleOuterEvent);return B(B({},O),j)}},{key:"addListener",value:function(){Dm.on(Im,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dm.removeListener(Im,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,S,w){for(var j=this.state.formattedGraphicalItems,O=0,P=j.length;O{const u=e.reduce((f,d)=>(f[d.status]=(f[d.status]||0)+1,f),{});return Object.entries(u).map(([f,d])=>({name:f.charAt(0).toUpperCase()+f.slice(1),value:d,status:f,color:XO[f]||XO.default}))},[e]),i=u=>{u&&u.status&&(t?t(u.status):r(`/?status=${u.status}`))};if(n.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const a=n.reduce((u,f)=>u+f.value,0),o=n.length>1,s=u=>`${u.name}: ${u.value}`,l=({active:u,payload:f})=>{if(u&&f&&f.length){const d=f[0].payload,h=a>0?(d.value/a*100).toFixed(1):0;return c.jsxs("div",{className:"bg-dark-surface border border-dark-border rounded-lg p-3 shadow-lg",children:[c.jsx("p",{className:"text-white font-semibold",children:d.name}),c.jsxs("p",{className:"text-dark-text-muted text-sm",children:["Count: ",c.jsx("span",{className:"text-white font-medium",children:d.value})]}),c.jsxs("p",{className:"text-dark-text-muted text-sm",children:["Percentage: ",c.jsxs("span",{className:"text-white font-medium",children:[h,"%"]})]})]})}return null};return c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ql,{children:[c.jsx(yr,{data:n,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:o?2:0,dataKey:"value",onClick:i,style:{cursor:"pointer"},label:s,labelLine:!1,children:n.map((u,f)=>c.jsx(vr,{fill:u.color},`cell-${f}`))}),c.jsx($e,{content:c.jsx(l,{})}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"},iconType:"circle",formatter:(u,f)=>{const d=a>0?(f.payload.value/a*100).toFixed(1):0;return`${u} (${f.payload.value}, ${d}%)`}})]})})}function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function Ui(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function At(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function an(e){At(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||oh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Poe(e,t){At(2,arguments);var r=an(e).getTime(),n=Ui(t);return new Date(r+n)}var _oe={};function kp(){return _oe}function koe(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function _T(e){At(1,arguments);var t=an(e);return t.setHours(0,0,0,0),t}var kT=6e4,AT=36e5;function Aoe(e){return At(1,arguments),e instanceof Date||oh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Eoe(e){if(At(1,arguments),!Aoe(e)&&typeof e!="number")return!1;var t=an(e);return!isNaN(Number(t))}function Noe(e,t){At(2,arguments);var r=Ui(t);return Poe(e,-r)}var Toe=864e5;function $oe(e){At(1,arguments);var t=an(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=r-n;return Math.floor(i/Toe)+1}function sh(e){At(1,arguments);var t=1,r=an(e),n=r.getUTCDay(),i=(n=i.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function Coe(e){At(1,arguments);var t=ET(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=sh(r);return n}var Moe=6048e5;function Roe(e){At(1,arguments);var t=an(e),r=sh(t).getTime()-Coe(t).getTime();return Math.round(r/Moe)+1}function lh(e,t){var r,n,i,a,o,s,l,u;At(1,arguments);var f=kp(),d=Ui((r=(n=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:f.weekStartsOn)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=an(e),p=h.getUTCDay(),v=(p=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,p),v.setUTCHours(0,0,0,0);var m=lh(v,t),y=new Date(0);y.setUTCFullYear(d,0,p),y.setUTCHours(0,0,0,0);var b=lh(y,t);return f.getTime()>=m.getTime()?d+1:f.getTime()>=b.getTime()?d:d-1}function Doe(e,t){var r,n,i,a,o,s,l,u;At(1,arguments);var f=kp(),d=Ui((r=(n=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1),h=NT(e,t),p=new Date(0);p.setUTCFullYear(h,0,d),p.setUTCHours(0,0,0,0);var v=lh(p,t);return v}var Ioe=6048e5;function Loe(e,t){At(1,arguments);var r=an(e),n=lh(r,t).getTime()-Doe(r,t).getTime();return Math.round(n/Ioe)+1}function je(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return je(r==="yy"?i%100:i,r.length)},M:function(t,r){var n=t.getUTCMonth();return r==="M"?String(n+1):je(n+1,2)},d:function(t,r){return je(t.getUTCDate(),r.length)},a:function(t,r){var n=t.getUTCHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,r){return je(t.getUTCHours()%12||12,r.length)},H:function(t,r){return je(t.getUTCHours(),r.length)},m:function(t,r){return je(t.getUTCMinutes(),r.length)},s:function(t,r){return je(t.getUTCSeconds(),r.length)},S:function(t,r){var n=r.length,i=t.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return je(a,r.length)}},so={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Foe={G:function(t,r,n){var i=t.getUTCFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,r,n){if(r==="yo"){var i=t.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return ii.y(t,r)},Y:function(t,r,n,i){var a=NT(t,i),o=a>0?a:1-a;if(r==="YY"){var s=o%100;return je(s,2)}return r==="Yo"?n.ordinalNumber(o,{unit:"year"}):je(o,r.length)},R:function(t,r){var n=ET(t);return je(n,r.length)},u:function(t,r){var n=t.getUTCFullYear();return je(n,r.length)},Q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"Q":return String(i);case"QQ":return je(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"q":return String(i);case"qq":return je(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,r,n){var i=t.getUTCMonth();switch(r){case"M":case"MM":return ii.M(t,r);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,r,n){var i=t.getUTCMonth();switch(r){case"L":return String(i+1);case"LL":return je(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,r,n,i){var a=Loe(t,i);return r==="wo"?n.ordinalNumber(a,{unit:"week"}):je(a,r.length)},I:function(t,r,n){var i=Roe(t);return r==="Io"?n.ordinalNumber(i,{unit:"week"}):je(i,r.length)},d:function(t,r,n){return r==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):ii.d(t,r)},D:function(t,r,n){var i=$oe(t);return r==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):je(i,r.length)},E:function(t,r,n){var i=t.getUTCDay();switch(r){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,r,n,i){var a=t.getUTCDay(),o=(a-i.weekStartsOn+8)%7||7;switch(r){case"e":return String(o);case"ee":return je(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,r,n,i){var a=t.getUTCDay(),o=(a-i.weekStartsOn+8)%7||7;switch(r){case"c":return String(o);case"cc":return je(o,r.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,r,n){var i=t.getUTCDay(),a=i===0?7:i;switch(r){case"i":return String(a);case"ii":return je(a,r.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,r,n){var i=t.getUTCHours(),a=i/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,r,n){var i=t.getUTCHours(),a;switch(i===12?a=so.noon:i===0?a=so.midnight:a=i/12>=1?"pm":"am",r){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,r,n){var i=t.getUTCHours(),a;switch(i>=17?a=so.evening:i>=12?a=so.afternoon:i>=4?a=so.morning:a=so.night,r){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,r,n){if(r==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return ii.h(t,r)},H:function(t,r,n){return r==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):ii.H(t,r)},K:function(t,r,n){var i=t.getUTCHours()%12;return r==="Ko"?n.ordinalNumber(i,{unit:"hour"}):je(i,r.length)},k:function(t,r,n){var i=t.getUTCHours();return i===0&&(i=24),r==="ko"?n.ordinalNumber(i,{unit:"hour"}):je(i,r.length)},m:function(t,r,n){return r==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):ii.m(t,r)},s:function(t,r,n){return r==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):ii.s(t,r)},S:function(t,r){return ii.S(t,r)},X:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();if(o===0)return"Z";switch(r){case"X":return JO(o);case"XXXX":case"XX":return ca(o);case"XXXXX":case"XXX":default:return ca(o,":")}},x:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"x":return JO(o);case"xxxx":case"xx":return ca(o);case"xxxxx":case"xxx":default:return ca(o,":")}},O:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+ZO(o,":");case"OOOO":default:return"GMT"+ca(o,":")}},z:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+ZO(o,":");case"zzzz":default:return"GMT"+ca(o,":")}},t:function(t,r,n,i){var a=i._originalDate||t,o=Math.floor(a.getTime()/1e3);return je(o,r.length)},T:function(t,r,n,i){var a=i._originalDate||t,o=a.getTime();return je(o,r.length)}};function ZO(e,t){var r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return r+String(i);var o=t;return r+String(i)+o+je(a,2)}function JO(e,t){if(e%60===0){var r=e>0?"-":"+";return r+je(Math.abs(e)/60,2)}return ca(e,t)}function ca(e,t){var r=t||"",n=e>0?"-":"+",i=Math.abs(e),a=je(Math.floor(i/60),2),o=je(i%60,2);return n+a+r+o}var eP=function(t,r){switch(t){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},TT=function(t,r){switch(t){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Boe=function(t,r){var n=t.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return eP(t,r);var o;switch(i){case"P":o=r.dateTime({width:"short"});break;case"PP":o=r.dateTime({width:"medium"});break;case"PPP":o=r.dateTime({width:"long"});break;case"PPPP":default:o=r.dateTime({width:"full"});break}return o.replace("{{date}}",eP(i,r)).replace("{{time}}",TT(a,r))},zoe={p:TT,P:Boe},Uoe=["D","DD"],qoe=["YY","YYYY"];function Woe(e){return Uoe.indexOf(e)!==-1}function Hoe(e){return qoe.indexOf(e)!==-1}function tP(e,t,r){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Koe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Voe=function(t,r,n){var i,a=Koe[t];return typeof a=="string"?i=a:r===1?i=a.one:i=a.other.replace("{{count}}",r.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Fm(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var Goe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Qoe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Yoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xoe={date:Fm({formats:Goe,defaultWidth:"full"}),time:Fm({formats:Qoe,defaultWidth:"full"}),dateTime:Fm({formats:Yoe,defaultWidth:"full"})},Zoe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Joe=function(t,r,n,i){return Zoe[t]};function Sl(e){return function(t,r){var n=r!=null&&r.context?String(r.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,o=r!=null&&r.width?String(r.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{var s=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[s]}var u=e.argumentCallback?e.argumentCallback(t):t;return i[u]}}var ese={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ise={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ase={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ose=function(t,r){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},sse={ordinalNumber:ose,era:Sl({values:ese,defaultWidth:"wide"}),quarter:Sl({values:tse,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Sl({values:rse,defaultWidth:"wide"}),day:Sl({values:nse,defaultWidth:"wide"}),dayPeriod:Sl({values:ise,defaultWidth:"wide",formattingValues:ase,defaultFormattingWidth:"wide"})};function jl(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;var o=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?use(s,function(d){return d.test(o)}):lse(s,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u;var f=t.slice(o.length);return{value:u,rest:f}}}function lse(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function use(e,t){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(e.matchPattern);if(!n)return null;var i=n[0],a=t.match(e.parsePattern);if(!a)return null;var o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;var s=t.slice(i.length);return{value:o,rest:s}}}var fse=/^(\d+)(th|st|nd|rd)?/i,dse=/\d+/i,hse={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pse={any:[/^b/i,/^(a|c)/i]},mse={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vse={any:[/1/i,/2/i,/3/i,/4/i]},yse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},xse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},bse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},wse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Sse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jse={ordinalNumber:cse({matchPattern:fse,parsePattern:dse,valueCallback:function(t){return parseInt(t,10)}}),era:jl({matchPatterns:hse,defaultMatchWidth:"wide",parsePatterns:pse,defaultParseWidth:"any"}),quarter:jl({matchPatterns:mse,defaultMatchWidth:"wide",parsePatterns:vse,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:jl({matchPatterns:yse,defaultMatchWidth:"wide",parsePatterns:gse,defaultParseWidth:"any"}),day:jl({matchPatterns:xse,defaultMatchWidth:"wide",parsePatterns:bse,defaultParseWidth:"any"}),dayPeriod:jl({matchPatterns:wse,defaultMatchWidth:"any",parsePatterns:Sse,defaultParseWidth:"any"})},Ose={code:"en-US",formatDistance:Voe,formatLong:Xoe,formatRelative:Joe,localize:sse,match:jse,options:{weekStartsOn:0,firstWeekContainsDate:1}},Pse=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_se=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,kse=/^'([^]*?)'?$/,Ase=/''/g,Ese=/[a-zA-Z]/;function Yn(e,t,r){var n,i,a,o,s,l,u,f,d,h,p,v,m,y;At(2,arguments);var b=String(t),g=kp(),x=(n=(i=void 0)!==null&&i!==void 0?i:g.locale)!==null&&n!==void 0?n:Ose,S=Ui((a=(o=(s=(l=void 0)!==null&&l!==void 0?l:void 0)!==null&&s!==void 0?s:g.firstWeekContainsDate)!==null&&o!==void 0?o:(u=g.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=Ui((d=(h=(p=(v=void 0)!==null&&v!==void 0?v:void 0)!==null&&p!==void 0?p:g.weekStartsOn)!==null&&h!==void 0?h:(m=g.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&d!==void 0?d:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var j=an(e);if(!Eoe(j))throw new RangeError("Invalid time value");var O=koe(j),P=Noe(j,O),A={firstWeekContainsDate:S,weekStartsOn:w,locale:x,_originalDate:j},E=b.match(_se).map(function(N){var T=N[0];if(T==="p"||T==="P"){var M=zoe[T];return M(N,x.formatLong)}return N}).join("").match(Pse).map(function(N){if(N==="''")return"'";var T=N[0];if(T==="'")return Nse(N);var M=Foe[T];if(M)return Hoe(N)&&tP(N,t,String(e)),Woe(N)&&tP(N,t,String(e)),M(P,N,x.localize,A);if(T.match(Ese))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return N}).join("");return E}function Nse(e){var t=e.match(kse);return t?t[1].replace(Ase,"'"):e}function uh(e,t){var r;At(1,arguments);var n=Ui((r=void 0)!==null&&r!==void 0?r:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var i=Mse(e),a;if(i.date){var o=Rse(i.date,n);a=Dse(o.restDateString,o.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var s=a.getTime(),l=0,u;if(i.time&&(l=Ise(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(u=Lse(i.timezone),isNaN(u))return new Date(NaN)}else{var f=new Date(s+l),d=new Date(0);return d.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),d.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),d}return new Date(s+l+u)}var sf={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Tse=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,$se=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Cse=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Mse(e){var t={},r=e.split(sf.dateTimeDelimiter),n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],sf.timeZoneDelimiter.test(t.date)&&(t.date=e.split(sf.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){var i=sf.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function Rse(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function Dse(e,t){if(t===null)return new Date(NaN);var r=e.match(Tse);if(!r)return new Date(NaN);var n=!!r[4],i=Ol(r[1]),a=Ol(r[2])-1,o=Ol(r[3]),s=Ol(r[4]),l=Ol(r[5])-1;if(n)return qse(t,s,l)?Fse(t,s,l):new Date(NaN);var u=new Date(0);return!zse(t,a,o)||!Use(t,i)?new Date(NaN):(u.setUTCFullYear(t,a,Math.max(i,o)),u)}function Ol(e){return e?parseInt(e):1}function Ise(e){var t=e.match($se);if(!t)return NaN;var r=Bm(t[1]),n=Bm(t[2]),i=Bm(t[3]);return Wse(r,n,i)?r*AT+n*kT+i*1e3:NaN}function Bm(e){return e&&parseFloat(e.replace(",","."))||0}function Lse(e){if(e==="Z")return 0;var t=e.match(Cse);if(!t)return 0;var r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Hse(n,i)?r*(n*AT+i*kT):NaN}function Fse(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var i=n.getUTCDay()||7,a=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}var Bse=[31,null,31,30,31,30,31,31,30,31,30,31];function $T(e){return e%400===0||e%4===0&&e%100!==0}function zse(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(Bse[t]||($T(e)?29:28))}function Use(e,t){return t>=1&&t<=($T(e)?366:365)}function qse(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function Wse(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Hse(e,t){return t>=0&&t<=59}function Ap({runId:e,truncate:t=!0,className:r="",showFullOnHover:n=!1}){const[i,a]=k.useState(!1),[o,s]=k.useState(!1),l=async f=>{f.stopPropagation();try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch(d){console.error("Failed to copy:",d)}},u=t&&!o?`${e.substring(0,12)}...`:e;return c.jsxs("div",{className:`flex items-center gap-2 group ${r}`,onMouseEnter:()=>n&&s(!0),onMouseLeave:()=>n&&s(!1),children:[c.jsx("span",{className:"font-mono text-xs text-dark-text",title:e,children:u}),c.jsx("button",{onClick:l,className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-dark-bg rounded text-dark-text-muted hover:text-primary",title:"Copy run ID to clipboard",children:i?c.jsx(tD,{size:14,className:"text-success"}):c.jsx(nD,{size:14})})]})}function ch({runs:e,highlightShots:t=!1,title:r,showDownloadButton:n=!1}){const i=mt(),a=s=>{i(`/runs/${s}`)},o=()=>{const s=r?`qobserva-${r.toLowerCase().replace(/\s+/g,"-")}`:"qobserva-runs";Vx(e,s)};return c.jsxs("div",{children:[n&&c.jsx("div",{className:"flex justify-end mb-4",children:c.jsxs("button",{onClick:o,className:"btn-secondary flex items-center gap-2",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Run ID"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Time"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Project"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Status"}),c.jsx("th",{className:`text-left py-3 px-4 text-sm font-semibold ${t?"text-primary bg-primary/10":"text-dark-text-muted"}`,children:"Shots"})]})}),c.jsx("tbody",{children:e.slice(0,50).map(s=>c.jsxs("tr",{onClick:()=>a(s.run_id),className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 cursor-pointer transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:c.jsx(Ap,{runId:s.run_id})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:Yn(new Date(s.created_at),"MMM dd, HH:mm")}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.project}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.backend_name}),c.jsx("td",{className:"py-3 px-4",children:c.jsx("span",{className:`px-2 py-1 rounded text-xs font-semibold ${s.status==="success"?"bg-success/20 text-success":s.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:s.status})}),c.jsx("td",{className:`py-3 px-4 text-sm font-semibold ${t?"text-primary bg-primary/5":"text-dark-text"}`,children:s.shots.toLocaleString()})]},s.run_id))})]})})]})}function Fg({runs:e,title:t}){const r=()=>{const n=t?`qobserva-${t.toLowerCase().replace(/\s+/g,"-")}`:"qobserva-runs";Vx(e,n)};return c.jsxs("button",{onClick:r,className:"btn-secondary flex items-center gap-2 ml-auto",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}function Kse({runs:e}){const t=k.useMemo(()=>{const r=e.reduce((n,i)=>{const a=new Date(i.created_at).toLocaleDateString();return n[a]||(n[a]={date:a,success:0,failed:0,total:0}),n[a].total++,i.status==="success"?n[a].success++:i.status==="failed"&&n[a].failed++,n},{});return Object.values(r).map(n=>({date:n.date,successRate:n.total>0?n.success/n.total*100:0,failureRate:n.total>0?n.failed/n.total*100:0})).sort((n,i)=>new Date(n.date).getTime()-new Date(i.date).getTime())},[e]);return t.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"}):c.jsx(tt,{width:"100%",height:300,children:c.jsxs(PT,{data:t,children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"colorSuccess",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#10b981",stopOpacity:.3}),c.jsx("stop",{offset:"95%",stopColor:"#10b981",stopOpacity:0})]}),c.jsxs("linearGradient",{id:"colorFailed",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#ef4444",stopOpacity:.3}),c.jsx("stop",{offset:"95%",stopColor:"#ef4444",stopOpacity:0})]})]}),c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"date",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},domain:[0,100],label:{value:"Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},formatter:r=>[`${r.toFixed(1)}%`,""]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"},iconType:"circle"}),c.jsx(wn,{type:"monotone",dataKey:"successRate",name:"Success Rate",stroke:"#10b981",strokeWidth:2,fill:"url(#colorSuccess)"}),c.jsx(wn,{type:"monotone",dataKey:"failureRate",name:"Failure Rate",stroke:"#ef4444",strokeWidth:2,fill:"url(#colorFailed)"})]})})}function Vse({filters:e={}}){const t=mt(),[r,n]=k.useState(null),i=k.useMemo(()=>["runs",JSON.stringify(e)],[e]),{data:a=[],isLoading:o}=Qe({queryKey:i,queryFn:()=>Ye.getRuns({limit:1e3,...e}),staleTime:0,refetchOnWindowFocus:!1});if(o)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});const s=a.length,l=a.filter(m=>m.status==="success").length,u=s>0?l/s*100:0,f=a.reduce((m,y)=>m+y.shots,0),d=s>0?Math.round(f/s):0,h=new Set(a.map(m=>m.backend_name)).size,p=r?a.filter(m=>m.status===r):a,v=m=>{const y=new URLSearchParams({type:m});return e.project&&y.set("project",e.project),e.provider&&y.set("provider",e.provider),e.status&&y.set("status",e.status),e.startDate&&y.set("startDate",e.startDate),e.endDate&&y.set("endDate",e.endDate),`/runs-filtered?${y.toString()}`};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"grid grid-cols-5 gap-6",children:[c.jsx(be,{label:"Total Runs",value:s.toLocaleString(),clickable:!0,onClick:()=>t(v("all"))}),c.jsx(be,{label:"Success Rate",value:`${u.toFixed(1)}%`,clickable:!0,onClick:()=>t(v("success"))}),c.jsx(be,{label:"Avg Shots",value:d.toLocaleString(),clickable:!0,onClick:()=>t(v("shots"))}),c.jsx(be,{label:"Backends",value:h.toString(),clickable:!0,onClick:()=>t(v("backends"))}),c.jsx(be,{label:"Total Shots",value:f.toLocaleString(),clickable:!0,onClick:()=>t(v("shots"))})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Success Rate Trend"}),c.jsx(Kse,{runs:a})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runs by Status"}),c.jsx(Ooe,{runs:a,onSliceClick:m=>{n(m)}})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("h3",{className:"text-lg font-semibold text-white",children:[r?`${r.charAt(0).toUpperCase()+r.slice(1)} Runs`:"Recent Runs",r&&c.jsx("button",{onClick:()=>n(null),className:"ml-4 text-sm text-primary hover:underline",children:"Clear filter"})]}),c.jsx(Fg,{runs:p})]}),c.jsx(ch,{runs:p})]})]})}function Bg({counts:e}){const t=Object.entries(e).sort(([,r],[,n])=>n-r).slice(0,20).map(([r,n])=>({bitstring:r,count:n}));return t.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No counts available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Ts,{data:t,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"bitstring",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80,label:{value:"Bitstring (Measurement Outcome)",position:"insideBottom",offset:-5,fill:"#94a3b8",style:{textAnchor:"middle"}}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Count (Number of Observations)",angle:-90,position:"insideLeft",fill:"#94a3b8",style:{textAnchor:"middle"}}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0",fontWeight:"bold"},formatter:r=>[r.toLocaleString(),"Count"]}),c.jsx(or,{dataKey:"count",fill:"#3b82f6",radius:[8,8,0,0]})]})})}function Gse({queueTime:e,runtime:t}){const r=(e||0)+(t||0);return!e&&!t?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No timeline data"}):c.jsxs("div",{className:"space-y-4",children:[e&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("span",{className:"text-sm text-dark-text-muted",children:"Queue Time"}),c.jsxs("span",{className:"text-sm text-dark-text",children:[e,"ms"]})]}),c.jsx("div",{className:"h-4 bg-dark-bg rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-warning",style:{width:`${e/r*100}%`}})})]}),t&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("span",{className:"text-sm text-dark-text-muted",children:"Runtime"}),c.jsxs("span",{className:"text-sm text-dark-text",children:[t,"ms"]})]}),c.jsx("div",{className:"h-4 bg-dark-bg rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-success",style:{width:`${t/r*100}%`}})})]})]})}function Qse({top1:e,top5:t,top10:r}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Top-K Dominance"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Probability mass in top states. High values indicate algorithm convergence; low values suggest noise-dominated output."}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(be,{label:"Top-1 Probability",value:`${(e*100).toFixed(3)}%`}),c.jsx(be,{label:"Top-5 Cumulative",value:`${(t*100).toFixed(3)}%`}),c.jsx(be,{label:"Top-10 Cumulative",value:`${(r*100).toFixed(3)}%`})]}),e<.01&&r<.05&&c.jsx("p",{className:"text-sm text-warning mt-4",children:"⚠️ Highly uniform distribution → likely noise-dominated"})]})}function Yse({effectiveSupportSize:e,totalStates:t}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Effective Support Size"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Number of states covering 95% of probability mass. More intuitive than entropy for understanding algorithm sharpness vs noise."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(be,{label:"Effective Support (95%)",value:e.toLocaleString()}),c.jsx(be,{label:"Total Unique States",value:t.toLocaleString()})]}),c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Coverage:"}),c.jsxs("span",{className:"text-dark-text",children:[t>0?(e/t*100).toFixed(1):0,"% of states"]})]}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-2",children:c.jsx("div",{className:"bg-primary h-2 rounded-full transition-all",style:{width:`${t>0?e/t*100:0}%`}})})]})]})}function Xse({entropy:e,idealEntropy:t,entropyRatio:r}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Entropy Analysis"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:'Measured entropy vs ideal (max) entropy. Ratio shows "how random" relative to expectation.'}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(be,{label:"Shannon Entropy",value:`${e.toFixed(4)} bits`}),t!==void 0&&c.jsx(be,{label:"Ideal Entropy (Max)",value:`${t.toFixed(4)} bits`}),r!==void 0&&c.jsx(be,{label:"Entropy Ratio",value:`${(r*100).toFixed(1)}%`,change:r>.9?"Highly random":r>.5?"Moderately random":"Concentrated"})]}),r!==void 0&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Randomness:"}),c.jsx("span",{className:`font-semibold ${r>.9?"text-warning":r>.5?"text-primary":"text-success"}`,children:r>.9?"Highly Random":r>.5?"Moderately Random":"Concentrated"})]}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-2",children:c.jsx("div",{className:`h-2 rounded-full transition-all ${r>.9?"bg-warning":r>.5?"bg-primary":"bg-success"}`,style:{width:`${r*100}%`}})})]})]})}function Zse({uniqueStates:e,shots:t,uniqueStatesRatio:r,collisionRate:n}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shot Efficiency & Sampling Quality"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Unique states vs total shots. High unique ratio indicates undersampling; low ratio with high collisions suggests concentration."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[c.jsx(be,{label:"Unique States",value:e.toLocaleString()}),c.jsx(be,{label:"Total Shots",value:t.toLocaleString()})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(be,{label:"Unique/Shots Ratio",value:`${(r*100).toFixed(2)}%`,change:r>.9?"Undersampled":r<.1?"Oversampled":"Balanced"}),c.jsx(be,{label:"Collision Rate",value:`${(n*100).toFixed(2)}%`,change:n>.5?"High concentration":"Low concentration"})]}),r>.9&&c.jsxs("p",{className:"text-sm text-warning mt-4",children:["⚠️ High unique ratio (",r>.9?">90%":">50%",") - Additional shots unlikely to improve signal"]})]})}function Jse({runtimeMs:e,queueMs:t,runtimePerShot:r,classification:n}){const i=o=>{switch(o){case"queue-dominated":return"text-warning";case"execution-dominated":return"text-primary";case"cpu-bound":return"text-success";default:return"text-dark-text-muted"}},a=o=>{switch(o){case"queue-dominated":return"Queue-Dominated";case"execution-dominated":return"Execution-Dominated";case"cpu-bound":return"CPU-Bound";default:return"Unknown"}};return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runtime & Execution Behavior"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Runtime analysis helps identify if backend is slow or circuit is slow. Classification is heuristic."}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-4",children:[c.jsx(be,{label:"Runtime",value:`${e.toLocaleString()}ms`}),c.jsx(be,{label:"Queue Time",value:`${t.toLocaleString()}ms`}),c.jsx(be,{label:"Runtime/Shot",value:`${r.toFixed(3)}ms`}),c.jsxs("div",{className:"metric-card",children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Classification"}),c.jsx("div",{className:`text-2xl font-bold ${i(n)}`,children:a(n)})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("div",{className:"flex items-center justify-between text-sm mb-2",children:c.jsx("span",{className:"text-dark-text-muted",children:"Time Distribution:"})}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-4 flex overflow-hidden",children:e>0&&t>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"bg-primary h-4 transition-all",style:{width:`${e/(e+t)*100}%`},title:`Execution: ${e}ms`}),c.jsx("div",{className:"bg-warning h-4 transition-all",style:{width:`${t/(e+t)*100}%`},title:`Queue: ${t}ms`})]})}),c.jsxs("div",{className:"flex justify-between text-xs text-dark-text-muted mt-2",children:[c.jsxs("span",{children:["Execution: ",e,"ms"]}),c.jsxs("span",{children:["Queue: ",t,"ms"]})]})]}),n==="queue-dominated"&&c.jsx("p",{className:"text-sm text-warning mt-4",children:"⚠️ Queue time dominates - Backend may be heavily loaded"})]})}function ele({cpuTimeS:e,qpuTimeS:t,queueTimeS:r,postProcessingTimeS:n}){const i=a=>`${a.toFixed(2)} s`;return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Execution time breakdown"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Provider-reported time spent in CPU, QPU, queue, and post-processing. Shown when the backend supplies this metadata (e.g. IBM cloud/hardware)."}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e!=null&&c.jsx(be,{label:"CPU",value:i(e)}),t!=null&&c.jsx(be,{label:"QPU",value:i(t)}),r!=null&&c.jsx(be,{label:"Queue (provider)",value:i(r)}),n!=null&&c.jsx(be,{label:"Post-processing",value:i(n)})]})]})}function ec(e,t){var v,m,y,b,g,x,S,w;const r={},n=((m=(v=e.artifacts)==null?void 0:v.counts)==null?void 0:m.histogram)||{},i=((y=e.execution)==null?void 0:y.shots)||0,a=((b=e.execution)==null?void 0:b.runtime_ms)||0,o=((g=e.execution)==null?void 0:g.queue_ms)||0,s=(S=(x=e.program)==null?void 0:x.circuit_metrics)==null?void 0:S.num_qubits;if(!n||i===0)return r;const l=Object.entries(n).map(([j,O])=>({state:j,count:parseInt(O,10),probability:parseInt(O,10)/i})).sort((j,O)=>O.probability-j.probability);if(l.length>0){r.top1Probability=l[0].probability;const j=l.slice(0,5).reduce((P,A)=>P+A.probability,0);r.top5Probability=j;const O=l.slice(0,10).reduce((P,A)=>P+A.probability,0);r.top10Probability=O}let u=0,f=0;for(const j of l)if(u+=j.probability,f++,u>=.95)break;r.effectiveSupportSize=f;const d=(w=t.metrics)==null?void 0:w["qc.quality.shannon_entropy_bits"];if(d!=null&&(r.entropy=d,s&&s>0)){const j=s;r.idealEntropy=j,r.entropyRatio=d/j}const h=Object.keys(n).length;r.uniqueStates=h,r.uniqueStatesRatio=i>0?h/i:0;let p=0;for(const j of Object.values(n)){const O=parseInt(String(j),10);O>1&&(p+=O-1)}if(r.collisionRate=i>0?p/i:0,a>0&&i>0&&(r.runtimePerShot=a/i),a>0){const j=a+o;if(j>0){const O=o/j,P=a/j;O>.5?r.runtimeClassification="queue-dominated":P>.7?r.runtimeClassification="execution-dominated":a<100&&o<100?r.runtimeClassification="cpu-bound":r.runtimeClassification="unknown"}else r.runtimeClassification="unknown"}else r.runtimeClassification="unknown";return r}function tle(e){var n,i,a,o,s;if(!e||Object.keys(e).length===0)return null;if(e.algorithm==="error_test"){const l=e.error_type||"error scenario";return{severity:"warn",message:`This run is tagged as an error test (${l}). Results may not represent normal execution and should be interpreted accordingly.`,tagContext:`algorithm: error_test, error_type: ${l}`}}if(e.error_type&&e.error_type!=="none"&&e.error_type!==""&&(e.algorithm==="error_test"||((n=e.test)==null?void 0:n.toLowerCase().includes("error"))||((i=e.purpose)==null?void 0:i.toLowerCase().includes("error"))||((a=e.scenario)==null?void 0:a.toLowerCase().includes("error"))))return{severity:"warn",message:`This run is tagged with error_type: "${e.error_type}". This appears to be an intentional error test scenario - results may not be meaningful for normal analysis.`,tagContext:`error_type: ${e.error_type}`};if(e.test&&e.test.toLowerCase().includes("error"))return{severity:"info",message:'This run is tagged as a test with "error" in the tag value. Results may be from an error handling test scenario.',tagContext:`test: ${e.test}`};const t=((o=e.purpose)==null?void 0:o.toLowerCase())||"",r=((s=e.scenario)==null?void 0:s.toLowerCase())||"";return(t.includes("error")||r.includes("error"))&&(t.includes("test")||r.includes("test"))?{severity:"info",message:"This run appears to be an error test scenario based on tags. Results should be interpreted in that context.",tagContext:t?`purpose: ${e.purpose}`:`scenario: ${e.scenario}`}:null}function zm(e){if(e==null||e==="")return"—";if(typeof e=="string"){const t=e.trim();return t.length>0?`v${t}`:"—"}return`v${String(e)}`}function rle(){var g,x,S,w,j,O,P,A,E,N,T,M,R,D,L,U,C;const{runId:e}=bR(),[t,r]=k.useState({rawMetadata:!1,rawEvent:!1,rawAnalysis:!1}),{data:n=[]}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3})}),i=n.find(F=>F.run_id===e),a=(i==null?void 0:i.project)||"default",{data:o,isLoading:s,error:l}=Qe({queryKey:["run",e],queryFn:()=>Ye.getRun(a,e),enabled:!!e,retry:2}),u=k.useMemo(()=>o?ec(o.event,o.analysis):{},[o]),f=o==null?void 0:o.event,d=o==null?void 0:o.analysis,h=(d==null?void 0:d.metrics)||{},p=h["qc.quality.shannon_entropy_bits"],v=((x=(g=f==null?void 0:f.artifacts)==null?void 0:g.counts)==null?void 0:x.histogram)||{},m=Object.keys(v).length,y=k.useMemo(()=>f!=null&&f.tags?tle(f.tags):null,[f==null?void 0:f.tags]);if(s)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});if(l||!o||!f||!d)return c.jsxs("div",{className:"text-center py-12",children:[c.jsx("p",{className:"text-dark-text-muted mb-4",children:"Run not found"}),c.jsxs("p",{className:"text-sm text-dark-text-muted",children:["Run ID: ",e]})]});const b=F=>{r(z=>({...z,[F]:!z[F]}))};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Run Details"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Run ID:"}),c.jsx(Ap,{runId:e||"",truncate:!1})]})]}),y&&c.jsx("div",{className:`card border-l-4 ${y.severity==="warn"?"border-warning bg-warning/10":"border-primary bg-primary/10"}`,children:c.jsxs("div",{className:"flex items-start gap-3",children:[y.severity==="warn"?c.jsx(XR,{className:"text-warning mt-0.5 flex-shrink-0",size:20}):c.jsx(Xk,{className:"text-primary mt-0.5 flex-shrink-0",size:20}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h4",{className:`font-semibold mb-1 ${y.severity==="warn"?"text-warning":"text-primary"}`,children:y.severity==="warn"?"Test Scenario Warning":"Tag Information"}),c.jsx("p",{className:"text-sm text-dark-text",children:y.message}),y.tagContext&&c.jsxs("p",{className:"text-xs text-dark-text-muted mt-2",children:["Tag context: ",y.tagContext]})]})]})}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Run Information"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Project"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.project})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Provider"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.backend.provider})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Backend"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.backend.name})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Status"}),c.jsx("span",{className:`font-medium ${f.execution.status==="success"?"text-success":f.execution.status==="failed"?"text-error":"text-dark-text-muted"}`,children:f.execution.status})]})]}),c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("h4",{className:"text-sm font-semibold text-white mb-1",children:"QObserva components (this run)"}),c.jsx("p",{className:"text-xs text-dark-text-muted mb-3",children:"Versions stored with this run's telemetry. Missing values show as — (e.g. runs recorded before this field existed, or not present in the payload)."}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"QObserva (meta)"}),c.jsx("span",{className:"text-dark-text font-medium",children:zm((S=f.software)==null?void 0:S.qobserva_version)})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"QObserva Agent"}),c.jsx("span",{className:"text-dark-text font-medium",children:zm((w=f.software)==null?void 0:w.agent_version)})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"QObserva Collector"}),c.jsx("span",{className:"text-dark-text font-medium",children:zm((j=f.software)==null?void 0:j.collector_version)})]})]})]}),(((O=f.software)==null?void 0:O.sdk)||((P=f.software)==null?void 0:P.python_version))&&c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("h4",{className:"text-sm font-semibold text-white mb-3",children:"Software environment"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[((A=f.software.sdk)==null?void 0:A.name)&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"SDK"}),c.jsxs("span",{className:"text-dark-text font-medium",children:[f.software.sdk.name,f.software.sdk.version&&c.jsxs("span",{className:"text-dark-text-muted ml-1",children:["v",f.software.sdk.version]})]})]}),f.software.python_version&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Python"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.software.python_version})]})]})]}),f.event_id&&c.jsx("div",{className:"mt-4 pt-4 border-t border-dark-border",children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted text-sm mb-1",children:"Event ID"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.event_id})]})})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[h["qc.quality.success_probability"]!==void 0?c.jsx(be,{label:"Success Rate",value:`${(h["qc.quality.success_probability"]*100).toFixed(1)}%`}):h["qc.optimization.energy"]!==void 0?c.jsx(be,{label:"Energy",value:h["qc.optimization.energy"].toFixed(4)}):c.jsx(be,{label:"Success Rate",value:"N/A"}),c.jsx(be,{label:"Shots",value:f.execution.shots.toLocaleString()}),c.jsx(be,{label:"Runtime",value:f.execution.runtime_ms?`${f.execution.runtime_ms}ms`:"N/A"}),c.jsx(be,{label:"Cost",value:h["qc.cost.estimated_usd"]?`$${h["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]}),h["qc.optimization.energy"]!==void 0&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Optimization Results"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Energy"}),c.jsx("span",{className:"text-dark-text font-medium text-lg",children:h["qc.optimization.energy"].toFixed(6)})]}),h["qc.optimization.energy_stderr"]!==void 0&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Energy Std Error"}),c.jsx("span",{className:"text-dark-text font-medium",children:h["qc.optimization.energy_stderr"].toFixed(6)})]}),h["qc.optimization.approximation_ratio"]!==void 0&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Approximation Ratio"}),c.jsxs("span",{className:`font-medium ${h["qc.optimization.approximation_ratio"]<=1.1?"text-success":h["qc.optimization.approximation_ratio"]<=2?"text-warning":"text-error"}`,children:[h["qc.optimization.approximation_ratio"].toFixed(4),"x"]}),c.jsx("span",{className:"text-xs text-dark-text-muted mt-1",children:h["qc.optimization.approximation_ratio"]<=1.1?"Excellent (near ground state)":h["qc.optimization.approximation_ratio"]<=2?"Good":"Needs improvement"})]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Measurement Results"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Distribution of measurement outcomes (bitstrings) and how many times each was observed. Shows the top 20 most frequent outcomes."}),c.jsx(Bg,{counts:((N=(E=f.artifacts)==null?void 0:E.counts)==null?void 0:N.histogram)||{}})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Execution Timeline"}),c.jsx(Gse,{queueTime:f.execution.queue_ms,runtime:f.execution.runtime_ms})]})]}),u.top1Probability!==void 0&&c.jsx(Qse,{top1:u.top1Probability,top5:u.top5Probability||0,top10:u.top10Probability||0}),u.effectiveSupportSize!==void 0&&c.jsx(Yse,{effectiveSupportSize:u.effectiveSupportSize,totalStates:m}),p!=null&&c.jsx(Xse,{entropy:p,idealEntropy:u.idealEntropy,entropyRatio:u.entropyRatio}),u.uniqueStates!==void 0&&((T=f.execution)==null?void 0:T.shots)&&c.jsx(Zse,{uniqueStates:u.uniqueStates,shots:f.execution.shots,uniqueStatesRatio:u.uniqueStatesRatio||0,collisionRate:u.collisionRate||0}),u.runtimePerShot!==void 0&&((M=f.execution)==null?void 0:M.runtime_ms)!==void 0&&c.jsx(Jse,{runtimeMs:f.execution.runtime_ms||0,queueMs:f.execution.queue_ms||0,shots:f.execution.shots||0,runtimePerShot:u.runtimePerShot,classification:u.runtimeClassification||"unknown"}),(h["qc.time.cpu_s"]!=null||h["qc.time.qpu_s"]!=null||h["qc.time.queue_s"]!=null||h["qc.time.post_processing_s"]!=null)&&c.jsx(ele,{cpuTimeS:h["qc.time.cpu_s"],qpuTimeS:h["qc.time.qpu_s"],queueTimeS:h["qc.time.queue_s"],postProcessingTimeS:h["qc.time.post_processing_s"]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawMetadata"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detailed Metadata"}),t.rawMetadata?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawMetadata&&c.jsxs("div",{className:"mt-4 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Run ID:"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.run_id})]}),f.event_id&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Event ID:"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.event_id})]}),f.created_at&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Created At:"}),c.jsx("span",{className:"text-dark-text",children:new Date(f.created_at).toLocaleString()})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Raw Metadata (JSON)"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-96",children:JSON.stringify({project:f.project,backend:f.backend,run_id:f.run_id,event_id:f.event_id||void 0,created_at:f.created_at||void 0,execution:{status:f.execution.status,shots:f.execution.shots,runtime_ms:f.execution.runtime_ms,queue_ms:f.execution.queue_ms}},null,2)})]})]})]}),d.insights&&d.insights.length>0&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Insights"}),c.jsx("div",{className:"space-y-2",children:d.insights.map((F,z)=>c.jsx("div",{className:`p-3 rounded-lg ${F.severity==="critical"?"bg-error/20 border border-error/30 text-error":F.severity==="warn"?"bg-warning/20 border border-warning/30 text-warning":"bg-primary/20 border border-primary/30 text-primary"}`,children:F.summary},z))})]}),((R=f.artifacts)==null?void 0:R.energies)&&c.jsxs("div",{className:"card border-l-4 border-primary",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Energy Artifacts (Debug)"}),c.jsxs("div",{className:"text-sm",children:[c.jsxs("div",{className:"mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Energy Value:"}),c.jsx("span",{className:"text-dark-text font-mono ml-2",children:((D=f.artifacts.energies)==null?void 0:D.value)!==null&&((L=f.artifacts.energies)==null?void 0:L.value)!==void 0?String(f.artifacts.energies.value):"null/undefined"})]}),c.jsxs("div",{className:"mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Energy Std Error:"}),c.jsx("span",{className:"text-dark-text font-mono ml-2",children:((U=f.artifacts.energies)==null?void 0:U.stderr)!==null&&((C=f.artifacts.energies)==null?void 0:C.stderr)!==void 0?String(f.artifacts.energies.stderr):"null/undefined"})]}),c.jsx("div",{className:"text-xs text-dark-text-muted mt-2",children:"If energy value is null/undefined, the adapter didn't extract it. If it has a value but metrics don't show it, the analysis needs to be re-run."})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawEvent"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Raw Event Data"}),t.rawEvent?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawEvent&&c.jsx("div",{className:"mt-4",children:c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-96",children:JSON.stringify(f,null,2)})})]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawAnalysis"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Raw Analytics Data"}),t.rawAnalysis?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawAnalysis&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Metrics"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-64",children:JSON.stringify(h,null,2)})]}),d.insights&&d.insights.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Insights"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-64",children:JSON.stringify(d.insights,null,2)})]})]})]})]})}function rP({runs:e,value:t,onChange:r,label:n,placeholder:i="Search by run ID, project, backend..."}){const[a,o]=k.useState(!1),[s,l]=k.useState(""),u=e.find(p=>p.run_id===t),f=k.useMemo(()=>{if(!s.trim())return e.slice(0,50);const p=s.toLowerCase();return e.filter(v=>v.run_id.toLowerCase().includes(p)||v.project.toLowerCase().includes(p)||v.provider.toLowerCase().includes(p)||v.backend_name.toLowerCase().includes(p)||v.status.toLowerCase().includes(p)).slice(0,50)},[e,s]),d=p=>{r(p),o(!1),l("")},h=()=>{r(""),l("")};return c.jsxs("div",{className:"relative",children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:n}),c.jsxs("div",{className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>o(!a),className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm flex items-center justify-between hover:border-primary/50 transition-colors",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[c.jsx(Yf,{size:16,className:"text-dark-text-muted flex-shrink-0"}),u?c.jsxs("span",{className:"truncate",children:[c.jsxs("span",{className:"font-mono text-xs text-primary",children:[u.run_id.substring(0,12),"..."]})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{children:u.project})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{children:u.backend_name})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{className:"text-xs",children:Yn(new Date(u.created_at),"MMM dd, HH:mm")})]}):c.jsx("span",{className:"text-dark-text-muted",children:i})]}),u&&c.jsx("div",{onClick:p=>{p.stopPropagation(),h()},className:"ml-2 text-dark-text-muted hover:text-dark-text transition-colors cursor-pointer flex items-center",role:"button",tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),h())},children:c.jsx(Zk,{size:16})})]}),a&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),c.jsxs("div",{className:"absolute z-20 w-full mt-1 bg-dark-surface border border-dark-border rounded-lg shadow-xl max-h-96 overflow-hidden",children:[c.jsx("div",{className:"p-2 border-b border-dark-border",children:c.jsxs("div",{className:"relative",children:[c.jsx(Yf,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-dark-text-muted"}),c.jsx("input",{type:"text",value:s,onChange:p=>l(p.target.value),placeholder:"Type to search...",className:"w-full bg-dark-bg border border-dark-border rounded-lg pl-10 pr-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50",autoFocus:!0,onClick:p=>p.stopPropagation()})]})}),c.jsx("div",{className:"overflow-y-auto max-h-80",children:f.length===0?c.jsx("div",{className:"p-4 text-center text-dark-text-muted text-sm",children:"No runs found"}):c.jsx("div",{className:"p-1",children:f.map(p=>c.jsx("button",{onClick:()=>d(p.run_id),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${p.run_id===t?"bg-primary/20 text-primary border border-primary/30":"text-dark-text hover:bg-dark-bg"}`,children:c.jsx("div",{className:"flex items-center justify-between gap-2",children:c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsxs("span",{className:"font-mono text-xs text-primary font-semibold",children:[p.run_id.substring(0,12),"..."]}),c.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${p.status==="success"?"bg-success/20 text-success":p.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:p.status})]}),c.jsxs("div",{className:"text-xs text-dark-text-muted space-x-2",children:[c.jsx("span",{children:p.project}),c.jsx("span",{children:"•"}),c.jsx("span",{children:p.provider}),c.jsx("span",{children:"•"}),c.jsx("span",{children:p.backend_name}),c.jsx("span",{children:"•"}),c.jsx("span",{children:Yn(new Date(p.created_at),"MMM dd, HH:mm")})]})]})})},p.run_id))})})]})]})]})]})}function nP({event:e,runId:t,label:r}){const n=mt();return c.jsx("div",{className:"card",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:r}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ap,{runId:t}),c.jsx("button",{onClick:()=>n(`/runs/${t}`),className:"flex items-center gap-1 text-primary hover:text-primary/80 text-sm transition-colors",title:"View run details",children:c.jsx(iD,{size:14})})]})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Project:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.project})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Provider:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.backend.provider})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Backend:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.backend.name})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Time:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.created_at?Yn(new Date(e.created_at),"MMM dd, HH:mm"):"N/A"})]})]})]})})})}function nle({runA:e,runB:t}){var l,u,f,d,h,p,v,m,y,b;const r=k.useMemo(()=>ec(e.event,e.analysis),[e]),n=k.useMemo(()=>ec(t.event,t.analysis),[t]),i=e.analysis.metrics||{},a=t.analysis.metrics||{},o=(g,x,S="number")=>{if(g===void 0||x===void 0)return"N/A";const w=x-g,j=w>=0?"+":"";return S==="percent"?`${j}${(w*100).toFixed(1)}%`:S==="ms"?`${j}${w.toFixed(0)}ms`:S==="usd"?`${j}$${w.toFixed(4)}`:S==="s"?`${j}${w.toFixed(2)} s`:`${j}${w.toLocaleString()}`},s=(g,x,S=!1)=>{if(g===void 0||x===void 0)return"text-dark-text-muted";const w=x-g;return w===0?"text-dark-text-muted":S?w<0?"text-success":"text-error":w>0?"text-success":"text-error"};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Basic Execution Metrics"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Comparing Run A vs Run B. Delta shows change from Run A to Run B (positive = Run B is higher, negative = Run B is lower)."}),c.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Shots"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:e.event.execution.shots.toLocaleString()})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:t.event.execution.shots.toLocaleString()})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.shots,t.event.execution.shots)}`,children:["Δ: ",o(e.event.execution.shots,t.event.execution.shots)]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Success Rate"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:i["qc.quality.success_probability"]?`${(i["qc.quality.success_probability"]*100).toFixed(1)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:a["qc.quality.success_probability"]?`${(a["qc.quality.success_probability"]*100).toFixed(1)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.quality.success_probability"],a["qc.quality.success_probability"])}`,children:["Δ: ",o(i["qc.quality.success_probability"],a["qc.quality.success_probability"],"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Runtime"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:e.event.execution.runtime_ms?`${e.event.execution.runtime_ms.toLocaleString()}ms`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:t.event.execution.runtime_ms?`${t.event.execution.runtime_ms.toLocaleString()}ms`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.runtime_ms,t.event.execution.runtime_ms,!0)}`,children:["Δ: ",o(e.event.execution.runtime_ms,t.event.execution.runtime_ms,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Cost"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:i["qc.cost.estimated_usd"]?`$${i["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:a["qc.cost.estimated_usd"]?`$${a["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.cost.estimated_usd"],a["qc.cost.estimated_usd"],!0)}`,children:["Δ: ",o(i["qc.cost.estimated_usd"],a["qc.cost.estimated_usd"],"usd")]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Quality Metrics"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Entropy"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((l=i["qc.quality.shannon_entropy_bits"])==null?void 0:l.toFixed(4))||"N/A"," bits"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((u=a["qc.quality.shannon_entropy_bits"])==null?void 0:u.toFixed(4))||"N/A"," bits"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.quality.shannon_entropy_bits"],a["qc.quality.shannon_entropy_bits"])}`,children:["Δ: ",o(i["qc.quality.shannon_entropy_bits"],a["qc.quality.shannon_entropy_bits"])]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Top-1 Probability"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.top1Probability?`${(r.top1Probability*100).toFixed(3)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.top1Probability?`${(n.top1Probability*100).toFixed(3)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.top1Probability,n.top1Probability)}`,children:["Δ: ",o(r.top1Probability,n.top1Probability,"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Effective Support"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((f=r.effectiveSupportSize)==null?void 0:f.toLocaleString())||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((d=n.effectiveSupportSize)==null?void 0:d.toLocaleString())||"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.effectiveSupportSize,n.effectiveSupportSize)}`,children:["Δ: ",o(r.effectiveSupportSize,n.effectiveSupportSize)]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shot Efficiency"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Unique States"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((h=r.uniqueStates)==null?void 0:h.toLocaleString())||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((p=n.uniqueStates)==null?void 0:p.toLocaleString())||"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.uniqueStates,n.uniqueStates)}`,children:["Δ: ",o(r.uniqueStates,n.uniqueStates)]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Unique/Shots Ratio"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.uniqueStatesRatio?`${(r.uniqueStatesRatio*100).toFixed(2)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.uniqueStatesRatio?`${(n.uniqueStatesRatio*100).toFixed(2)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.uniqueStatesRatio,n.uniqueStatesRatio)}`,children:["Δ: ",o(r.uniqueStatesRatio,n.uniqueStatesRatio,"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Collision Rate"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.collisionRate?`${(r.collisionRate*100).toFixed(2)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.collisionRate?`${(n.collisionRate*100).toFixed(2)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.collisionRate,n.collisionRate,!0)}`,children:["Δ: ",o(r.collisionRate,n.collisionRate,"percent")]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runtime Analysis"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Runtime/Shot"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((v=r.runtimePerShot)==null?void 0:v.toFixed(3))||"N/A"," ms"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((m=n.runtimePerShot)==null?void 0:m.toFixed(3))||"N/A"," ms"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.runtimePerShot,n.runtimePerShot,!0)}`,children:["Δ: ",o(r.runtimePerShot,n.runtimePerShot,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Queue Time"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((y=e.event.execution.queue_ms)==null?void 0:y.toLocaleString())||"N/A"," ms"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((b=t.event.execution.queue_ms)==null?void 0:b.toLocaleString())||"N/A"," ms"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.queue_ms,t.event.execution.queue_ms,!0)}`,children:["Δ: ",o(e.event.execution.queue_ms,t.event.execution.queue_ms,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Classification"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white capitalize",children:r.runtimeClassification||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white capitalize",children:n.runtimeClassification||"N/A"})]})]})]})]})]}),(i["qc.time.cpu_s"]!=null||a["qc.time.cpu_s"]!=null||i["qc.time.qpu_s"]!=null||a["qc.time.qpu_s"]!=null||i["qc.time.queue_s"]!=null||a["qc.time.queue_s"]!=null||i["qc.time.post_processing_s"]!=null||a["qc.time.post_processing_s"]!=null)&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Execution time breakdown"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Provider-reported CPU, QPU, queue, and post-processing time (seconds). Shown when the backend supplies this metadata."}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(i["qc.time.cpu_s"]!=null||a["qc.time.cpu_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"CPU"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.cpu_s"]!=null?`${Number(i["qc.time.cpu_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.cpu_s"]!=null?`${Number(a["qc.time.cpu_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.cpu_s"],a["qc.time.cpu_s"],!0)}`,children:["Δ: ",o(i["qc.time.cpu_s"],a["qc.time.cpu_s"],"s")]})})]}),(i["qc.time.qpu_s"]!=null||a["qc.time.qpu_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"QPU"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.qpu_s"]!=null?`${Number(i["qc.time.qpu_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.qpu_s"]!=null?`${Number(a["qc.time.qpu_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.qpu_s"],a["qc.time.qpu_s"],!0)}`,children:["Δ: ",o(i["qc.time.qpu_s"],a["qc.time.qpu_s"],"s")]})})]}),(i["qc.time.queue_s"]!=null||a["qc.time.queue_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Queue (provider)"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.queue_s"]!=null?`${Number(i["qc.time.queue_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.queue_s"]!=null?`${Number(a["qc.time.queue_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.queue_s"],a["qc.time.queue_s"],!0)}`,children:["Δ: ",o(i["qc.time.queue_s"],a["qc.time.queue_s"],"s")]})})]}),(i["qc.time.post_processing_s"]!=null||a["qc.time.post_processing_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Post-processing"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.post_processing_s"]!=null?`${Number(i["qc.time.post_processing_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.post_processing_s"]!=null?`${Number(a["qc.time.post_processing_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.post_processing_s"],a["qc.time.post_processing_s"],!0)}`,children:["Δ: ",o(i["qc.time.post_processing_s"],a["qc.time.post_processing_s"],"s")]})})]})]})]})]})}function ile({runA:e,runB:t}){var r,n,i,a;return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Measurement Results Comparison"}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:e.label}),c.jsx(Bg,{counts:((n=(r=e.event.artifacts)==null?void 0:r.counts)==null?void 0:n.histogram)||{}})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:t.label}),c.jsx(Bg,{counts:((a=(i=t.event.artifacts)==null?void 0:i.counts)==null?void 0:a.histogram)||{}})]})]})]})}function ale({runA:e,runB:t}){const r=k.useMemo(()=>ec(e.event,e.analysis),[e]),n=k.useMemo(()=>ec(t.event,t.analysis),[t]),i=[{category:"Top-1",[e.label]:r.top1Probability?r.top1Probability*100:0,[t.label]:n.top1Probability?n.top1Probability*100:0},{category:"Top-5",[e.label]:r.top5Probability?r.top5Probability*100:0,[t.label]:n.top5Probability?n.top5Probability*100:0},{category:"Top-10",[e.label]:r.top10Probability?r.top10Probability*100:0,[t.label]:n.top10Probability?n.top10Probability*100:0}];return!r.top1Probability&&!n.top1Probability?null:c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Top-K Dominance Comparison"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Probability mass in top states. Higher values indicate better algorithm convergence."}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:i,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"category",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Probability (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"},formatter:a=>[`${a.toFixed(3)}%`,"Probability"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(or,{dataKey:e.label,fill:"#3b82f6",radius:[8,8,0,0]}),c.jsx(or,{dataKey:t.label,fill:"#10b981",radius:[8,8,0,0]})]})})]})}function ole({runA:e,runB:t}){const r=k.useMemo(()=>{var a;return{entropy:(a=e.analysis.metrics)==null?void 0:a["qc.quality.shannon_entropy_bits"],entropyRatio:void 0}},[e]),n=k.useMemo(()=>{var a;return{entropy:(a=t.analysis.metrics)==null?void 0:a["qc.quality.shannon_entropy_bits"],entropyRatio:void 0}},[t]);if(r.entropy===void 0&&n.entropy===void 0)return null;const i=[{metric:"Shannon Entropy",[e.label]:r.entropy||0,[t.label]:n.entropy||0}];return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Entropy Comparison"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Shannon entropy measures the randomness/uniformity of measurement distributions."}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:i,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"metric",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Entropy (bits)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"},formatter:a=>[`${a.toFixed(4)} bits`,"Entropy"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(or,{dataKey:e.label,fill:"#3b82f6",radius:[8,8,0,0]}),c.jsx(or,{dataKey:t.label,fill:"#10b981",radius:[8,8,0,0]})]})})]})}function sle(){const[e,t]=Ah(),{data:r=[],isLoading:n}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3}),staleTime:5e3}),[i,a]=k.useState(()=>e.get("runA")||""),[o,s]=k.useState(()=>e.get("runB")||"");k.useEffect(()=>{var g,x;if(r.length>0&&!i&&!o&&!e.get("runA")&&!e.get("runB")){const S=((g=r[0])==null?void 0:g.run_id)||"",w=r.length>1?((x=r[1])==null?void 0:x.run_id)||"":S;a(S),s(w),t({runA:S,runB:w},{replace:!0})}},[r,i,o,e,t]),k.useEffect(()=>{const g=new URLSearchParams;i&&g.set("runA",i),o&&g.set("runB",o),t(g,{replace:!0})},[i,o,t]);const l=r.find(g=>g.run_id===i),u=r.find(g=>g.run_id===o),f=(l==null?void 0:l.project)||"default",d=(u==null?void 0:u.project)||"default",{data:h,isLoading:p}=Qe({queryKey:["run",i],queryFn:()=>Ye.getRun(f,i),enabled:!!i,retry:2}),{data:v,isLoading:m}=Qe({queryKey:["run",o],queryFn:()=>Ye.getRun(d,o),enabled:!!o,retry:2});if(n)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading runs..."});const y=p||m,b=h&&v;return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Compare Runs"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Select two runs to compare metrics, quality, and performance"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx(rP,{runs:r,value:i,onChange:a,label:"Run A",placeholder:"Search for first run..."}),c.jsx(rP,{runs:r,value:o,onChange:s,label:"Run B",placeholder:"Search for second run..."})]}),y&&c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading run data..."}),!y&&b&&i&&o&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx(nP,{event:h.event,runId:i,label:"Run A"}),c.jsx(nP,{event:v.event,runId:o,label:"Run B"})]}),c.jsx(nle,{runA:h,runB:v}),c.jsx(ale,{runA:{event:h.event,analysis:h.analysis,runId:i,label:"Run A"},runB:{event:v.event,analysis:v.analysis,runId:o,label:"Run B"}}),c.jsx(ole,{runA:{analysis:h.analysis,runId:i,label:"Run A"},runB:{analysis:v.analysis,runId:o,label:"Run B"}}),c.jsx(ile,{runA:{event:h.event,runId:i,label:"Run A"},runB:{event:v.event,runId:o,label:"Run B"}})]}),!y&&!b&&(i||o)&&c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Please select both runs to compare"})]})}function lle({runs:e}){var i;const t=mt(),n=((i=Qe({queryKey:["runs-analyses",e.map(a=>a.run_id)],queryFn:async()=>(await Promise.all(e.slice(0,50).map(async o=>{const s=await Ye.getRun(o.project,o.run_id).catch(()=>null);return s?{run:o,res:s}:null}))).filter(Boolean)}).data)==null?void 0:i.map(({run:a,res:o})=>{var u,f,d,h;const s=(f=(u=o==null?void 0:o.analysis)==null?void 0:u.metrics)==null?void 0:f["qc.circuit.depth.post"],l=(h=(d=o==null?void 0:o.analysis)==null?void 0:d.metrics)==null?void 0:h["qc.quality.success_probability"];return s&&l!==void 0?{depth:s,success:l*100,backend:a.backend_name,runId:a.run_id,project:a.project}:null}).filter(Boolean))||[];return n.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(OT,{data:n,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"depth",name:"Circuit Depth",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Circuit Depth",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"success",name:"Success Rate",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Success Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{cursor:{strokeDasharray:"3 3"},contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"}}),c.jsx(tl,{dataKey:"success",fill:"#3b82f6",onClick:a=>{const o=a==null?void 0:a.payload;o!=null&&o.runId&&t(`/runs/${o.runId}`)},style:{cursor:"pointer"},children:n.map((a,o)=>c.jsx(vr,{fill:"#3b82f6"},`cell-${o}`))})]})})}function ule({runs:e}){var i;const t=mt(),n=((i=Qe({queryKey:["runs-analyses-cost",e.map(a=>a.run_id)],queryFn:async()=>(await Promise.all(e.slice(0,50).map(async o=>{const s=await Ye.getRun(o.project,o.run_id).catch(()=>null);return s?{run:o,res:s}:null}))).filter(Boolean)}).data)==null?void 0:i.map(({run:a,res:o})=>{var u,f,d,h;const s=(f=(u=o==null?void 0:o.analysis)==null?void 0:u.metrics)==null?void 0:f["qc.cost.estimated_usd"],l=(h=(d=o==null?void 0:o.analysis)==null?void 0:d.metrics)==null?void 0:h["qc.quality.success_probability"];return s&&s>0&&l!==void 0?{cost:s,success:l*100,backend:a.backend_name,runId:a.run_id,project:a.project}:null}).filter(Boolean))||[];return n.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No cost data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(OT,{data:n,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"cost",name:"Cost (USD)",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Cost (USD)",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"success",name:"Success Rate",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Success Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{cursor:{strokeDasharray:"3 3"},contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"}}),c.jsx(tl,{dataKey:"success",fill:"#8b5cf6",onClick:a=>{const o=a==null?void 0:a.payload;o!=null&&o.runId&&t(`/runs/${o.runId}`)},style:{cursor:"pointer"},children:n.map((a,o)=>c.jsx(vr,{fill:"#8b5cf6"},`cell-${o}`))})]})})}function cle({runs:e}){const t=k.useMemo(()=>{const n=e.reduce((i,a)=>(i[a.backend_name]||(i[a.backend_name]={success:0,total:0}),i[a.backend_name].total++,a.status==="success"&&i[a.backend_name].success++,i),{});return Object.entries(n).map(([i,a])=>({backend:i,successRate:a.total>0?a.success/a.total*100:0,totalRuns:a.total}))},[e]);if(t.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const r=Math.max(...t.map(n=>n.successRate));return c.jsx("div",{className:"space-y-4",children:t.map(n=>c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("div",{className:"w-32 text-sm text-dark-text",children:n.backend}),c.jsxs("div",{className:"flex-1 h-8 bg-dark-bg rounded-full overflow-hidden relative",children:[c.jsx("div",{className:"h-full transition-all",style:{width:`${n.successRate/r*100}%`,backgroundColor:n.successRate>70?"#10b981":n.successRate>40?"#f59e0b":"#ef4444"}}),c.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-dark-text",children:[n.successRate.toFixed(1),"% (",n.totalRuns," runs)"]})]})]},n.backend))})}function Um({value:e,label:t,max:r=100}){const n=Math.min(e/r*100,100),i=2*Math.PI*90,a=i,o=i-n/100*i,s=()=>n>=70?"#10b981":n>=40?"#f59e0b":"#ef4444";return c.jsx("div",{className:"flex flex-col items-center justify-center",children:c.jsxs("div",{className:"relative",children:[c.jsxs("svg",{width:"200",height:"200",className:"transform -rotate-90",children:[c.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:"#334155",strokeWidth:"12"}),c.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:s(),strokeWidth:"12",strokeDasharray:a,strokeDashoffset:o,strokeLinecap:"round",className:"transition-all duration-500"})]}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c.jsx("div",{className:"text-4xl font-bold text-white",children:e.toFixed(1)}),c.jsx("div",{className:"text-sm text-dark-text-muted",children:t})]})]})})}function fle(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function dle({runs:e,baseFilters:t}){const r=mt(),n=k.useMemo(()=>{const o=new Map;e.forEach(u=>{if(!u.created_at)return;const f=Yn(_T(uh(u.created_at)),"yyyy-MM-dd"),d=u.provider;o.has(f)||o.set(f,new Map);const h=o.get(f);h.has(d)||h.set(d,{total:0,count:0});const p=h.get(d);p.count+=1});const s=Array.from(o.keys()).sort(),l=Array.from(new Set(e.map(u=>u.provider))).filter(Boolean);return s.map(u=>{const f={dateLabel:Yn(uh(u),"MMM dd"),dateIso:u},d=o.get(u);return l.forEach(h=>{const p=d==null?void 0:d.get(h);p&&p.count>0&&(f[h]=p.count)}),f})},[e]);if(n.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const i=Array.from(new Set(e.map(o=>o.provider))).filter(Boolean),a=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#14b8a6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(_p,{data:n,onClick:o=>{var f,d,h;const s=o==null?void 0:o.activePayload;if(!s||s.length===0)return;const l=(f=s[0])==null?void 0:f.dataKey,u=(h=(d=s[0])==null?void 0:d.payload)==null?void 0:h.dateIso;!l||!u||r(`/runs-filtered${fle(t,{provider:String(l),startDate:`${u}T00:00:00Z`,endDate:`${u}T23:59:59Z`})}`)},children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"dateLabel",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Runs per Day",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"}}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),i.map((o,s)=>c.jsx(Ji,{type:"monotone",dataKey:o,stroke:a[s%a.length],strokeWidth:2,dot:{r:4},activeDot:{r:6},style:{cursor:"pointer"}},o))]})})}function hle(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function ple({runs:e,baseFilters:t}){const r=mt(),n=e.slice(0,50),i=Qe({queryKey:["run-details-analytics",n.map(o=>o.run_id)],queryFn:async()=>(await Promise.all(n.map(async s=>{try{const l=await Ye.getRun(s.project,s.run_id);return{run_id:s.run_id,created_at:s.created_at,runtime_ms:l.event.execution.runtime_ms||0,provider:s.provider}}catch{return null}}))).filter(Boolean),enabled:n.length>0}),a=k.useMemo(()=>{if(!i.data)return[];const o=new Map;return i.data.forEach(s=>{if(!s)return;const l=Yn(_T(uh(s.created_at)),"yyyy-MM-dd");o.has(l)||o.set(l,{total:0,count:0});const u=o.get(l);u.total+=s.runtime_ms||0,u.count+=1}),Array.from(o.entries()).map(([s,l])=>({dateLabel:Yn(uh(s),"MMM dd"),dateIso:s,avgRuntime:l.count>0?l.total/l.count:0})).sort((s,l)=>s.dateIso.localeCompare(l.dateIso))},[i.data]);return i.isLoading?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading runtime data..."}):a.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No runtime data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(PT,{data:a,onClick:o=>{var u,f;const s=o==null?void 0:o.activePayload;if(!s||s.length===0)return;const l=(f=(u=s[0])==null?void 0:u.payload)==null?void 0:f.dateIso;l&&r(`/runs-filtered${hle(t,{startDate:`${l}T00:00:00Z`,endDate:`${l}T23:59:59Z`})}`)},children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:"colorRuntime",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#3b82f6",stopOpacity:.8}),c.jsx("stop",{offset:"95%",stopColor:"#3b82f6",stopOpacity:.1})]})}),c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"dateLabel",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Avg Runtime (ms)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},formatter:o=>[`${o.toFixed(0)} ms`,"Average Runtime"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(wn,{type:"monotone",dataKey:"avgRuntime",stroke:"#3b82f6",strokeWidth:2,fillOpacity:1,fill:"url(#colorRuntime)",style:{cursor:"pointer"}})]})})}function iP(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function mle({runs:e,baseFilters:t}){const r=mt(),{chartData:n,backends:i}=k.useMemo(()=>{const o=new Map;e.forEach(p=>{const v=p.backend_name;o.has(v)||o.set(v,{total:0,success:0,totalShots:0});const m=o.get(v);m.total+=1,p.status==="success"&&(m.success+=1),m.totalShots+=p.shots||0});const s=Array.from(o.entries()).sort((p,v)=>v[1].total-p[1].total).slice(0,5),l=Math.max(...s.map(([p,v])=>v.total),1),u=Math.max(...s.map(([p,v])=>v.totalShots/v.total),1),f=s.map(([p,v])=>({backend:p.length>15?p.substring(0,15)+"...":p,"Success Rate":v.total>0?v.success/v.total*100:0,"Total Runs":v.total/l*100,"Avg Shots":v.total>0?Math.min(v.totalShots/v.total/u*100,100):0}));return{chartData:["Success Rate","Total Runs","Avg Shots"].map(p=>{const v={metric:p};return f.forEach(m=>{v[m.backend]=m[p]}),v}),backends:f.map(p=>p.backend)}},[e]);if(n.length===0||i.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const a=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(joe,{data:n,children:[c.jsx(m2,{stroke:"#334155"}),c.jsx(Js,{dataKey:"metric",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(Zs,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"}}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0",cursor:"pointer"},onClick:()=>r(`/runs-filtered${iP(t,{type:"backends"})}`)}),i.map((o,s)=>c.jsx(jc,{name:o,dataKey:o,stroke:a[s%a.length],fill:a[s%a.length],fillOpacity:.3,style:{cursor:"pointer"},onClick:()=>r(`/runs-filtered${iP(t,{type:"backends"})}`)},o))]})})}function vle({runs:e}){const t=k.useMemo(()=>{const n={"0-100":0,"101-1K":0,"1K-10K":0,"10K-100K":0,"100K+":0};return e.forEach(i=>{const a=i.shots||0;a<=100?n["0-100"]++:a<=1e3?n["101-1K"]++:a<=1e4?n["1K-10K"]++:a<=1e5?n["10K-100K"]++:n["100K+"]++}),Object.entries(n).filter(([i,a])=>a>0).map(([i,a])=>({name:i,value:a}))},[e]);if(t.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const r=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Ql,{children:[c.jsx(yr,{data:t,cx:"50%",cy:"50%",labelLine:!1,label:({name:n,percent:i})=>`${n}: ${(i*100).toFixed(0)}%`,outerRadius:120,fill:"#8884d8",dataKey:"value",children:t.map((n,i)=>c.jsx(vr,{fill:r[i%r.length]},`cell-${i}`))}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},formatter:n=>[n,"Runs"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}})]})})}function qm(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function yle({filters:e}){const t=mt(),{data:r=[],isLoading:n}=Qe({queryKey:["runs",e],queryFn:()=>Ye.getRuns({limit:1e3,...e||{}}),staleTime:5e3});if(n)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});const i=s=>{s==="success"?t(`/runs-filtered${qm(e,{type:"success"})}`):s==="backends"?t(`/runs-filtered${qm(e,{type:"backends"})}`):s==="runs"&&t(`/runs-filtered${qm(e)}`)},a=r.length>0?r.filter(s=>s.status==="success").length/r.length*100:0,o=new Set(r.map(s=>s.backend_name)).size;return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Run Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Comprehensive analysis and trends of quantum run performance"})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("success"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Overall Success Rate"}),c.jsx(Um,{value:a,label:"Success Rate"}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view successful runs"})]}),c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("backends"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Active Backends"}),c.jsx(Um,{value:o,label:"Backends",max:Math.max(o,10)}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view backend statistics"})]}),c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("runs"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Total Runs"}),c.jsx(Um,{value:r.length,label:"Runs",max:Math.max(r.length,1e3)}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view all runs"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Provider Performance Over Time"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Track run volume across different providers over time"}),c.jsx(dle,{runs:r,baseFilters:e})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Average Runtime Trend"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Monitor average execution time trends over time"}),c.jsx(ple,{runs:r,baseFilters:e})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Backend Multi-Dimensional Analysis"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Compare backends across multiple performance dimensions"}),c.jsx(mle,{runs:r,baseFilters:e})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Circuit Depth vs Success"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Relationship between circuit complexity and success rate"}),c.jsx(lle,{runs:r})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Cost vs Quality Trade-off"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Analyze the balance between execution cost and result quality"}),c.jsx(ule,{runs:r})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shots Distribution"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Distribution of runs by shots range"}),c.jsx(vle,{runs:r})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Backend Performance Heatmap"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Heatmap showing backend performance patterns"}),c.jsx(cle,{runs:r})]})]})]})}function gle({filters:e}){const t=mt(),[r,n]=k.useState(""),{data:i=[],isLoading:a}=Qe({queryKey:["algorithms"],queryFn:()=>Ye.getAlgorithms()});k.useEffect(()=>{i.length>0&&!r&&n(i[0].name)},[i,r]);const{data:o=[],isLoading:s}=Qe({queryKey:["runs",e,r],queryFn:()=>Ye.getRuns({limit:1e3,...e||{},algorithm:r||void 0}),enabled:!!r}),{data:l=[]}=Qe({queryKey:["runs",e],queryFn:()=>Ye.getRuns({limit:1e3,...e||{}})}),u=o,f=k.useMemo(()=>u.map(x=>x.run_id),[u]),{data:d}=Qe({queryKey:["run-events",f],queryFn:async()=>{const x=new Map,S=u.slice(0,100);return await Promise.all(S.map(async w=>{try{const j=await Ye.getRun(w.project,w.run_id);x.set(w.run_id,j.event)}catch(j){console.error(`Error loading event for ${w.run_id}:`,j)}})),x},enabled:u.length>0&&u.length<=100}),h=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{var O,P,A,E;let w=S.provider;if(d){const N=d.get(S.run_id);(P=(O=N==null?void 0:N.software)==null?void 0:O.sdk)!=null&&P.name?w=N.software.sdk.name:(A=N==null?void 0:N.tags)!=null&&A.sdk&&(w=N.tags.sdk)}x.has(w)||x.set(w,{success:0,total:0,totalRuntime:0,totalShots:0});const j=x.get(w);if(j.total++,S.status==="success"&&j.success++,j.totalShots+=S.shots,d){const N=d.get(S.run_id);(E=N==null?void 0:N.execution)!=null&&E.runtime_ms&&(j.totalRuntime+=N.execution.runtime_ms)}}),Array.from(x.entries()).map(([S,w])=>({sdk:S,successRate:w.total>0?w.success/w.total*100:0,avgShots:w.total>0?w.totalShots/w.total:0,avgRuntime:w.total>0&&w.totalRuntime>0?w.totalRuntime/w.total:0,totalRuns:w.total})).sort((S,w)=>w.totalRuns-S.totalRuns)},[u,d]),p=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{const w=new Date(S.created_at).toISOString().split("T")[0];x.has(w)||x.set(w,{success:0,total:0});const j=x.get(w);j.total++,S.status==="success"&&j.success++}),Array.from(x.entries()).map(([S,w])=>({date:S,successRate:w.total>0?w.success/w.total*100:0,totalRuns:w.total})).sort((S,w)=>S.date.localeCompare(w.date)).slice(-30)},[u]),v=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{const w=`${S.provider}/${S.backend_name}`;x.has(w)||x.set(w,{success:0,total:0});const j=x.get(w);j.total++,S.status==="success"&&j.success++}),Array.from(x.entries()).map(([S,w])=>({backend:S,successRate:w.total>0?w.success/w.total*100:0,totalRuns:w.total})).sort((S,w)=>w.totalRuns-S.totalRuns).slice(0,10)},[u]),m=k.useMemo(()=>{if(!d||u.length===0)return null;const x={vqe:{energies:[]},grover:{targetSuccessRates:[]},optimization:{approximationRatios:[]}};return u.slice(0,50).forEach(w=>{var A;const j=d.get(w.run_id);if(!((A=j==null?void 0:j.program)!=null&&A.benchmark_params))return;const O=j.program.benchmark_params,P=r.toLowerCase();P.includes("vqe")&&O.energy!==void 0&&x.vqe.energies.push(O.energy),P.includes("grover")&&O.expected_success_rate!==void 0&&x.grover.targetSuccessRates.push(O.expected_success_rate),(P.includes("optimization")||P.includes("qubo")||P.includes("ising"))&&O.approximation_ratio!==void 0&&x.optimization.approximationRatios.push(O.approximation_ratio)}),x.vqe.energies.length>0||x.grover.targetSuccessRates.length>0||x.optimization.approximationRatios.length>0?x:null},[u,d,r]),y=l.length>0?l.filter(x=>x.status==="success").length/l.length*100:0,b=u.length>0?u.filter(x=>x.status==="success").length/u.length*100:0,g=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#06b6d4"];return a?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading algorithms..."}):i.length===0?c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Algorithm Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:h-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Algorithm-specific performance analysis and benchmarking"})]}),c.jsxs("div",{className:"card text-center py-12",children:[c.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"No Algorithm-Tagged Runs Found"}),c.jsxs("p",{className:"text-dark-text-muted mb-4",children:["Tag your runs with an ",c.jsx("code",{className:"bg-dark-bg px-2 py-1 rounded text-primary",children:"algorithm"})," tag to see algorithm-specific metrics."]}),c.jsx("p",{className:"text-sm text-dark-text-muted",children:"Example:"}),c.jsx("pre",{className:"bg-dark-bg p-4 rounded-lg text-left text-sm text-dark-text overflow-x-auto mt-4",children:`@observe_run( project="my_project", tags={ "sdk": "qiskit", "algorithm": "vqe" # Add this tag } -)`})]})]}):c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Algorithm Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:h-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Algorithm-specific performance analysis and cross-SDK comparison"})]}),c.jsxs("div",{className:"card",children:[c.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Select Algorithm"}),c.jsx("select",{value:r,onChange:x=>n(x.target.value),className:"bg-dark-bg border border-dark-border rounded-lg px-4 py-2 text-dark-text w-full max-w-md",children:i.map(x=>c.jsxs("option",{value:x.name,children:[x.name," (",x.count," runs)"]},x.name))})]}),r?s?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading algorithm data..."}):u.length===0?c.jsx("div",{className:"card text-center py-12",children:c.jsx("p",{className:"text-dark-text-muted",children:"No runs found for selected algorithm with current filters."})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Total Runs"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:u.length})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Success Rate"}),c.jsxs("p",{className:"text-3xl font-bold text-white",children:[b.toFixed(1),"%"]}),c.jsxs("p",{className:"text-xs text-dark-text-muted mt-1",children:["Overall: ",y.toFixed(1),"%"]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Avg Shots"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:u.length>0?Math.round(u.reduce((x,S)=>x+S.shots,0)/u.length):0})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"SDKs Used"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:h.length})]})]}),h.length>0&&c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Success Rate by SDK/Provider"}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"sdk",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(or,{dataKey:"successRate",fill:"#3b82f6",radius:[4,4,0,0],children:h.map((x,S)=>c.jsx(vr,{fill:g[S%g.length]},`cell-${S}`))})]})})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Average Shots by SDK/Provider"}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"sdk",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(or,{dataKey:"avgShots",fill:"#8b5cf6",radius:[4,4,0,0],children:h.map((x,S)=>c.jsx(vr,{fill:g[S%g.length]},`cell-${S}`))})]})})]})]}),h.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:["Best Performing SDK for ",r]}),c.jsx("div",{className:"flex items-center gap-6",children:h.sort((x,S)=>S.successRate-x.successRate).slice(0,3).map((x,S)=>c.jsx("div",{className:"flex-1",children:c.jsxs("div",{className:`p-4 rounded-lg border-2 ${S===0?"border-primary bg-primary/10":"border-dark-border bg-dark-bg"}`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"text-sm font-medium text-dark-text-muted",children:S===0?"🥇 Best":S===1?"🥈 2nd":"🥉 3rd"}),c.jsxs("span",{className:"text-xs text-dark-text-muted",children:[x.totalRuns," runs"]})]}),c.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:x.sdk}),c.jsxs("div",{className:"text-sm text-dark-text-muted",children:[x.successRate.toFixed(1),"% success rate"]})]})},x.sdk))})]}),p.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:[r," Performance Over Time"]}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(_p,{data:p,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"date",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(Ji,{type:"monotone",dataKey:"successRate",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",r:4},activeDot:{r:6}})]})})]}),v.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:["Backend Performance for ",r]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Runs"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Success Rate"})]})}),c.jsx("tbody",{children:v.map(x=>c.jsxs("tr",{className:"border-b border-dark-border hover:bg-dark-bg/50 cursor-pointer",onClick:()=>t(`/runs-filtered?algorithm=${r}&provider=${x.backend.split("/")[0]}`),children:[c.jsx("td",{className:"py-3 px-4 text-dark-text",children:x.backend}),c.jsx("td",{className:"py-3 px-4 text-right text-dark-text",children:x.totalRuns}),c.jsxs("td",{className:"py-3 px-4 text-right text-dark-text",children:[x.successRate.toFixed(1),"%"]})]},x.backend))})]})})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Algorithm-Specific Metrics"}),m?c.jsxs("div",{className:"space-y-4",children:[r.toLowerCase().includes("vqe")&&m.vqe.energies.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"VQE Energy Values"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Min:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:Math.min(...m.vqe.energies).toFixed(4)})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Max:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:Math.max(...m.vqe.energies).toFixed(4)})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:(m.vqe.energies.reduce((x,S)=>x+S,0)/m.vqe.energies.length).toFixed(4)})]})]})]}),r.toLowerCase().includes("grover")&&m.grover.targetSuccessRates.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Grover's Target Success Rates"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg Expected:"}),c.jsxs("span",{className:"ml-2 text-white font-semibold",children:[(m.grover.targetSuccessRates.reduce((x,S)=>x+S,0)/m.grover.targetSuccessRates.length*100).toFixed(1),"%"]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Actual:"}),c.jsxs("span",{className:"ml-2 text-white font-semibold",children:[b.toFixed(1),"%"]})]})]})]}),(r.toLowerCase().includes("optimization")||r.toLowerCase().includes("qubo")||r.toLowerCase().includes("ising"))&&m.optimization.approximationRatios.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Approximation Ratios"}),c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:(m.optimization.approximationRatios.reduce((x,S)=>x+S,0)/m.optimization.approximationRatios.length).toFixed(3)})]})})]})]}):c.jsxs("div",{className:"text-center py-8 text-dark-text-muted",children:[c.jsxs("p",{className:"mb-2",children:["Add ",c.jsx("code",{className:"bg-dark-bg px-2 py-1 rounded text-primary",children:"benchmark_params"})," to your runs to see algorithm-specific metrics."]}),c.jsx("p",{className:"text-sm",children:"Example: For VQE, include energy values; for Grover's, include target bitstrings."})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:[r," Runs"]}),c.jsx(ch,{runs:u})]})]}):c.jsx("div",{className:"card text-center py-12",children:c.jsx("p",{className:"text-dark-text-muted",children:"Select an algorithm to view metrics."})})]})}function gle(){const{data:e,isLoading:t}=Qe({queryKey:["settings"],queryFn:()=>Ye.getSettings()});return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Settings"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white flex items-center gap-2",children:[c.jsx(aD,{className:"w-5 h-5"}),"Data Directory"]}),t?c.jsx("p",{className:"text-dark-text-muted",children:"Loading..."}):e?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-dark-text-muted mb-2",children:"Current Data Directory:"}),c.jsx("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-3 font-mono text-sm text-dark-text break-all",children:e.data_dir}),e.data_dir==="/data"&&c.jsxs("p",{className:"text-xs text-primary mt-2",children:["🐳 Running in ",c.jsx("strong",{children:"Docker mode"})," - data stored in Docker volume"]})]}),c.jsx("div",{className:"bg-dark-bg/50 border border-dark-border rounded-lg p-4",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Yk,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"space-y-2 text-sm text-dark-text-muted",children:[e.data_dir==="/data"?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-dark-text font-medium",children:"Docker Mode: Data in Docker Volume"}),c.jsxs("p",{className:"text-xs",children:["Data is stored in a Docker volume named ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker_qobserva_data"}),"."]}),c.jsx("p",{className:"text-dark-text font-medium mt-3",children:"How to Access Data:"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["View volume location: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker volume inspect docker_qobserva_data"})]}),c.jsxs("li",{children:["Access from container: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker exec -it docker-collector-1 ls -la /data"})]}),c.jsxs("li",{children:["Copy files out: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker cp docker-collector-1:/data/qobserva.sqlite3 ./"})]})]}),c.jsx("p",{className:"text-dark-text font-medium mt-3",children:"How to Change Data Directory (Docker):"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["Edit ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker/docker-compose.yml"})," and update the volume mount"]}),c.jsxs("li",{children:["Or set ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"QOBSERVA_DATA_DIR"})," in the environment section"]}),c.jsxs("li",{children:["Restart: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"make docker-down && make docker-up"})]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-dark-text font-medium",children:"How to Change Data Directory:"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["Set the ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"QOBSERVA_DATA_DIR"})," environment variable to your desired path"]}),c.jsxs("li",{children:["Stop QObserva: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"qobserva down"})]}),c.jsxs("li",{children:["Start QObserva: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"qobserva up"})]})]})]}),c.jsxs("p",{className:"text-xs mt-3 pt-3 border-t border-dark-border",children:[c.jsx("strong",{children:"Note:"})," The data directory cannot be changed at runtime. All runs, database, and artifacts are stored in this directory."]})]})]})}),c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("p",{className:"text-xs text-dark-text-muted mb-2",children:"Data Structure:"}),c.jsxs("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-3 font-mono text-xs text-dark-text",children:[c.jsxs("div",{children:[e.data_dir,"/"]}),c.jsxs("div",{className:"ml-4",children:["├── qobserva.sqlite3 ",c.jsx("span",{className:"text-dark-text-muted",children:"(database)"})]}),c.jsx("div",{className:"ml-4",children:"└── artifacts/"}),c.jsxs("div",{className:"ml-8",children:["├── ","{project}/"]}),c.jsxs("div",{className:"ml-12",children:["└── ","{run_id}/"]}),c.jsx("div",{className:"ml-16",children:"├── event.json"}),c.jsx("div",{className:"ml-16",children:"└── analysis.json"})]})]})]}):c.jsx("p",{className:"text-dark-text-muted",children:"Unable to load settings."})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"About"}),c.jsxs("div",{className:"space-y-2 text-sm text-dark-text-muted",children:[c.jsx("p",{children:c.jsxs("strong",{className:"text-dark-text",children:["QObserva v",(e==null?void 0:e.qobserva_version)||"unknown"]})}),c.jsx("p",{children:"Local-first observability and benchmarking for quantum program executions."}),c.jsxs("p",{className:"text-xs",children:["Components: agent v",(e==null?void 0:e.qobserva_agent_version)||"unknown"," | collector v",(e==null?void 0:e.qobserva_collector_version)||"unknown"," | local v",(e==null?void 0:e.qobserva_local_version)||"unknown"]}),c.jsxs("ul",{className:"list-disc list-inside space-y-1 mt-4",children:[c.jsx("li",{children:"Standardized run telemetry"}),c.jsx("li",{children:"Metrics and insights generation"}),c.jsx("li",{children:"Multi-SDK support (Qiskit, Braket, Cirq, PennyLane, pyQuil, D-Wave)"})]})]})]})]})}function xle({runs:e}){const t=mt(),r=k.useMemo(()=>{const i=new Map;return e.forEach(a=>{const o=a.backend_name;i.has(o)||i.set(o,{backend_name:a.backend_name,provider:a.provider,total:0,success:0,failed:0,cancelled:0});const s=i.get(o);s.total++,a.status==="success"?s.success++:a.status==="failed"?s.failed++:a.status==="cancelled"&&s.cancelled++}),Array.from(i.values()).sort((a,o)=>o.total-a.total)},[e]),n=i=>{t(`/?provider=${encodeURIComponent(i)}`)};return r.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No backend data available"}):c.jsx("div",{children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend Name"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Total Runs"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Success"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Failed"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Cancelled"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Success Rate"})]})}),c.jsx("tbody",{children:r.map(i=>{const a=i.total>0?i.success/i.total*100:0;return c.jsxs("tr",{onClick:()=>n(i.provider),className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 cursor-pointer transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text font-medium",children:i.backend_name}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:i.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text text-right",children:i.total.toLocaleString()}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-success font-medium",children:i.success.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-error font-medium",children:i.failed.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-dark-text-muted font-medium",children:i.cancelled.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsxs("span",{className:`text-sm font-semibold ${a>=80?"text-success":a>=50?"text-warning":"text-error"}`,children:[a.toFixed(1),"%"]})})]},i.backend_name)})})]})})})}function ble({backendStats:e}){const t=()=>{BI(e,"qobserva-backends")};return c.jsxs("button",{onClick:t,className:"btn-secondary flex items-center gap-2 ml-auto",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}const iP={success:"#10b981",failed:"#ef4444",cancelled:"#6b7280",default:"#3b82f6"};function wle({runs:e}){const t=mt(),r=k.useMemo(()=>e.sort((o,s)=>new Date(o.created_at).getTime()-new Date(s.created_at).getTime()).map(o=>({x:new Date(o.created_at).getTime(),y:o.shots,shots:o.shots,runId:o.run_id,status:o.status,project:o.project,backend:o.backend_name,createdAt:o.created_at,formattedDate:new Date(o.created_at).toLocaleString()})),[e]),n=o=>{o&&o.runId&&t(`/runs/${o.runId}`)},i=({active:o,payload:s})=>{if(o&&s&&s.length){const l=s[0].payload;return c.jsxs("div",{className:"bg-dark-surface border border-primary/30 rounded-lg p-3 shadow-xl z-50 min-w-[200px]",children:[c.jsx("p",{className:"text-white font-semibold mb-2",children:l.formattedDate||new Date(l.createdAt).toLocaleString()}),c.jsxs("div",{className:"space-y-1 text-sm",children:[c.jsxs("p",{className:"text-dark-text-muted",children:["Shots: ",c.jsx("span",{className:"text-primary font-semibold",children:l.shots.toLocaleString()})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Status: ",c.jsx("span",{className:"text-white font-medium capitalize",children:l.status})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Backend: ",c.jsx("span",{className:"text-white font-medium",children:l.backend})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Project: ",c.jsx("span",{className:"text-white font-medium",children:l.project})]}),c.jsx("p",{className:"text-xs text-primary/70 mt-2 pt-2 border-t border-dark-border cursor-pointer",children:"Click dot to view details"})]})]})}return null};if(r.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No shots data available"});const a=o=>{const{cx:s,cy:l,payload:u}=o,f=iP[u==null?void 0:u.status]||iP.default;return c.jsxs("g",{onClick:()=>n(u),style:{cursor:"pointer"},children:[c.jsx("circle",{cx:s||0,cy:l||0,r:10,fill:"transparent",pointerEvents:"all"}),c.jsx("circle",{cx:s||0,cy:l||0,r:6,fill:f,stroke:"#1e293b",strokeWidth:2,className:"hover:r-7 hover:stroke-primary transition-all duration-150"})]})};return c.jsx(tt,{width:"100%",height:500,children:c.jsxs(_p,{data:r,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"x",name:"Time",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},domain:["dataMin","dataMax"],scale:"time",tickFormatter:o=>new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),label:{value:"Time",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"y",name:"Shots",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Shots",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{content:c.jsx(i,{}),cursor:{strokeDasharray:"3 3",stroke:"#3b82f6"}}),c.jsx(Ji,{type:"monotone",dataKey:"shots",stroke:"#3b82f6",strokeWidth:2,strokeOpacity:.5,dot:a,activeDot:{r:8,fill:"#3b82f6",stroke:"#1e293b",strokeWidth:2,style:{cursor:"pointer"}},onClick:o=>{o&&o.payload&&n(o.payload)},style:{cursor:"pointer"}})]})})}function Sle(){const[e]=Ah(),t=mt(),r=e.get("type")||"all",n=k.useMemo(()=>{const l={limit:1e4},u=e.get("project"),f=e.get("provider"),d=e.get("status"),h=e.get("startDate"),p=e.get("endDate");return u&&(l.project=u),f&&(l.provider=f),h&&(l.startDate=h),p&&(l.endDate=p),d?l.status=d:r==="success"?l.status="success":r==="failed"&&(l.status="failed"),l},[e,r]),{data:i=[],isLoading:a}=Qe({queryKey:["runs",n],queryFn:()=>Ye.getRuns(n),staleTime:0}),o=k.useMemo(()=>{const l=new Map;return i.forEach(u=>{const f=u.backend_name;l.has(f)||l.set(f,{backend_name:u.backend_name,provider:u.provider,total:0,success:0,failed:0,cancelled:0});const d=l.get(f);d.total++,u.status==="success"?d.success++:u.status==="failed"?d.failed++:u.status==="cancelled"&&d.cancelled++}),Array.from(l.values()).sort((u,f)=>f.total-u.total)},[i]);let s="All Runs";return r==="success"?s="Successful Runs":r==="failed"?s="Failed Runs":r==="shots"?s="Runs by Shots":r==="backends"?s="Runs by Backend":status&&(s=`${status.charAt(0).toUpperCase()+status.slice(1)} Runs`),a?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."}):r==="shots"?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs)"]})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shots Distribution"}),c.jsx(wle,{runs:i})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Runs List"}),c.jsx(Lg,{runs:i,title:"shots-runs"})]}),c.jsx(ch,{runs:i,highlightShots:!0,title:"shots-runs"})]})]}):r==="backends"?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs across ",new Set(i.map(l=>l.backend_name)).size," backends)"]})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Backend Statistics"}),c.jsx(ble,{backendStats:o})]}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Click on a backend row to filter by provider on the Home dashboard"}),c.jsx(xle,{runs:i})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs)"]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:s}),c.jsx(Lg,{runs:i,title:s.toLowerCase().replace(/\s+/g,"-")})]}),c.jsx(ch,{runs:i,title:s.toLowerCase().replace(/\s+/g,"-")})]})]})}function jle(){const[e,t]=k.useState(""),r=mt(),{data:n=[],isLoading:i}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e4}),staleTime:5e3}),a=n.filter(l=>{if(!e.trim())return!1;const u=e.toLowerCase();return l.run_id.toLowerCase().includes(u)||l.project.toLowerCase().includes(u)||l.provider.toLowerCase().includes(u)||l.backend_name.toLowerCase().includes(u)||l.status.toLowerCase().includes(u)}),o=l=>{r(`/runs/${l}`)},s=l=>{l.key==="Enter"&&a.length===1&&o(a[0].run_id)};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Search Runs"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Search for runs by ID, project, provider, backend, or status"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"relative",children:[c.jsx(Yf,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-dark-text-muted",size:20}),c.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value),onKeyPress:s,placeholder:"Enter run ID, project, provider, backend, or status...",className:"w-full bg-dark-bg border border-dark-border rounded-lg pl-12 pr-4 py-3 text-dark-text text-lg focus:outline-none focus:border-primary/50",autoFocus:!0})]}),e&&c.jsxs("p",{className:"text-sm text-dark-text-muted mt-3",children:[i?"Searching...":`${a.length} run${a.length!==1?"s":""} found`,a.length===1&&" (Press Enter to view)"]})]}),e&&c.jsx("div",{className:"card",children:i?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Searching..."}):a.length===0?c.jsxs("div",{className:"text-center py-12",children:[c.jsx("p",{className:"text-dark-text-muted mb-2",children:"No runs found"}),c.jsx("p",{className:"text-sm text-dark-text-muted",children:"Try a different search term"})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"Results"}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Run ID"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Time"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Project"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Status"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Shots"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Action"})]})}),c.jsx("tbody",{children:a.slice(0,100).map(l=>c.jsxs("tr",{className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",onClick:u=>u.stopPropagation(),children:c.jsx(Ap,{runId:l.run_id})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:Yn(new Date(l.created_at),"MMM dd, HH:mm")}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.project}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.backend_name}),c.jsx("td",{className:"py-3 px-4",children:c.jsx("span",{className:`px-2 py-1 rounded text-xs font-semibold ${l.status==="success"?"bg-success/20 text-success":l.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:l.status})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.shots.toLocaleString()}),c.jsx("td",{className:"py-3 px-4",children:c.jsxs("button",{onClick:()=>o(l.run_id),className:"flex items-center gap-1 text-primary hover:text-primary/80 text-sm transition-colors",title:"View run details",children:["View",c.jsx(XR,{size:14})]})})]},l.run_id))})]})}),a.length>100&&c.jsx("p",{className:"text-sm text-dark-text-muted mt-4 text-center",children:"Showing first 100 results. Refine your search to see more."})]})}),!e&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"How to Search"}),c.jsxs("ul",{className:"space-y-2 text-sm text-dark-text-muted",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Run ID:"})," Enter the full or partial run ID"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Project:"})," Search by project name"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Provider:"}),' Filter by provider (e.g., "ibm", "aws")']}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Backend:"})," Search by backend name"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Status:"}),' Filter by status (e.g., "success", "failed")']})]})]})]})}function Ole(e,t){const r=new URLSearchParams;return r.set("type",e),t.project&&r.set("project",t.project),t.startDate&&r.set("startDate",t.startDate),t.endDate&&r.set("endDate",t.endDate),`/report?${r.toString()}`}function Ple(){const e=mt(),[t,r]=k.useState("executive"),[n,i]=k.useState(""),[a,o]=k.useState(""),[s,l]=k.useState(""),u=k.useMemo(()=>({required:["Date range (start + end)"],optional:["Project"],notUsed:["Provider","Status (reports are intentionally general)"]}),[]),f=!!(a&&s),d=()=>{const h=Ole(t,{project:n||void 0,startDate:a?new Date(a+"T00:00:00Z").toISOString().replace(/\.\d{3}Z$/,"Z"):void 0,endDate:s?new Date(s+"T23:59:59Z").toISOString().replace(/\.\d{3}Z$/,"Z"):void 0});window.open(h,"_blank","noopener,noreferrer")};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Generate Report"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Generate a PDF via browser print. Choose a report type, set filters, then print/save as PDF."})]}),c.jsxs("div",{className:"card space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Report Type"}),c.jsxs("select",{value:t,onChange:h=>r(h.target.value),className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm",children:[c.jsx("option",{value:"executive",children:"Executive Summary"}),c.jsx("option",{value:"provider_backend",children:"Provider/Backend Performance"}),c.jsx("option",{value:"quality_anomaly",children:"Run Quality / Anomaly"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Project (optional)"}),c.jsx("input",{value:n,onChange:h=>i(h.target.value),placeholder:"e.g. pennylane_test",className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Start Date (required)"}),c.jsx("input",{type:"date",value:a,onChange:h=>o(h.target.value),style:{colorScheme:"light"},className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm qobserva-date-input"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"End Date (required)"}),c.jsx("input",{type:"date",value:s,onChange:h=>l(h.target.value),style:{colorScheme:"light"},className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm qobserva-date-input"})]})]}),c.jsxs("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-4",children:[c.jsx("div",{className:"text-sm font-semibold text-white mb-2",children:"Requirements"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Required"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.required.map(h=>c.jsxs("li",{children:["- ",h]},h))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Optional"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.optional.map(h=>c.jsxs("li",{children:["- ",h]},h))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Not used"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.notUsed.map(h=>c.jsxs("li",{children:["- ",h]},h))})]})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:()=>e(-1),className:"btn-secondary",children:"Back"}),c.jsx("button",{onClick:d,disabled:!f,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Open Report (Print/PDF)"}),!f&&c.jsx("div",{className:"text-sm text-dark-text-muted",children:"Select start + end date to enable report generation."})]})]})]})}function _le(e){const t=e.get("project")||void 0,r=e.get("startDate")||void 0,n=e.get("endDate")||void 0;return{project:t,startDate:r,endDate:n}}function aP(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function qm(e,t){const r=new Map;return e.forEach(n=>{const i=t(n)||"unknown";r.set(i,(r.get(i)||0)+1)}),Array.from(r.entries()).sort((n,i)=>i[1]-n[1])}const ct={blue:"#2563eb",green:"#10b981",red:"#ef4444",amber:"#f59e0b",violet:"#8b5cf6",slate:"#64748b"};function kle(e,t){return t?`${Math.round(e/t*100)}%`:"0%"}function Wm({items:e,total:t}){return c.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:6,marginTop:8},children:e.map(r=>c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:12},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("span",{style:{width:10,height:10,borderRadius:999,background:r.color,display:"inline-block"}}),c.jsx("span",{style:{color:"#111827",textTransform:"capitalize"},children:r.name})]}),c.jsxs("div",{style:{color:"#111827"},children:[c.jsx("span",{style:{fontWeight:800},children:r.value.toLocaleString()})," ",c.jsxs("span",{style:{color:"#6b7280"},children:["(",kle(r.value,t),")"]})]})]},r.name))})}function Ur({title:e,children:t}){return c.jsxs("div",{style:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"white"},children:[c.jsx("div",{style:{fontSize:13,fontWeight:800,color:"#111827",marginBottom:10},children:e}),t]})}function Ale(){const[e]=Ah(),t=e.get("type")||"executive",r=k.useMemo(()=>_le(e),[e]),{data:n=[],isLoading:i}=Qe({queryKey:["runs-report",t,r],queryFn:()=>Ye.getRuns({limit:1e4,project:r.project,startDate:r.startDate,endDate:r.endDate}),staleTime:0});k.useEffect(()=>{const m=setTimeout(()=>{try{window.print()}catch{}},300);return()=>clearTimeout(m)},[]);const a=k.useMemo(()=>{const m=n.length,y=n.filter(S=>S.status==="success").length,b=n.filter(S=>S.status==="failed").length,g=n.filter(S=>S.status==="cancelled").length,x=n.reduce((S,w)=>S+(w.shots||0),0);return{total:m,success:y,failed:b,cancelled:g,shots:x}},[n]),o=k.useMemo(()=>qm(n,m=>m.project),[n]),s=k.useMemo(()=>qm(n,m=>m.provider),[n]),l=k.useMemo(()=>qm(n,m=>m.backend_name),[n]),u=k.useMemo(()=>{const m=s.slice(0,6),y=m.reduce((S,[,w])=>S+w,0),b=Math.max(a.total-y,0),g=[ct.blue,ct.violet,ct.green,ct.amber,ct.red,ct.slate],x=m.map(([S,w],j)=>({name:S,value:w,color:g[j%g.length]}));return b>0&&x.push({name:"other",value:b,color:"#9ca3af"}),x.filter(S=>S.value>0)},[s,a.total]),f=k.useMemo(()=>{const m=a.success,y=a.failed,b=a.cancelled,g=Math.max(a.total-m-y-b,0);return[{name:"success",value:m,color:ct.green},{name:"failed",value:y,color:ct.red},{name:"cancelled",value:b,color:ct.slate},...g?[{name:"other",value:g,color:ct.amber}]:[]].filter(x=>x.value>0)},[a]),d=k.useMemo(()=>{const m=[{label:"0-10",min:0,max:10,value:0},{label:"11-100",min:11,max:100,value:0},{label:"101-1K",min:101,max:1e3,value:0},{label:"1K-10K",min:1001,max:1e4,value:0},{label:"10K+",min:10001,max:Number.POSITIVE_INFINITY,value:0}];return n.forEach(y=>{const b=y.shots||0,g=m.find(x=>b>=x.min&&b<=x.max);g&&(g.value+=1)}),m.filter(y=>y.value>0)},[n]),h=k.useMemo(()=>{const m=new Map;return n.forEach(y=>{const b=new Date(y.created_at),g=`${b.getUTCFullYear()}-${String(b.getUTCMonth()+1).padStart(2,"0")}-${String(b.getUTCDate()).padStart(2,"0")}`;m.has(g)||m.set(g,{date:g,runs:0}),m.get(g).runs+=1}),Array.from(m.values()).sort((y,b)=>y.date.localeCompare(b.date)).map(y=>({...y,label:y.date.slice(5)}))},[n]),p=k.useMemo(()=>{const m=g=>g.provider==="unknown"||g.backend_name==="unknown",y=g=>(g.shots||0)<=10,b=g=>g.status==="failed";return n.filter(g=>m(g)||y(g)||b(g)).sort((g,x)=>new Date(x.created_at).getTime()-new Date(g.created_at).getTime()).slice(0,40)},[n]),v=t==="home"?"Home Dashboard Export":t==="analytics"?"Run Analytics Dashboard Export":t==="executive"?"Executive Summary Report":t==="provider_backend"?"Provider/Backend Performance Report":"Run Quality / Anomaly Report";return c.jsxs("div",{style:{padding:24,fontFamily:"system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif"},children:[c.jsx("style",{children:` +)`})]})]}):c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Algorithm Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:h-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Algorithm-specific performance analysis and cross-SDK comparison"})]}),c.jsxs("div",{className:"card",children:[c.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Select Algorithm"}),c.jsx("select",{value:r,onChange:x=>n(x.target.value),className:"bg-dark-bg border border-dark-border rounded-lg px-4 py-2 text-dark-text w-full max-w-md",children:i.map(x=>c.jsxs("option",{value:x.name,children:[x.name," (",x.count," runs)"]},x.name))})]}),r?s?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading algorithm data..."}):u.length===0?c.jsx("div",{className:"card text-center py-12",children:c.jsx("p",{className:"text-dark-text-muted",children:"No runs found for selected algorithm with current filters."})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Total Runs"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:u.length})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Success Rate"}),c.jsxs("p",{className:"text-3xl font-bold text-white",children:[b.toFixed(1),"%"]}),c.jsxs("p",{className:"text-xs text-dark-text-muted mt-1",children:["Overall: ",y.toFixed(1),"%"]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Avg Shots"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:u.length>0?Math.round(u.reduce((x,S)=>x+S.shots,0)/u.length):0})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"SDKs Used"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:h.length})]})]}),h.length>0&&c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Success Rate by SDK/Provider"}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"sdk",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(or,{dataKey:"successRate",fill:"#3b82f6",radius:[4,4,0,0],children:h.map((x,S)=>c.jsx(vr,{fill:g[S%g.length]},`cell-${S}`))})]})})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Average Shots by SDK/Provider"}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"sdk",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(or,{dataKey:"avgShots",fill:"#8b5cf6",radius:[4,4,0,0],children:h.map((x,S)=>c.jsx(vr,{fill:g[S%g.length]},`cell-${S}`))})]})})]})]}),h.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:["Best Performing SDK for ",r]}),c.jsx("div",{className:"flex items-center gap-6",children:h.sort((x,S)=>S.successRate-x.successRate).slice(0,3).map((x,S)=>c.jsx("div",{className:"flex-1",children:c.jsxs("div",{className:`p-4 rounded-lg border-2 ${S===0?"border-primary bg-primary/10":"border-dark-border bg-dark-bg"}`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"text-sm font-medium text-dark-text-muted",children:S===0?"🥇 Best":S===1?"🥈 2nd":"🥉 3rd"}),c.jsxs("span",{className:"text-xs text-dark-text-muted",children:[x.totalRuns," runs"]})]}),c.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:x.sdk}),c.jsxs("div",{className:"text-sm text-dark-text-muted",children:[x.successRate.toFixed(1),"% success rate"]})]})},x.sdk))})]}),p.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:[r," Performance Over Time"]}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(_p,{data:p,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"date",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(Ji,{type:"monotone",dataKey:"successRate",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",r:4},activeDot:{r:6}})]})})]}),v.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:["Backend Performance for ",r]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Runs"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Success Rate"})]})}),c.jsx("tbody",{children:v.map(x=>c.jsxs("tr",{className:"border-b border-dark-border hover:bg-dark-bg/50 cursor-pointer",onClick:()=>t(`/runs-filtered?algorithm=${r}&provider=${x.backend.split("/")[0]}`),children:[c.jsx("td",{className:"py-3 px-4 text-dark-text",children:x.backend}),c.jsx("td",{className:"py-3 px-4 text-right text-dark-text",children:x.totalRuns}),c.jsxs("td",{className:"py-3 px-4 text-right text-dark-text",children:[x.successRate.toFixed(1),"%"]})]},x.backend))})]})})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Algorithm-Specific Metrics"}),m?c.jsxs("div",{className:"space-y-4",children:[r.toLowerCase().includes("vqe")&&m.vqe.energies.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"VQE Energy Values"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Min:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:Math.min(...m.vqe.energies).toFixed(4)})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Max:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:Math.max(...m.vqe.energies).toFixed(4)})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:(m.vqe.energies.reduce((x,S)=>x+S,0)/m.vqe.energies.length).toFixed(4)})]})]})]}),r.toLowerCase().includes("grover")&&m.grover.targetSuccessRates.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Grover's Target Success Rates"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg Expected:"}),c.jsxs("span",{className:"ml-2 text-white font-semibold",children:[(m.grover.targetSuccessRates.reduce((x,S)=>x+S,0)/m.grover.targetSuccessRates.length*100).toFixed(1),"%"]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Actual:"}),c.jsxs("span",{className:"ml-2 text-white font-semibold",children:[b.toFixed(1),"%"]})]})]})]}),(r.toLowerCase().includes("optimization")||r.toLowerCase().includes("qubo")||r.toLowerCase().includes("ising"))&&m.optimization.approximationRatios.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Approximation Ratios"}),c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:(m.optimization.approximationRatios.reduce((x,S)=>x+S,0)/m.optimization.approximationRatios.length).toFixed(3)})]})})]})]}):c.jsxs("div",{className:"text-center py-8 text-dark-text-muted",children:[c.jsxs("p",{className:"mb-2",children:["Add ",c.jsx("code",{className:"bg-dark-bg px-2 py-1 rounded text-primary",children:"benchmark_params"})," to your runs to see algorithm-specific metrics."]}),c.jsx("p",{className:"text-sm",children:"Example: For VQE, include energy values; for Grover's, include target bitstrings."})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:[r," Runs"]}),c.jsx(ch,{runs:u})]})]}):c.jsx("div",{className:"card text-center py-12",children:c.jsx("p",{className:"text-dark-text-muted",children:"Select an algorithm to view metrics."})})]})}function xle(){const{data:e,isLoading:t}=Qe({queryKey:["settings"],queryFn:()=>Ye.getSettings()});return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Settings"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white flex items-center gap-2",children:[c.jsx(oD,{className:"w-5 h-5"}),"Data Directory"]}),t?c.jsx("p",{className:"text-dark-text-muted",children:"Loading..."}):e?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-dark-text-muted mb-2",children:"Current Data Directory:"}),c.jsx("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-3 font-mono text-sm text-dark-text break-all",children:e.data_dir}),e.data_dir==="/data"&&c.jsxs("p",{className:"text-xs text-primary mt-2",children:["🐳 Running in ",c.jsx("strong",{children:"Docker mode"})," - data stored in Docker volume"]})]}),c.jsx("div",{className:"bg-dark-bg/50 border border-dark-border rounded-lg p-4",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Xk,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"space-y-2 text-sm text-dark-text-muted",children:[e.data_dir==="/data"?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-dark-text font-medium",children:"Docker Mode: Data in Docker Volume"}),c.jsxs("p",{className:"text-xs",children:["Data is stored in a Docker volume named ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker_qobserva_data"}),"."]}),c.jsx("p",{className:"text-dark-text font-medium mt-3",children:"How to Access Data:"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["View volume location: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker volume inspect docker_qobserva_data"})]}),c.jsxs("li",{children:["Access from container: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker exec -it docker-collector-1 ls -la /data"})]}),c.jsxs("li",{children:["Copy files out: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker cp docker-collector-1:/data/qobserva.sqlite3 ./"})]})]}),c.jsx("p",{className:"text-dark-text font-medium mt-3",children:"How to Change Data Directory (Docker):"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["Edit ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker/docker-compose.yml"})," and update the volume mount"]}),c.jsxs("li",{children:["Or set ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"QOBSERVA_DATA_DIR"})," in the environment section"]}),c.jsxs("li",{children:["Restart: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"make docker-down && make docker-up"})]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-dark-text font-medium",children:"How to Change Data Directory:"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["Set the ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"QOBSERVA_DATA_DIR"})," environment variable to your desired path"]}),c.jsxs("li",{children:["Stop QObserva: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"qobserva down"})]}),c.jsxs("li",{children:["Start QObserva: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"qobserva up"})]})]})]}),c.jsxs("p",{className:"text-xs mt-3 pt-3 border-t border-dark-border",children:[c.jsx("strong",{children:"Note:"})," The data directory cannot be changed at runtime. All runs, database, and artifacts are stored in this directory."]})]})]})}),c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("p",{className:"text-xs text-dark-text-muted mb-2",children:"Data Structure:"}),c.jsxs("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-3 font-mono text-xs text-dark-text",children:[c.jsxs("div",{children:[e.data_dir,"/"]}),c.jsxs("div",{className:"ml-4",children:["├── qobserva.sqlite3 ",c.jsx("span",{className:"text-dark-text-muted",children:"(database)"})]}),c.jsx("div",{className:"ml-4",children:"└── artifacts/"}),c.jsxs("div",{className:"ml-8",children:["├── ","{project}/"]}),c.jsxs("div",{className:"ml-12",children:["└── ","{run_id}/"]}),c.jsx("div",{className:"ml-16",children:"├── event.json"}),c.jsx("div",{className:"ml-16",children:"└── analysis.json"})]})]})]}):c.jsx("p",{className:"text-dark-text-muted",children:"Unable to load settings."})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"About"}),c.jsxs("div",{className:"space-y-2 text-sm text-dark-text-muted",children:[c.jsx("p",{children:c.jsxs("strong",{className:"text-dark-text",children:["QObserva v",(e==null?void 0:e.qobserva_version)||"unknown"]})}),c.jsx("p",{children:"Local-first observability and benchmarking for quantum program executions."}),c.jsxs("p",{className:"text-xs",children:["Components: agent v",(e==null?void 0:e.qobserva_agent_version)||"unknown"," | collector v",(e==null?void 0:e.qobserva_collector_version)||"unknown"," | local v",(e==null?void 0:e.qobserva_local_version)||"unknown"]}),c.jsxs("ul",{className:"list-disc list-inside space-y-1 mt-4",children:[c.jsx("li",{children:"Standardized run telemetry"}),c.jsx("li",{children:"Metrics and insights generation"}),c.jsx("li",{children:"Multi-SDK support (Qiskit, Braket, Cirq, PennyLane, pyQuil, D-Wave)"})]})]})]})]})}function ble({runs:e}){const t=mt(),r=k.useMemo(()=>{const i=new Map;return e.forEach(a=>{const o=a.backend_name;i.has(o)||i.set(o,{backend_name:a.backend_name,provider:a.provider,total:0,success:0,failed:0,cancelled:0});const s=i.get(o);s.total++,a.status==="success"?s.success++:a.status==="failed"?s.failed++:a.status==="cancelled"&&s.cancelled++}),Array.from(i.values()).sort((a,o)=>o.total-a.total)},[e]),n=i=>{t(`/?provider=${encodeURIComponent(i)}`)};return r.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No backend data available"}):c.jsx("div",{children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend Name"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Total Runs"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Success"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Failed"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Cancelled"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Success Rate"})]})}),c.jsx("tbody",{children:r.map(i=>{const a=i.total>0?i.success/i.total*100:0;return c.jsxs("tr",{onClick:()=>n(i.provider),className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 cursor-pointer transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text font-medium",children:i.backend_name}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:i.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text text-right",children:i.total.toLocaleString()}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-success font-medium",children:i.success.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-error font-medium",children:i.failed.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-dark-text-muted font-medium",children:i.cancelled.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsxs("span",{className:`text-sm font-semibold ${a>=80?"text-success":a>=50?"text-warning":"text-error"}`,children:[a.toFixed(1),"%"]})})]},i.backend_name)})})]})})})}function wle({backendStats:e}){const t=()=>{zI(e,"qobserva-backends")};return c.jsxs("button",{onClick:t,className:"btn-secondary flex items-center gap-2 ml-auto",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}const aP={success:"#10b981",failed:"#ef4444",cancelled:"#6b7280",default:"#3b82f6"};function Sle({runs:e}){const t=mt(),r=k.useMemo(()=>e.sort((o,s)=>new Date(o.created_at).getTime()-new Date(s.created_at).getTime()).map(o=>({x:new Date(o.created_at).getTime(),y:o.shots,shots:o.shots,runId:o.run_id,status:o.status,project:o.project,backend:o.backend_name,createdAt:o.created_at,formattedDate:new Date(o.created_at).toLocaleString()})),[e]),n=o=>{o&&o.runId&&t(`/runs/${o.runId}`)},i=({active:o,payload:s})=>{if(o&&s&&s.length){const l=s[0].payload;return c.jsxs("div",{className:"bg-dark-surface border border-primary/30 rounded-lg p-3 shadow-xl z-50 min-w-[200px]",children:[c.jsx("p",{className:"text-white font-semibold mb-2",children:l.formattedDate||new Date(l.createdAt).toLocaleString()}),c.jsxs("div",{className:"space-y-1 text-sm",children:[c.jsxs("p",{className:"text-dark-text-muted",children:["Shots: ",c.jsx("span",{className:"text-primary font-semibold",children:l.shots.toLocaleString()})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Status: ",c.jsx("span",{className:"text-white font-medium capitalize",children:l.status})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Backend: ",c.jsx("span",{className:"text-white font-medium",children:l.backend})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Project: ",c.jsx("span",{className:"text-white font-medium",children:l.project})]}),c.jsx("p",{className:"text-xs text-primary/70 mt-2 pt-2 border-t border-dark-border cursor-pointer",children:"Click dot to view details"})]})]})}return null};if(r.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No shots data available"});const a=o=>{const{cx:s,cy:l,payload:u}=o,f=aP[u==null?void 0:u.status]||aP.default;return c.jsxs("g",{onClick:()=>n(u),style:{cursor:"pointer"},children:[c.jsx("circle",{cx:s||0,cy:l||0,r:10,fill:"transparent",pointerEvents:"all"}),c.jsx("circle",{cx:s||0,cy:l||0,r:6,fill:f,stroke:"#1e293b",strokeWidth:2,className:"hover:r-7 hover:stroke-primary transition-all duration-150"})]})};return c.jsx(tt,{width:"100%",height:500,children:c.jsxs(_p,{data:r,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"x",name:"Time",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},domain:["dataMin","dataMax"],scale:"time",tickFormatter:o=>new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),label:{value:"Time",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"y",name:"Shots",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Shots",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{content:c.jsx(i,{}),cursor:{strokeDasharray:"3 3",stroke:"#3b82f6"}}),c.jsx(Ji,{type:"monotone",dataKey:"shots",stroke:"#3b82f6",strokeWidth:2,strokeOpacity:.5,dot:a,activeDot:{r:8,fill:"#3b82f6",stroke:"#1e293b",strokeWidth:2,style:{cursor:"pointer"}},onClick:o=>{o&&o.payload&&n(o.payload)},style:{cursor:"pointer"}})]})})}function jle(){const[e]=Ah(),t=mt(),r=e.get("type")||"all",n=k.useMemo(()=>{const l={limit:1e4},u=e.get("project"),f=e.get("provider"),d=e.get("status"),h=e.get("startDate"),p=e.get("endDate");return u&&(l.project=u),f&&(l.provider=f),h&&(l.startDate=h),p&&(l.endDate=p),d?l.status=d:r==="success"?l.status="success":r==="failed"&&(l.status="failed"),l},[e,r]),{data:i=[],isLoading:a}=Qe({queryKey:["runs",n],queryFn:()=>Ye.getRuns(n),staleTime:0}),o=k.useMemo(()=>{const l=new Map;return i.forEach(u=>{const f=u.backend_name;l.has(f)||l.set(f,{backend_name:u.backend_name,provider:u.provider,total:0,success:0,failed:0,cancelled:0});const d=l.get(f);d.total++,u.status==="success"?d.success++:u.status==="failed"?d.failed++:u.status==="cancelled"&&d.cancelled++}),Array.from(l.values()).sort((u,f)=>f.total-u.total)},[i]);let s="All Runs";return r==="success"?s="Successful Runs":r==="failed"?s="Failed Runs":r==="shots"?s="Runs by Shots":r==="backends"?s="Runs by Backend":status&&(s=`${status.charAt(0).toUpperCase()+status.slice(1)} Runs`),a?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."}):r==="shots"?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs)"]})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shots Distribution"}),c.jsx(Sle,{runs:i})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Runs List"}),c.jsx(Fg,{runs:i,title:"shots-runs"})]}),c.jsx(ch,{runs:i,highlightShots:!0,title:"shots-runs"})]})]}):r==="backends"?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs across ",new Set(i.map(l=>l.backend_name)).size," backends)"]})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Backend Statistics"}),c.jsx(wle,{backendStats:o})]}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Click on a backend row to filter by provider on the Home dashboard"}),c.jsx(ble,{runs:i})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs)"]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:s}),c.jsx(Fg,{runs:i,title:s.toLowerCase().replace(/\s+/g,"-")})]}),c.jsx(ch,{runs:i,title:s.toLowerCase().replace(/\s+/g,"-")})]})]})}function Ole(){const[e,t]=k.useState(""),r=mt(),{data:n=[],isLoading:i}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e4}),staleTime:5e3}),a=n.filter(l=>{if(!e.trim())return!1;const u=e.toLowerCase();return l.run_id.toLowerCase().includes(u)||l.project.toLowerCase().includes(u)||l.provider.toLowerCase().includes(u)||l.backend_name.toLowerCase().includes(u)||l.status.toLowerCase().includes(u)}),o=l=>{r(`/runs/${l}`)},s=l=>{l.key==="Enter"&&a.length===1&&o(a[0].run_id)};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Search Runs"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Search for runs by ID, project, provider, backend, or status"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"relative",children:[c.jsx(Yf,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-dark-text-muted",size:20}),c.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value),onKeyPress:s,placeholder:"Enter run ID, project, provider, backend, or status...",className:"w-full bg-dark-bg border border-dark-border rounded-lg pl-12 pr-4 py-3 text-dark-text text-lg focus:outline-none focus:border-primary/50",autoFocus:!0})]}),e&&c.jsxs("p",{className:"text-sm text-dark-text-muted mt-3",children:[i?"Searching...":`${a.length} run${a.length!==1?"s":""} found`,a.length===1&&" (Press Enter to view)"]})]}),e&&c.jsx("div",{className:"card",children:i?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Searching..."}):a.length===0?c.jsxs("div",{className:"text-center py-12",children:[c.jsx("p",{className:"text-dark-text-muted mb-2",children:"No runs found"}),c.jsx("p",{className:"text-sm text-dark-text-muted",children:"Try a different search term"})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"Results"}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Run ID"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Time"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Project"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Status"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Shots"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Action"})]})}),c.jsx("tbody",{children:a.slice(0,100).map(l=>c.jsxs("tr",{className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",onClick:u=>u.stopPropagation(),children:c.jsx(Ap,{runId:l.run_id})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:Yn(new Date(l.created_at),"MMM dd, HH:mm")}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.project}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.backend_name}),c.jsx("td",{className:"py-3 px-4",children:c.jsx("span",{className:`px-2 py-1 rounded text-xs font-semibold ${l.status==="success"?"bg-success/20 text-success":l.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:l.status})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.shots.toLocaleString()}),c.jsx("td",{className:"py-3 px-4",children:c.jsxs("button",{onClick:()=>o(l.run_id),className:"flex items-center gap-1 text-primary hover:text-primary/80 text-sm transition-colors",title:"View run details",children:["View",c.jsx(ZR,{size:14})]})})]},l.run_id))})]})}),a.length>100&&c.jsx("p",{className:"text-sm text-dark-text-muted mt-4 text-center",children:"Showing first 100 results. Refine your search to see more."})]})}),!e&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"How to Search"}),c.jsxs("ul",{className:"space-y-2 text-sm text-dark-text-muted",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Run ID:"})," Enter the full or partial run ID"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Project:"})," Search by project name"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Provider:"}),' Filter by provider (e.g., "ibm", "aws")']}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Backend:"})," Search by backend name"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Status:"}),' Filter by status (e.g., "success", "failed")']})]})]})]})}function Ple(e,t){const r=new URLSearchParams;return r.set("type",e),t.project&&r.set("project",t.project),t.startDate&&r.set("startDate",t.startDate),t.endDate&&r.set("endDate",t.endDate),`/report?${r.toString()}`}function _le(){const e=mt(),[t,r]=k.useState("executive"),[n,i]=k.useState(""),[a,o]=k.useState(""),[s,l]=k.useState(""),u=k.useMemo(()=>({required:["Date range (start + end)"],optional:["Project"],notUsed:["Provider","Status (reports are intentionally general)"]}),[]),f=!!(a&&s),d=()=>{const h=Ple(t,{project:n||void 0,startDate:a?new Date(a+"T00:00:00Z").toISOString().replace(/\.\d{3}Z$/,"Z"):void 0,endDate:s?new Date(s+"T23:59:59Z").toISOString().replace(/\.\d{3}Z$/,"Z"):void 0});window.open(h,"_blank","noopener,noreferrer")};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Generate Report"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Generate a PDF via browser print. Choose a report type, set filters, then print/save as PDF."})]}),c.jsxs("div",{className:"card space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Report Type"}),c.jsxs("select",{value:t,onChange:h=>r(h.target.value),className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm",children:[c.jsx("option",{value:"executive",children:"Executive Summary"}),c.jsx("option",{value:"provider_backend",children:"Provider/Backend Performance"}),c.jsx("option",{value:"quality_anomaly",children:"Run Quality / Anomaly"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Project (optional)"}),c.jsx("input",{value:n,onChange:h=>i(h.target.value),placeholder:"e.g. pennylane_test",className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Start Date (required)"}),c.jsx("input",{type:"date",value:a,onChange:h=>o(h.target.value),style:{colorScheme:"light"},className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm qobserva-date-input"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"End Date (required)"}),c.jsx("input",{type:"date",value:s,onChange:h=>l(h.target.value),style:{colorScheme:"light"},className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm qobserva-date-input"})]})]}),c.jsxs("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-4",children:[c.jsx("div",{className:"text-sm font-semibold text-white mb-2",children:"Requirements"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Required"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.required.map(h=>c.jsxs("li",{children:["- ",h]},h))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Optional"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.optional.map(h=>c.jsxs("li",{children:["- ",h]},h))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Not used"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.notUsed.map(h=>c.jsxs("li",{children:["- ",h]},h))})]})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:()=>e(-1),className:"btn-secondary",children:"Back"}),c.jsx("button",{onClick:d,disabled:!f,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Open Report (Print/PDF)"}),!f&&c.jsx("div",{className:"text-sm text-dark-text-muted",children:"Select start + end date to enable report generation."})]})]})]})}function kle(e){const t=e.get("project")||void 0,r=e.get("startDate")||void 0,n=e.get("endDate")||void 0;return{project:t,startDate:r,endDate:n}}function oP(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Wm(e,t){const r=new Map;return e.forEach(n=>{const i=t(n)||"unknown";r.set(i,(r.get(i)||0)+1)}),Array.from(r.entries()).sort((n,i)=>i[1]-n[1])}const ct={blue:"#2563eb",green:"#10b981",red:"#ef4444",amber:"#f59e0b",violet:"#8b5cf6",slate:"#64748b"};function Ale(e,t){return t?`${Math.round(e/t*100)}%`:"0%"}function Hm({items:e,total:t}){return c.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:6,marginTop:8},children:e.map(r=>c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:12},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("span",{style:{width:10,height:10,borderRadius:999,background:r.color,display:"inline-block"}}),c.jsx("span",{style:{color:"#111827",textTransform:"capitalize"},children:r.name})]}),c.jsxs("div",{style:{color:"#111827"},children:[c.jsx("span",{style:{fontWeight:800},children:r.value.toLocaleString()})," ",c.jsxs("span",{style:{color:"#6b7280"},children:["(",Ale(r.value,t),")"]})]})]},r.name))})}function Ur({title:e,children:t}){return c.jsxs("div",{style:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"white"},children:[c.jsx("div",{style:{fontSize:13,fontWeight:800,color:"#111827",marginBottom:10},children:e}),t]})}function Ele(){const[e]=Ah(),t=e.get("type")||"executive",r=k.useMemo(()=>kle(e),[e]),{data:n=[],isLoading:i}=Qe({queryKey:["runs-report",t,r],queryFn:()=>Ye.getRuns({limit:1e4,project:r.project,startDate:r.startDate,endDate:r.endDate}),staleTime:0});k.useEffect(()=>{const m=setTimeout(()=>{try{window.print()}catch{}},300);return()=>clearTimeout(m)},[]);const a=k.useMemo(()=>{const m=n.length,y=n.filter(S=>S.status==="success").length,b=n.filter(S=>S.status==="failed").length,g=n.filter(S=>S.status==="cancelled").length,x=n.reduce((S,w)=>S+(w.shots||0),0);return{total:m,success:y,failed:b,cancelled:g,shots:x}},[n]),o=k.useMemo(()=>Wm(n,m=>m.project),[n]),s=k.useMemo(()=>Wm(n,m=>m.provider),[n]),l=k.useMemo(()=>Wm(n,m=>m.backend_name),[n]),u=k.useMemo(()=>{const m=s.slice(0,6),y=m.reduce((S,[,w])=>S+w,0),b=Math.max(a.total-y,0),g=[ct.blue,ct.violet,ct.green,ct.amber,ct.red,ct.slate],x=m.map(([S,w],j)=>({name:S,value:w,color:g[j%g.length]}));return b>0&&x.push({name:"other",value:b,color:"#9ca3af"}),x.filter(S=>S.value>0)},[s,a.total]),f=k.useMemo(()=>{const m=a.success,y=a.failed,b=a.cancelled,g=Math.max(a.total-m-y-b,0);return[{name:"success",value:m,color:ct.green},{name:"failed",value:y,color:ct.red},{name:"cancelled",value:b,color:ct.slate},...g?[{name:"other",value:g,color:ct.amber}]:[]].filter(x=>x.value>0)},[a]),d=k.useMemo(()=>{const m=[{label:"0-10",min:0,max:10,value:0},{label:"11-100",min:11,max:100,value:0},{label:"101-1K",min:101,max:1e3,value:0},{label:"1K-10K",min:1001,max:1e4,value:0},{label:"10K+",min:10001,max:Number.POSITIVE_INFINITY,value:0}];return n.forEach(y=>{const b=y.shots||0,g=m.find(x=>b>=x.min&&b<=x.max);g&&(g.value+=1)}),m.filter(y=>y.value>0)},[n]),h=k.useMemo(()=>{const m=new Map;return n.forEach(y=>{const b=new Date(y.created_at),g=`${b.getUTCFullYear()}-${String(b.getUTCMonth()+1).padStart(2,"0")}-${String(b.getUTCDate()).padStart(2,"0")}`;m.has(g)||m.set(g,{date:g,runs:0}),m.get(g).runs+=1}),Array.from(m.values()).sort((y,b)=>y.date.localeCompare(b.date)).map(y=>({...y,label:y.date.slice(5)}))},[n]),p=k.useMemo(()=>{const m=g=>g.provider==="unknown"||g.backend_name==="unknown",y=g=>(g.shots||0)<=10,b=g=>g.status==="failed";return n.filter(g=>m(g)||y(g)||b(g)).sort((g,x)=>new Date(x.created_at).getTime()-new Date(g.created_at).getTime()).slice(0,40)},[n]),v=t==="home"?"Home Dashboard Export":t==="analytics"?"Run Analytics Dashboard Export":t==="executive"?"Executive Summary Report":t==="provider_backend"?"Provider/Backend Performance Report":"Run Quality / Anomaly Report";return c.jsxs("div",{style:{padding:24,fontFamily:"system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif"},children:[c.jsx("style",{children:` @media print { @page { margin: 12mm; } .no-print { display: none !important; } @@ -277,4 +277,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .kpi { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; background: white; } .kpi-title { font-size: 12px; color: #6b7280; margin-bottom: 4px; } .kpi-val { font-size: 18px; font-weight: 700; color: #111827; } - `}),c.jsxs("div",{className:"no-print",style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[c.jsx("div",{className:"muted",style:{fontSize:12},children:"Tip: Use browser “Save as PDF”. If the print dialog didn’t open, press Ctrl+P."}),c.jsx("button",{onClick:()=>window.print(),style:{padding:"8px 12px",border:"1px solid #e5e7eb",borderRadius:8,background:"white"},children:"Print / Save PDF"})]}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:22,fontWeight:800,color:"#111827"},children:v}),c.jsxs("div",{className:"muted",style:{fontSize:12,marginTop:4},children:["Generated: ",new Date().toLocaleString()]})]}),c.jsxs("div",{className:"muted",style:{fontSize:12,textAlign:"right"},children:[c.jsxs("div",{children:["Project: ",r.project||"All"]}),c.jsxs("div",{children:["Start: ",aP(r.startDate)]}),c.jsxs("div",{children:["End: ",aP(r.endDate)]})]})]}),c.jsx("div",{style:{height:4,borderRadius:999,background:"linear-gradient(90deg, #2563eb, #8b5cf6, #10b981)",marginTop:10}}),i?c.jsx("div",{style:{marginTop:24},className:"muted",children:"Loading report data…"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:10,marginTop:18},children:[c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Total Runs"}),c.jsx("div",{className:"kpi-val",children:a.total.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Success"}),c.jsx("div",{className:"kpi-val",children:a.success.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Failed"}),c.jsx("div",{className:"kpi-val",children:a.failed.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Cancelled"}),c.jsx("div",{className:"kpi-val",children:a.cancelled.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Total Shots"}),c.jsx("div",{className:"kpi-val",children:a.shots.toLocaleString()})]})]}),(t==="executive"||t==="home"||t==="analytics")&&c.jsxs("div",{style:{marginTop:18,display:"grid",gridTemplateColumns:"1.4fr 1fr",gap:14},children:[c.jsx(Ur,{title:"Run Volume Over Time",children:c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsxs(_p,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),c.jsx(it,{dataKey:"label",tick:{fill:"#374151",fontSize:11}}),c.jsx(at,{tick:{fill:"#374151",fontSize:11}}),c.jsx($e,{}),c.jsx(Ji,{type:"monotone",dataKey:"runs",stroke:ct.blue,strokeWidth:2,dot:{r:2}})]})})})}),c.jsxs(Ur,{title:"Status Distribution",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:f,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,label:({name:m,percent:y})=>`${String(m)} ${(y*100).toFixed(0)}%`,children:f.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Wm,{items:f,total:a.total})]})]}),t==="provider_backend"&&c.jsxs("div",{style:{marginTop:18,display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[c.jsx(Ur,{title:"Top Providers (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:s.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})}),c.jsx(Ur,{title:"Top Backends (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:l.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})}),c.jsxs(Ur,{title:"Provider Share (donut)",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:u,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,children:u.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Wm,{items:u,total:a.total})]}),c.jsx(Ur,{title:"Shots Distribution (buckets)",children:c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsxs(Ts,{data:d,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),c.jsx(it,{dataKey:"label",tick:{fill:"#374151",fontSize:11}}),c.jsx(at,{tick:{fill:"#374151",fontSize:11}}),c.jsx($e,{}),c.jsx(or,{dataKey:"value",fill:ct.violet})]})})})}),c.jsx(Ur,{title:"Projects (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:o.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})})]}),t==="quality_anomaly"&&c.jsxs("div",{style:{marginTop:18},children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[c.jsxs(Ur,{title:"Anomaly Counters",children:[c.jsxs("div",{style:{fontSize:12,color:"#111827",lineHeight:1.6},children:[c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.amber},children:n.filter(m=>m.provider==="unknown"||m.backend_name==="unknown").length.toLocaleString()})," ","runs with unknown provider/backend"]}),c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.violet},children:n.filter(m=>(m.shots||0)<=10).length.toLocaleString()})," ","low-shot runs (≤ 10)"]}),c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.red},children:a.failed.toLocaleString()})," failed runs"]})]}),c.jsx("div",{className:"muted",style:{marginTop:8,fontSize:12},children:"The table below lists a sample of runs that match these conditions."})]}),c.jsxs(Ur,{title:"Status Distribution",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:f,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,label:({name:m,percent:y})=>`${String(m)} ${(y*100).toFixed(0)}%`,children:f.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Wm,{items:f,total:a.total})]})]}),c.jsx("div",{style:{marginTop:14},children:c.jsx(Ur,{title:"Anomalous Runs (sample)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Run ID"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Shots"})]})}),c.jsx("tbody",{children:p.map(m=>c.jsxs("tr",{children:[c.jsx("td",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m.run_id}),c.jsx("td",{children:new Date(m.created_at).toLocaleString()}),c.jsx("td",{children:m.project}),c.jsx("td",{style:{color:m.provider==="unknown"?ct.amber:"#111827"},children:m.provider}),c.jsx("td",{style:{color:m.backend_name==="unknown"?ct.amber:"#111827"},children:m.backend_name}),c.jsx("td",{style:{color:m.status==="failed"?ct.red:"#111827"},children:m.status}),c.jsx("td",{style:{color:(m.shots||0)<=10?ct.violet:"#111827"},children:(m.shots||0).toLocaleString()})]},m.run_id))})]})})})]}),c.jsx("div",{className:"page-break",style:{marginTop:22},children:c.jsx(Ur,{title:"Recent Runs (sample)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Run ID"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Shots"})]})}),c.jsx("tbody",{children:n.slice().sort((m,y)=>new Date(y.created_at).getTime()-new Date(m.created_at).getTime()).slice(0,35).map(m=>c.jsxs("tr",{children:[c.jsx("td",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m.run_id}),c.jsx("td",{children:new Date(m.created_at).toLocaleString()}),c.jsx("td",{children:m.project}),c.jsx("td",{children:m.provider}),c.jsx("td",{children:m.backend_name}),c.jsx("td",{children:m.status}),c.jsx("td",{children:(m.shots||0).toLocaleString()})]},m.run_id))})]})})})]})]})}function Ele(){const[e,t]=k.useState({}),r=n=>{console.log("App: Filters changed to",n),t(n)};return c.jsx(qR,{children:c.jsx(WI,{onFilterChange:r,children:c.jsxs(RR,{children:[c.jsx(qr,{path:"/",element:c.jsx(Kse,{filters:e})}),c.jsx(qr,{path:"/search",element:c.jsx(jle,{})}),c.jsx(qr,{path:"/runs/:runId",element:c.jsx(tle,{})}),c.jsx(qr,{path:"/runs-filtered",element:c.jsx(Sle,{})}),c.jsx(qr,{path:"/compare",element:c.jsx(ole,{})}),c.jsx(qr,{path:"/analytics",element:c.jsx(vle,{filters:e})}),c.jsx(qr,{path:"/algorithms",element:c.jsx(yle,{filters:e})}),c.jsx(qr,{path:"/reports",element:c.jsx(Ple,{})}),c.jsx(qr,{path:"/report",element:c.jsx(Ale,{})}),c.jsx(qr,{path:"/settings",element:c.jsx(gle,{})})]})})})}const Nle=new EM({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});Hm.createRoot(document.getElementById("root")).render(c.jsx(_.StrictMode,{children:c.jsx(TM,{client:Nle,children:c.jsx(Ele,{})})})); + `}),c.jsxs("div",{className:"no-print",style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[c.jsx("div",{className:"muted",style:{fontSize:12},children:"Tip: Use browser “Save as PDF”. If the print dialog didn’t open, press Ctrl+P."}),c.jsx("button",{onClick:()=>window.print(),style:{padding:"8px 12px",border:"1px solid #e5e7eb",borderRadius:8,background:"white"},children:"Print / Save PDF"})]}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:22,fontWeight:800,color:"#111827"},children:v}),c.jsxs("div",{className:"muted",style:{fontSize:12,marginTop:4},children:["Generated: ",new Date().toLocaleString()]})]}),c.jsxs("div",{className:"muted",style:{fontSize:12,textAlign:"right"},children:[c.jsxs("div",{children:["Project: ",r.project||"All"]}),c.jsxs("div",{children:["Start: ",oP(r.startDate)]}),c.jsxs("div",{children:["End: ",oP(r.endDate)]})]})]}),c.jsx("div",{style:{height:4,borderRadius:999,background:"linear-gradient(90deg, #2563eb, #8b5cf6, #10b981)",marginTop:10}}),i?c.jsx("div",{style:{marginTop:24},className:"muted",children:"Loading report data…"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:10,marginTop:18},children:[c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Total Runs"}),c.jsx("div",{className:"kpi-val",children:a.total.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Success"}),c.jsx("div",{className:"kpi-val",children:a.success.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Failed"}),c.jsx("div",{className:"kpi-val",children:a.failed.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Cancelled"}),c.jsx("div",{className:"kpi-val",children:a.cancelled.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Total Shots"}),c.jsx("div",{className:"kpi-val",children:a.shots.toLocaleString()})]})]}),(t==="executive"||t==="home"||t==="analytics")&&c.jsxs("div",{style:{marginTop:18,display:"grid",gridTemplateColumns:"1.4fr 1fr",gap:14},children:[c.jsx(Ur,{title:"Run Volume Over Time",children:c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsxs(_p,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),c.jsx(it,{dataKey:"label",tick:{fill:"#374151",fontSize:11}}),c.jsx(at,{tick:{fill:"#374151",fontSize:11}}),c.jsx($e,{}),c.jsx(Ji,{type:"monotone",dataKey:"runs",stroke:ct.blue,strokeWidth:2,dot:{r:2}})]})})})}),c.jsxs(Ur,{title:"Status Distribution",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:f,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,label:({name:m,percent:y})=>`${String(m)} ${(y*100).toFixed(0)}%`,children:f.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Hm,{items:f,total:a.total})]})]}),t==="provider_backend"&&c.jsxs("div",{style:{marginTop:18,display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[c.jsx(Ur,{title:"Top Providers (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:s.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})}),c.jsx(Ur,{title:"Top Backends (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:l.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})}),c.jsxs(Ur,{title:"Provider Share (donut)",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:u,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,children:u.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Hm,{items:u,total:a.total})]}),c.jsx(Ur,{title:"Shots Distribution (buckets)",children:c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsxs(Ts,{data:d,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),c.jsx(it,{dataKey:"label",tick:{fill:"#374151",fontSize:11}}),c.jsx(at,{tick:{fill:"#374151",fontSize:11}}),c.jsx($e,{}),c.jsx(or,{dataKey:"value",fill:ct.violet})]})})})}),c.jsx(Ur,{title:"Projects (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:o.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})})]}),t==="quality_anomaly"&&c.jsxs("div",{style:{marginTop:18},children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[c.jsxs(Ur,{title:"Anomaly Counters",children:[c.jsxs("div",{style:{fontSize:12,color:"#111827",lineHeight:1.6},children:[c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.amber},children:n.filter(m=>m.provider==="unknown"||m.backend_name==="unknown").length.toLocaleString()})," ","runs with unknown provider/backend"]}),c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.violet},children:n.filter(m=>(m.shots||0)<=10).length.toLocaleString()})," ","low-shot runs (≤ 10)"]}),c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.red},children:a.failed.toLocaleString()})," failed runs"]})]}),c.jsx("div",{className:"muted",style:{marginTop:8,fontSize:12},children:"The table below lists a sample of runs that match these conditions."})]}),c.jsxs(Ur,{title:"Status Distribution",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:f,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,label:({name:m,percent:y})=>`${String(m)} ${(y*100).toFixed(0)}%`,children:f.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Hm,{items:f,total:a.total})]})]}),c.jsx("div",{style:{marginTop:14},children:c.jsx(Ur,{title:"Anomalous Runs (sample)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Run ID"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Shots"})]})}),c.jsx("tbody",{children:p.map(m=>c.jsxs("tr",{children:[c.jsx("td",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m.run_id}),c.jsx("td",{children:new Date(m.created_at).toLocaleString()}),c.jsx("td",{children:m.project}),c.jsx("td",{style:{color:m.provider==="unknown"?ct.amber:"#111827"},children:m.provider}),c.jsx("td",{style:{color:m.backend_name==="unknown"?ct.amber:"#111827"},children:m.backend_name}),c.jsx("td",{style:{color:m.status==="failed"?ct.red:"#111827"},children:m.status}),c.jsx("td",{style:{color:(m.shots||0)<=10?ct.violet:"#111827"},children:(m.shots||0).toLocaleString()})]},m.run_id))})]})})})]}),c.jsx("div",{className:"page-break",style:{marginTop:22},children:c.jsx(Ur,{title:"Recent Runs (sample)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Run ID"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Shots"})]})}),c.jsx("tbody",{children:n.slice().sort((m,y)=>new Date(y.created_at).getTime()-new Date(m.created_at).getTime()).slice(0,35).map(m=>c.jsxs("tr",{children:[c.jsx("td",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m.run_id}),c.jsx("td",{children:new Date(m.created_at).toLocaleString()}),c.jsx("td",{children:m.project}),c.jsx("td",{children:m.provider}),c.jsx("td",{children:m.backend_name}),c.jsx("td",{children:m.status}),c.jsx("td",{children:(m.shots||0).toLocaleString()})]},m.run_id))})]})})})]})]})}function Nle(){const[e,t]=k.useState({}),r=n=>{t(n)};return c.jsx(WR,{children:c.jsx(HI,{onFilterChange:r,children:c.jsxs(DR,{children:[c.jsx(qr,{path:"/",element:c.jsx(Vse,{filters:e})}),c.jsx(qr,{path:"/search",element:c.jsx(Ole,{})}),c.jsx(qr,{path:"/runs/:runId",element:c.jsx(rle,{})}),c.jsx(qr,{path:"/runs-filtered",element:c.jsx(jle,{})}),c.jsx(qr,{path:"/compare",element:c.jsx(sle,{})}),c.jsx(qr,{path:"/analytics",element:c.jsx(yle,{filters:e})}),c.jsx(qr,{path:"/algorithms",element:c.jsx(gle,{filters:e})}),c.jsx(qr,{path:"/reports",element:c.jsx(_le,{})}),c.jsx(qr,{path:"/report",element:c.jsx(Ele,{})}),c.jsx(qr,{path:"/settings",element:c.jsx(xle,{})})]})})})}const Tle=new NM({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});Km.createRoot(document.getElementById("root")).render(c.jsx(_.StrictMode,{children:c.jsx($M,{client:Tle,children:c.jsx(Nle,{})})})); diff --git a/packages/qobserva_local/qobserva_local/ui_dist/index.html b/packages/qobserva_local/qobserva_local/ui_dist/index.html index ecd1d577..f889e629 100644 --- a/packages/qobserva_local/qobserva_local/ui_dist/index.html +++ b/packages/qobserva_local/qobserva_local/ui_dist/index.html @@ -17,8 +17,8 @@ QObserva Dashboard - - + +
diff --git a/packages/qobserva_ui_react/dist/assets/index-Au4EQVmF.css b/packages/qobserva_ui_react/dist/assets/index-C6Dqxgn4.css similarity index 96% rename from packages/qobserva_ui_react/dist/assets/index-Au4EQVmF.css rename to packages/qobserva_ui_react/dist/assets/index-C6Dqxgn4.css index aefb66b1..4924726f 100644 --- a/packages/qobserva_ui_react/dist/assets/index-Au4EQVmF.css +++ b/packages/qobserva_ui_react/dist/assets/index-C6Dqxgn4.css @@ -1 +1 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1));font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:1.5rem}.metric-card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:1.5rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.metric-card:hover{border-color:#3b82f680}.btn-primary{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1));padding:.5rem 1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.btn-secondary{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:.5rem 1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-secondary:hover{border-color:#3b82f680}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-12{margin-left:3rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-80{margin-left:20rem}.ml-auto{margin-left:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.min-h-screen{min-height:100vh}.w-16{width:4rem}.w-20{width:5rem}.w-32{width:8rem}.w-5{width:1.25rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[320px\]{min-width:320px}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dark-border{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-error\/30{border-color:#ef44444d}.border-primary{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-primary\/30{border-color:#3b82f64d}.border-warning{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-warning\/30{border-color:#f59e0b4d}.bg-dark-bg{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-dark-bg\/50{background-color:#0f172a80}.bg-dark-surface{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-dark-text-muted\/20{background-color:#94a3b833}.bg-error\/20{background-color:#ef444433}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-primary\/10{background-color:#3b82f61a}.bg-primary\/20{background-color:#3b82f633}.bg-primary\/5{background-color:#3b82f60d}.bg-success{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-success\/20{background-color:#10b98133}.bg-warning{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-warning\/10{background-color:#f59e0b1a}.bg-warning\/20{background-color:#f59e0b33}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-dark-text{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-dark-text-muted{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-error{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-primary\/70{color:#3b82f6b3}.text-success{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-warning{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-50{opacity:.5}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-500{transition-duration:.5s}.qobserva-date-input::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.9;cursor:pointer}.qobserva-date-input::-webkit-calendar-picker-indicator:hover{opacity:1}.hover\:border-primary\/30:hover{border-color:#3b82f64d}.hover\:border-primary\/50:hover{border-color:#3b82f680}.hover\:bg-dark-bg:hover{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-bg\/50:hover{background-color:#0f172a80}.hover\:bg-dark-bg\/80:hover{background-color:#0f172acc}.hover\:bg-dark-surface:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:#3b82f61a}.hover\:bg-primary\/90:hover{background-color:#3b82f6e6}.hover\:stroke-primary:hover{stroke:#3b82f6}.hover\:text-dark-text:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:#3b82f6cc}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-primary\/50:focus{border-color:#3b82f680}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 640px){.sm\:h-20{height:5rem}.sm\:h-24{height:6rem}.sm\:w-20{width:5rem}.sm\:w-24{width:6rem}}@media (min-width: 768px){.md\:h-24{height:6rem}.md\:h-28{height:7rem}.md\:w-24{width:6rem}.md\:w-28{width:7rem}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:h-32{height:8rem}.lg\:w-32{width:8rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:h-36{height:9rem}.xl\:w-36{width:9rem}} +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}body{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1));font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:1.5rem}.metric-card{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:1.5rem;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.metric-card:hover{border-color:#3b82f680}.btn-primary{border-radius:.5rem;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1));padding:.5rem 1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-primary:hover{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.btn-secondary{border-radius:.5rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1));--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1));padding:.5rem 1rem;font-weight:500;--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-secondary:hover{border-color:#3b82f680}.visible{visibility:visible}.invisible{visibility:hidden}.collapse{visibility:collapse}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.left-3{left:.75rem}.left-4{left:1rem}.right-0{right:0}.top-0{top:0}.top-1\/2{top:50%}.top-full{top:100%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-1{margin-left:.25rem}.ml-12{margin-left:3rem}.ml-16{margin-left:4rem}.ml-2{margin-left:.5rem}.ml-4{margin-left:1rem}.ml-8{margin-left:2rem}.ml-80{margin-left:20rem}.ml-auto{margin-left:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-16{height:4rem}.h-2{height:.5rem}.h-20{height:5rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-64{max-height:16rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.min-h-screen{min-height:100vh}.w-16{width:4rem}.w-20{width:5rem}.w-32{width:8rem}.w-5{width:1.25rem}.w-80{width:20rem}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-\[200px\]{min-width:200px}.min-w-\[320px\]{min-width:320px}.max-w-md{max-width:28rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate: -90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dark-border{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-error\/30{border-color:#ef44444d}.border-primary{--tw-border-opacity: 1;border-color:rgb(59 130 246 / var(--tw-border-opacity, 1))}.border-primary\/30{border-color:#3b82f64d}.border-warning{--tw-border-opacity: 1;border-color:rgb(245 158 11 / var(--tw-border-opacity, 1))}.border-warning\/30{border-color:#f59e0b4d}.bg-dark-bg{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-dark-bg\/50{background-color:#0f172a80}.bg-dark-surface{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-dark-text-muted\/20{background-color:#94a3b833}.bg-error\/20{background-color:#ef444433}.bg-primary{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}.bg-primary\/10{background-color:#3b82f61a}.bg-primary\/20{background-color:#3b82f633}.bg-primary\/5{background-color:#3b82f60d}.bg-success{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-success\/20{background-color:#10b98133}.bg-warning{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-warning\/10{background-color:#f59e0b1a}.bg-warning\/20{background-color:#f59e0b33}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pl-10{padding-left:2.5rem}.pl-12{padding-left:3rem}.pr-3{padding-right:.75rem}.pr-4{padding-right:1rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-dark-text{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-dark-text-muted{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-error{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-primary{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-primary\/70{color:#3b82f6b3}.text-success{--tw-text-opacity: 1;color:rgb(16 185 129 / var(--tw-text-opacity, 1))}.text-warning{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-0{opacity:0}.opacity-50{opacity:.5}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-500{transition-duration:.5s}.qobserva-date-input::-webkit-calendar-picker-indicator{filter:invert(1);opacity:.9;cursor:pointer}.qobserva-date-input::-webkit-calendar-picker-indicator:hover{opacity:1}.hover\:border-primary\/30:hover{border-color:#3b82f64d}.hover\:border-primary\/50:hover{border-color:#3b82f680}.hover\:bg-dark-bg:hover{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.hover\:bg-dark-bg\/50:hover{background-color:#0f172a80}.hover\:bg-dark-bg\/80:hover{background-color:#0f172acc}.hover\:bg-dark-surface:hover{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.hover\:bg-primary\/10:hover{background-color:#3b82f61a}.hover\:bg-primary\/90:hover{background-color:#3b82f6e6}.hover\:stroke-primary:hover{stroke:#3b82f6}.hover\:text-dark-text:hover{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.hover\:text-primary:hover{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.hover\:text-primary\/80:hover{color:#3b82f6cc}.hover\:underline:hover{text-decoration-line:underline}.focus\:border-primary\/50:focus{border-color:#3b82f680}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}@media (min-width: 640px){.sm\:h-20{height:5rem}.sm\:h-24{height:6rem}.sm\:w-20{width:5rem}.sm\:w-24{width:6rem}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 768px){.md\:h-24{height:6rem}.md\:h-28{height:7rem}.md\:w-24{width:6rem}.md\:w-28{width:7rem}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1024px){.lg\:h-32{height:8rem}.lg\:w-32{width:8rem}.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width: 1280px){.xl\:h-36{height:9rem}.xl\:w-36{width:9rem}} diff --git a/packages/qobserva_ui_react/dist/assets/index-C5K8xCns.js b/packages/qobserva_ui_react/dist/assets/index-DscupHIx.js similarity index 60% rename from packages/qobserva_ui_react/dist/assets/index-C5K8xCns.js rename to packages/qobserva_ui_react/dist/assets/index-DscupHIx.js index e8d8fb44..15e143a3 100644 --- a/packages/qobserva_ui_react/dist/assets/index-C5K8xCns.js +++ b/packages/qobserva_ui_react/dist/assets/index-DscupHIx.js @@ -1,4 +1,4 @@ -var e0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=(e,t,r)=>(Np(e,t,"read from private field"),r?r.call(e):t.get(e)),ne=(e,t,r)=>t.has(e)?e0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,n)=>(Np(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),he=(e,t,r)=>(Np(e,t,"access private method"),r);var Pc=(e,t,r,n)=>({set _(i){Y(e,t,i,r)},get _(){return $(e,t,n)}});function $T(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vP={exports:{}},fh={},yP={exports:{}},de={};/** +var t0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||t0("Cannot "+r);var $=(e,t,r)=>(Np(e,t,"read from private field"),r?r.call(e):t.get(e)),ne=(e,t,r)=>t.has(e)?t0("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Y=(e,t,r,n)=>(Np(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),he=(e,t,r)=>(Np(e,t,"access private method"),r);var Pc=(e,t,r,n)=>({set _(i){Y(e,t,i,r)},get _(){return $(e,t,n)}});function CT(e,t){for(var r=0;rn[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var _c=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Se(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yP={exports:{}},fh={},gP={exports:{}},de={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var e0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var oc=Symbol.for("react.element"),CT=Symbol.for("react.portal"),MT=Symbol.for("react.fragment"),RT=Symbol.for("react.strict_mode"),DT=Symbol.for("react.profiler"),IT=Symbol.for("react.provider"),LT=Symbol.for("react.context"),FT=Symbol.for("react.forward_ref"),BT=Symbol.for("react.suspense"),zT=Symbol.for("react.memo"),UT=Symbol.for("react.lazy"),t0=Symbol.iterator;function qT(e){return e===null||typeof e!="object"?null:(e=t0&&e[t0]||e["@@iterator"],typeof e=="function"?e:null)}var gP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},xP=Object.assign,bP={};function $s(e,t,r){this.props=e,this.context=t,this.refs=bP,this.updater=r||gP}$s.prototype.isReactComponent={};$s.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")};$s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wP(){}wP.prototype=$s.prototype;function zg(e,t,r){this.props=e,this.context=t,this.refs=bP,this.updater=r||gP}var Ug=zg.prototype=new wP;Ug.constructor=zg;xP(Ug,$s.prototype);Ug.isPureReactComponent=!0;var r0=Array.isArray,SP=Object.prototype.hasOwnProperty,qg={current:null},jP={key:!0,ref:!0,__self:!0,__source:!0};function OP(e,t,r){var n,i={},a=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)SP.call(t,n)&&!jP.hasOwnProperty(n)&&(i[n]=t[n]);var s=arguments.length-2;if(s===1)i.children=r;else if(1{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var QT=k,YT=Symbol.for("react.element"),XT=Symbol.for("react.fragment"),ZT=Object.prototype.hasOwnProperty,JT=QT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,e$={key:!0,ref:!0,__self:!0,__source:!0};function _P(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)ZT.call(t,n)&&!e$.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:YT,type:e,key:a,ref:o,props:i,_owner:JT.current}}fh.Fragment=XT;fh.jsx=_P;fh.jsxs=_P;vP.exports=fh;var c=vP.exports,Hm={},kP={exports:{}},br={},AP={exports:{}},EP={};/** + */var YT=k,XT=Symbol.for("react.element"),ZT=Symbol.for("react.fragment"),JT=Object.prototype.hasOwnProperty,e$=YT.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,t$={key:!0,ref:!0,__self:!0,__source:!0};function kP(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)JT.call(t,n)&&!t$.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:XT,type:e,key:a,ref:o,props:i,_owner:e$.current}}fh.Fragment=ZT;fh.jsx=kP;fh.jsxs=kP;yP.exports=fh;var c=yP.exports,Km={},AP={exports:{}},br={},EP={exports:{}},NP={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var e0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(C,B){var U=C.length;C.push(B);e:for(;0>>1,q=C[G];if(0>>1;Gi(V,U))iei(Le,V)?(C[G]=Le,C[ie]=U,G=ie):(C[G]=V,C[ce]=U,G=ce);else if(iei(Le,U))C[G]=Le,C[ie]=U,G=ie;else break e}}return B}function i(C,B){var U=C.sortIndex-B.sortIndex;return U!==0?U:C.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,d=null,h=3,p=!1,v=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var B=r(u);B!==null;){if(B.callback===null)n(u);else if(B.startTime<=C)n(u),B.sortIndex=B.expirationTime,t(l,B);else break;B=r(u)}}function S(C){if(m=!1,x(C),!v)if(r(l)!==null)v=!0,L(w);else{var B=r(u);B!==null&&z(S,B.startTime-C)}}function w(C,B){v=!1,m&&(m=!1,b(P),P=-1),p=!0;var U=h;try{for(x(B),d=r(l);d!==null&&(!(d.expirationTime>B)||C&&!N());){var G=d.callback;if(typeof G=="function"){d.callback=null,h=d.priorityLevel;var q=G(d.expirationTime<=B);B=e.unstable_now(),typeof q=="function"?d.callback=q:d===r(l)&&n(l),x(B)}else n(l);d=r(l)}if(d!==null)var ee=!0;else{var ce=r(u);ce!==null&&z(S,ce.startTime-B),ee=!1}return ee}finally{d=null,h=U,p=!1}}var j=!1,O=null,P=-1,A=5,E=-1;function N(){return!(e.unstable_now()-EC||125G?(C.sortIndex=U,t(u,C),r(l)===null&&C===r(u)&&(m?(b(P),P=-1):m=!0,z(S,U-G))):(C.sortIndex=q,t(l,C),v||p||(v=!0,L(w))),C},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(C){var B=h;return function(){var U=h;h=B;try{return C.apply(this,arguments)}finally{h=U}}}})(EP);AP.exports=EP;var t$=AP.exports;/** + */(function(e){function t(C,F){var z=C.length;C.push(F);e:for(;0>>1,q=C[G];if(0>>1;Gi(V,z))iei(Le,V)?(C[G]=Le,C[ie]=z,G=ie):(C[G]=V,C[ce]=z,G=ce);else if(iei(Le,z))C[G]=Le,C[ie]=z,G=ie;else break e}}return F}function i(C,F){var z=C.sortIndex-F.sortIndex;return z!==0?z:C.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],u=[],f=1,d=null,h=3,p=!1,v=!1,m=!1,y=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(C){for(var F=r(u);F!==null;){if(F.callback===null)n(u);else if(F.startTime<=C)n(u),F.sortIndex=F.expirationTime,t(l,F);else break;F=r(u)}}function S(C){if(m=!1,x(C),!v)if(r(l)!==null)v=!0,L(w);else{var F=r(u);F!==null&&U(S,F.startTime-C)}}function w(C,F){v=!1,m&&(m=!1,b(P),P=-1),p=!0;var z=h;try{for(x(F),d=r(l);d!==null&&(!(d.expirationTime>F)||C&&!N());){var G=d.callback;if(typeof G=="function"){d.callback=null,h=d.priorityLevel;var q=G(d.expirationTime<=F);F=e.unstable_now(),typeof q=="function"?d.callback=q:d===r(l)&&n(l),x(F)}else n(l);d=r(l)}if(d!==null)var ee=!0;else{var ce=r(u);ce!==null&&U(S,ce.startTime-F),ee=!1}return ee}finally{d=null,h=z,p=!1}}var j=!1,O=null,P=-1,A=5,E=-1;function N(){return!(e.unstable_now()-EC||125G?(C.sortIndex=z,t(u,C),r(l)===null&&C===r(u)&&(m?(b(P),P=-1):m=!0,U(S,z-G))):(C.sortIndex=q,t(l,C),v||p||(v=!0,L(w))),C},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(C){var F=h;return function(){var z=h;h=F;try{return C.apply(this,arguments)}finally{h=z}}}})(NP);EP.exports=NP;var r$=EP.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var e0=e=>{throw TypeError(e)};var Np=(e,t,r)=>t.has(e)||e0("Cannot "+r);var $=( * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var r$=k,gr=t$;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Km=Object.prototype.hasOwnProperty,n$=/^[: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]*$/,i0={},a0={};function i$(e){return Km.call(a0,e)?!0:Km.call(i0,e)?!1:n$.test(e)?a0[e]=!0:(i0[e]=!0,!1)}function a$(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function o$(e,t,r,n){if(t===null||typeof t>"u"||a$(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Vt(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Vt(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){kt[e]=new Vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Hg=/[\-:]([a-z])/g;function Kg(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(Hg,Kg);kt[t]=new Vt(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(Hg,Kg);kt[t]=new Vt(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(Hg,Kg);kt[t]=new Vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Vg(e,t,r,n){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Vm=Object.prototype.hasOwnProperty,i$=/^[: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]*$/,a0={},o0={};function a$(e){return Vm.call(o0,e)?!0:Vm.call(a0,e)?!1:i$.test(e)?o0[e]=!0:(a0[e]=!0,!1)}function o$(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function s$(e,t,r,n){if(t===null||typeof t>"u"||o$(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 Vt(e,t,r,n,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var kt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){kt[e]=new Vt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];kt[t]=new Vt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){kt[e]=new Vt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){kt[e]=new Vt(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){kt[e]=new Vt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){kt[e]=new Vt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){kt[e]=new Vt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){kt[e]=new Vt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){kt[e]=new Vt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Kg=/[\-:]([a-z])/g;function Vg(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(Kg,Vg);kt[t]=new Vt(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(Kg,Vg);kt[t]=new Vt(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(Kg,Vg);kt[t]=new Vt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){kt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!1,!1)});kt.xlinkHref=new Vt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){kt[e]=new Vt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gg(e,t,r,n){var i=kt.hasOwnProperty(t)?kt[t]:null;(i!==null?i.type!==0:n||!(2s||i[o]!==a[s]){var l=` -`+i[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Cp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Pl(e):""}function s$(e){switch(e.tag){case 5:return Pl(e.type);case 16:return Pl("Lazy");case 13:return Pl("Suspense");case 19:return Pl("SuspenseList");case 0:case 2:case 15:return e=Mp(e.type,!1),e;case 11:return e=Mp(e.type.render,!1),e;case 1:return e=Mp(e.type,!0),e;default:return""}}function Ym(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 uo:return"Fragment";case lo:return"Portal";case Vm:return"Profiler";case Gg:return"StrictMode";case Gm:return"Suspense";case Qm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $P:return(e.displayName||"Context")+".Consumer";case TP:return(e._context.displayName||"Context")+".Provider";case Qg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Yg:return t=e.displayName||null,t!==null?t:Ym(e.type)||"Memo";case si:t=e._payload,e=e._init;try{return Ym(e(t))}catch{}}return null}function l$(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 Ym(t);case 8:return t===Gg?"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 Fi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function MP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function u$(e){var t=MP(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ec(e){e._valueTracker||(e._valueTracker=u$(e))}function RP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=MP(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Of(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 Xm(e,t){var r=t.checked;return qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function s0(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Fi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function DP(e,t){t=t.checked,t!=null&&Vg(e,"checked",t,!1)}function Zm(e,t){DP(e,t);var r=Fi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Jm(e,t.type,r):t.hasOwnProperty("defaultValue")&&Jm(e,t.type,Fi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function l0(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Jm(e,t,r){(t!=="number"||Of(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var _l=Array.isArray;function _o(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Tl={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},c$=["Webkit","ms","Moz","O"];Object.keys(Tl).forEach(function(e){c$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tl[t]=Tl[e]})});function BP(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Tl.hasOwnProperty(e)&&Tl[e]?(""+t).trim():t+"px"}function zP(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=BP(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var f$=qe({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 rv(e,t){if(t){if(f$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function nv(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 iv=null;function Xg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var av=null,ko=null,Ao=null;function f0(e){if(e=uc(e)){if(typeof av!="function")throw Error(K(280));var t=e.stateNode;t&&(t=vh(t),av(e.stateNode,e.type,t))}}function UP(e){ko?Ao?Ao.push(e):Ao=[e]:ko=e}function qP(){if(ko){var e=ko,t=Ao;if(Ao=ko=null,f0(e),t)for(e=0;e>>=0,e===0?32:31-(S$(e)/j$|0)|0}var Tc=64,$c=4194304;function kl(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 Af(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=kl(s):(a&=o,a!==0&&(n=kl(a)))}else o=r&~i,o!==0?n=kl(o):a!==0&&(n=kl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function sc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zr(t),e[t]=r}function k$(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=Cl),b0=" ",w0=!1;function u_(e,t){switch(e){case"keyup":return tC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var co=!1;function nC(e,t){switch(e){case"compositionend":return c_(t);case"keypress":return t.which!==32?null:(w0=!0,b0);case"textInput":return e=t.data,e===b0&&w0?null:e;default:return null}}function iC(e,t){if(co)return e==="compositionend"||!ax&&u_(e,t)?(e=s_(),ff=rx=wi=null,co=!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:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=P0(r)}}function p_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?p_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function m_(){for(var e=window,t=Of();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Of(e.document)}return t}function ox(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 hC(e){var t=m_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&p_(r.ownerDocument.documentElement,r)){if(n!==null&&ox(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=_0(r,a);var o=_0(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,fo=null,fv=null,Rl=null,dv=!1;function k0(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;dv||fo==null||fo!==Of(n)||(n=fo,"selectionStart"in n&&ox(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rl&&nu(Rl,n)||(Rl=n,n=Tf(fv,"onSelect"),0mo||(e.current=gv[mo],gv[mo]=null,mo--)}function Ce(e,t){mo++,gv[mo]=e.current,e.current=t}var Bi={},Rt=Wi(Bi),er=Wi(!1),Da=Bi;function Go(e,t){var r=e.type.contextTypes;if(!r)return Bi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function tr(e){return e=e.childContextTypes,e!=null}function Cf(){Ie(er),Ie(Rt)}function M0(e,t,r){if(Rt.current!==Bi)throw Error(K(168));Ce(Rt,t),Ce(er,r)}function O_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(K(108,l$(e)||"Unknown",i));return qe({},r,n)}function Mf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bi,Da=Rt.current,Ce(Rt,e),Ce(er,er.current),!0}function R0(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=O_(e,t,Da),n.__reactInternalMemoizedMergedChildContext=e,Ie(er),Ie(Rt),Ce(Rt,e)):Ie(er),Ce(er,r)}var En=null,yh=!1,Gp=!1;function P_(e){En===null?En=[e]:En.push(e)}function PC(e){yh=!0,P_(e)}function Hi(){if(!Gp&&En!==null){Gp=!0;var e=0,t=Oe;try{var r=En;for(Oe=1;e>=o,i-=o,Cn=1<<32-Zr(t)+i|r<P?(A=O,O=null):A=O.sibling;var E=h(b,O,x[P],S);if(E===null){O===null&&(O=A);break}e&&O&&E.alternate===null&&t(b,O),g=a(E,g,P),j===null?w=E:j.sibling=E,j=E,O=A}if(P===x.length)return r(b,O),Fe&&aa(b,P),w;if(O===null){for(;PP?(A=O,O=null):A=O.sibling;var N=h(b,O,E.value,S);if(N===null){O===null&&(O=A);break}e&&O&&N.alternate===null&&t(b,O),g=a(N,g,P),j===null?w=N:j.sibling=N,j=N,O=A}if(E.done)return r(b,O),Fe&&aa(b,P),w;if(O===null){for(;!E.done;P++,E=x.next())E=d(b,E.value,S),E!==null&&(g=a(E,g,P),j===null?w=E:j.sibling=E,j=E);return Fe&&aa(b,P),w}for(O=n(b,O);!E.done;P++,E=x.next())E=p(O,b,P,E.value,S),E!==null&&(e&&E.alternate!==null&&O.delete(E.key===null?P:E.key),g=a(E,g,P),j===null?w=E:j.sibling=E,j=E);return e&&O.forEach(function(T){return t(b,T)}),Fe&&aa(b,P),w}function y(b,g,x,S){if(typeof x=="object"&&x!==null&&x.type===uo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ac:e:{for(var w=x.key,j=g;j!==null;){if(j.key===w){if(w=x.type,w===uo){if(j.tag===7){r(b,j.sibling),g=i(j,x.props.children),g.return=b,b=g;break e}}else if(j.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===si&&L0(w)===j.type){r(b,j.sibling),g=i(j,x.props),g.ref=ll(b,j,x),g.return=b,b=g;break e}r(b,j);break}else t(b,j);j=j.sibling}x.type===uo?(g=$a(x.props.children,b.mode,S,x.key),g.return=b,b=g):(S=xf(x.type,x.key,x.props,null,b.mode,S),S.ref=ll(b,g,x),S.return=b,b=S)}return o(b);case lo:e:{for(j=x.key;g!==null;){if(g.key===j)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){r(b,g.sibling),g=i(g,x.children||[]),g.return=b,b=g;break e}else{r(b,g);break}else t(b,g);g=g.sibling}g=rm(x,b.mode,S),g.return=b,b=g}return o(b);case si:return j=x._init,y(b,g,j(x._payload),S)}if(_l(x))return v(b,g,x,S);if(nl(x))return m(b,g,x,S);Fc(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(r(b,g.sibling),g=i(g,x),g.return=b,b=g):(r(b,g),g=tm(x,b.mode,S),g.return=b,b=g),o(b)):r(b,g)}return y}var Yo=E_(!0),N_=E_(!1),If=Wi(null),Lf=null,go=null,cx=null;function fx(){cx=go=Lf=null}function dx(e){var t=If.current;Ie(If),e._currentValue=t}function wv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function No(e,t){Lf=e,cx=go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Zt=!0),e.firstContext=null)}function Rr(e){var t=e._currentValue;if(cx!==e)if(e={context:e,memoizedValue:t,next:null},go===null){if(Lf===null)throw Error(K(308));go=e,Lf.dependencies={lanes:0,firstContext:e}}else go=go.next=e;return t}var ha=null;function hx(e){ha===null?ha=[e]:ha.push(e)}function T_(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,hx(t)):(r.next=i.next,i.next=r),t.interleaved=r,qn(e,n)}function qn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var li=!1;function px(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $_(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 Ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ti(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ve&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,qn(e,r)}return i=n.interleaved,i===null?(t.next=t,hx(n)):(t.next=i.next,i.next=t),n.interleaved=t,qn(e,r)}function hf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Jg(e,r)}}function F0(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ff(e,t,r,n){var i=e.updateQueue;li=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;o=0,f=u=l=null,s=a;do{var h=s.lane,p=s.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,m=s;switch(h=t,p=r,m.tag){case 1:if(v=m.payload,typeof v=="function"){d=v.call(p,d,h);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(p,d,h):v,h==null)break e;d=qe({},d,h);break e;case 2:li=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=p,l=d):f=f.next=p,o|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(f===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Fa|=o,e.lanes=o,e.memoizedState=d}}function B0(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Yp.transition;Yp.transition={};try{e(!1),t()}finally{Oe=r,Yp.transition=n}}function Q_(){return Dr().memoizedState}function EC(e,t,r){var n=Ci(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},Y_(e))X_(t,r);else if(r=T_(e,t,r,n),r!==null){var i=qt();Jr(r,e,n,i),Z_(r,t,n)}}function NC(e,t,r){var n=Ci(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(Y_(e))X_(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,tn(s,o)){var l=t.interleaved;l===null?(i.next=i,hx(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=T_(e,t,i,n),r!==null&&(i=qt(),Jr(r,e,n,i),Z_(r,t,n))}}function Y_(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function X_(e,t){Dl=zf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Z_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Jg(e,r)}}var Uf={readContext:Rr,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useInsertionEffect:Et,useLayoutEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useMutableSource:Et,useSyncExternalStore:Et,useId:Et,unstable_isNewReconciler:!1},TC={readContext:Rr,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:Rr,useEffect:U0,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mf(4194308,4,W_.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mf(4194308,4,e,t)},useInsertionEffect:function(e,t){return mf(4,2,e,t)},useMemo:function(e,t){var r=ln();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ln();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=EC.bind(null,Ue,e),[n.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:z0,useDebugValue:Sx,useDeferredValue:function(e){return ln().memoizedState=e},useTransition:function(){var e=z0(!1),t=e[0];return e=AC.bind(null,e[1]),ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ue,i=ln();if(Fe){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),wt===null)throw Error(K(349));La&30||D_(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,U0(L_.bind(null,n,a,e),[e]),n.flags|=2048,fu(9,I_.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ln(),t=wt.identifierPrefix;if(Fe){var r=Mn,n=Cn;r=(n&~(1<<32-Zr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=uu++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{Cp=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Pl(e):""}function l$(e){switch(e.tag){case 5:return Pl(e.type);case 16:return Pl("Lazy");case 13:return Pl("Suspense");case 19:return Pl("SuspenseList");case 0:case 2:case 15:return e=Mp(e.type,!1),e;case 11:return e=Mp(e.type.render,!1),e;case 1:return e=Mp(e.type,!0),e;default:return""}}function Xm(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 uo:return"Fragment";case lo:return"Portal";case Gm:return"Profiler";case Qg:return"StrictMode";case Qm:return"Suspense";case Ym:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case CP:return(e.displayName||"Context")+".Consumer";case $P:return(e._context.displayName||"Context")+".Provider";case Yg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Xg:return t=e.displayName||null,t!==null?t:Xm(e.type)||"Memo";case si:t=e._payload,e=e._init;try{return Xm(e(t))}catch{}}return null}function u$(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 Xm(t);case 8:return t===Qg?"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 Fi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function RP(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function c$(e){var t=RP(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){n=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ec(e){e._valueTracker||(e._valueTracker=c$(e))}function DP(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=RP(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Of(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 Zm(e,t){var r=t.checked;return qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function l0(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=Fi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function IP(e,t){t=t.checked,t!=null&&Gg(e,"checked",t,!1)}function Jm(e,t){IP(e,t);var r=Fi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?ev(e,t.type,r):t.hasOwnProperty("defaultValue")&&ev(e,t.type,Fi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function u0(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function ev(e,t,r){(t!=="number"||Of(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var _l=Array.isArray;function _o(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Nc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xl(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Tl={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},f$=["Webkit","ms","Moz","O"];Object.keys(Tl).forEach(function(e){f$.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tl[t]=Tl[e]})});function zP(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Tl.hasOwnProperty(e)&&Tl[e]?(""+t).trim():t+"px"}function UP(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=zP(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}var d$=qe({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 nv(e,t){if(t){if(d$[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function iv(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 av=null;function Zg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ov=null,ko=null,Ao=null;function d0(e){if(e=uc(e)){if(typeof ov!="function")throw Error(K(280));var t=e.stateNode;t&&(t=vh(t),ov(e.stateNode,e.type,t))}}function qP(e){ko?Ao?Ao.push(e):Ao=[e]:ko=e}function WP(){if(ko){var e=ko,t=Ao;if(Ao=ko=null,d0(e),t)for(e=0;e>>=0,e===0?32:31-(j$(e)/O$|0)|0}var Tc=64,$c=4194304;function kl(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 Af(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,i=e.suspendedLanes,a=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~i;s!==0?n=kl(s):(a&=o,a!==0&&(n=kl(a)))}else o=r&~i,o!==0?n=kl(o):a!==0&&(n=kl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&i)&&(i=n&-n,a=t&-t,i>=a||i===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function sc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Zr(t),e[t]=r}function A$(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=Cl),w0=" ",S0=!1;function c_(e,t){switch(e){case"keyup":return rC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function f_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var co=!1;function iC(e,t){switch(e){case"compositionend":return f_(t);case"keypress":return t.which!==32?null:(S0=!0,w0);case"textInput":return e=t.data,e===w0&&S0?null:e;default:return null}}function aC(e,t){if(co)return e==="compositionend"||!ox&&c_(e,t)?(e=l_(),ff=nx=wi=null,co=!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:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=_0(r)}}function m_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?m_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function v_(){for(var e=window,t=Of();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Of(e.document)}return t}function sx(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 pC(e){var t=v_(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&m_(r.ownerDocument.documentElement,r)){if(n!==null&&sx(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!e.extend&&a>n&&(i=n,n=a,a=i),i=k0(r,a);var o=k0(r,n);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,fo=null,dv=null,Rl=null,hv=!1;function A0(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;hv||fo==null||fo!==Of(n)||(n=fo,"selectionStart"in n&&sx(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Rl&&nu(Rl,n)||(Rl=n,n=Tf(dv,"onSelect"),0mo||(e.current=xv[mo],xv[mo]=null,mo--)}function Ce(e,t){mo++,xv[mo]=e.current,e.current=t}var Bi={},Rt=Wi(Bi),er=Wi(!1),Da=Bi;function Go(e,t){var r=e.type.contextTypes;if(!r)return Bi;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function tr(e){return e=e.childContextTypes,e!=null}function Cf(){Ie(er),Ie(Rt)}function R0(e,t,r){if(Rt.current!==Bi)throw Error(K(168));Ce(Rt,t),Ce(er,r)}function P_(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in t))throw Error(K(108,u$(e)||"Unknown",i));return qe({},r,n)}function Mf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Bi,Da=Rt.current,Ce(Rt,e),Ce(er,er.current),!0}function D0(e,t,r){var n=e.stateNode;if(!n)throw Error(K(169));r?(e=P_(e,t,Da),n.__reactInternalMemoizedMergedChildContext=e,Ie(er),Ie(Rt),Ce(Rt,e)):Ie(er),Ce(er,r)}var En=null,yh=!1,Gp=!1;function __(e){En===null?En=[e]:En.push(e)}function _C(e){yh=!0,__(e)}function Hi(){if(!Gp&&En!==null){Gp=!0;var e=0,t=Oe;try{var r=En;for(Oe=1;e>=o,i-=o,Cn=1<<32-Zr(t)+i|r<P?(A=O,O=null):A=O.sibling;var E=h(b,O,x[P],S);if(E===null){O===null&&(O=A);break}e&&O&&E.alternate===null&&t(b,O),g=a(E,g,P),j===null?w=E:j.sibling=E,j=E,O=A}if(P===x.length)return r(b,O),Fe&&aa(b,P),w;if(O===null){for(;PP?(A=O,O=null):A=O.sibling;var N=h(b,O,E.value,S);if(N===null){O===null&&(O=A);break}e&&O&&N.alternate===null&&t(b,O),g=a(N,g,P),j===null?w=N:j.sibling=N,j=N,O=A}if(E.done)return r(b,O),Fe&&aa(b,P),w;if(O===null){for(;!E.done;P++,E=x.next())E=d(b,E.value,S),E!==null&&(g=a(E,g,P),j===null?w=E:j.sibling=E,j=E);return Fe&&aa(b,P),w}for(O=n(b,O);!E.done;P++,E=x.next())E=p(O,b,P,E.value,S),E!==null&&(e&&E.alternate!==null&&O.delete(E.key===null?P:E.key),g=a(E,g,P),j===null?w=E:j.sibling=E,j=E);return e&&O.forEach(function(T){return t(b,T)}),Fe&&aa(b,P),w}function y(b,g,x,S){if(typeof x=="object"&&x!==null&&x.type===uo&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ac:e:{for(var w=x.key,j=g;j!==null;){if(j.key===w){if(w=x.type,w===uo){if(j.tag===7){r(b,j.sibling),g=i(j,x.props.children),g.return=b,b=g;break e}}else if(j.elementType===w||typeof w=="object"&&w!==null&&w.$$typeof===si&&F0(w)===j.type){r(b,j.sibling),g=i(j,x.props),g.ref=ll(b,j,x),g.return=b,b=g;break e}r(b,j);break}else t(b,j);j=j.sibling}x.type===uo?(g=$a(x.props.children,b.mode,S,x.key),g.return=b,b=g):(S=xf(x.type,x.key,x.props,null,b.mode,S),S.ref=ll(b,g,x),S.return=b,b=S)}return o(b);case lo:e:{for(j=x.key;g!==null;){if(g.key===j)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){r(b,g.sibling),g=i(g,x.children||[]),g.return=b,b=g;break e}else{r(b,g);break}else t(b,g);g=g.sibling}g=rm(x,b.mode,S),g.return=b,b=g}return o(b);case si:return j=x._init,y(b,g,j(x._payload),S)}if(_l(x))return v(b,g,x,S);if(nl(x))return m(b,g,x,S);Fc(b,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(r(b,g.sibling),g=i(g,x),g.return=b,b=g):(r(b,g),g=tm(x,b.mode,S),g.return=b,b=g),o(b)):r(b,g)}return y}var Yo=N_(!0),T_=N_(!1),If=Wi(null),Lf=null,go=null,fx=null;function dx(){fx=go=Lf=null}function hx(e){var t=If.current;Ie(If),e._currentValue=t}function Sv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function No(e,t){Lf=e,fx=go=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Zt=!0),e.firstContext=null)}function Rr(e){var t=e._currentValue;if(fx!==e)if(e={context:e,memoizedValue:t,next:null},go===null){if(Lf===null)throw Error(K(308));go=e,Lf.dependencies={lanes:0,firstContext:e}}else go=go.next=e;return t}var ha=null;function px(e){ha===null?ha=[e]:ha.push(e)}function $_(e,t,r,n){var i=t.interleaved;return i===null?(r.next=r,px(t)):(r.next=i.next,i.next=r),t.interleaved=r,qn(e,n)}function qn(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var li=!1;function mx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function C_(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 Ln(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ti(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ve&2){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,qn(e,r)}return i=n.interleaved,i===null?(t.next=t,px(n)):(t.next=i.next,i.next=t),n.interleaved=t,qn(e,r)}function hf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ex(e,r)}}function B0(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=o:a=a.next=o,r=r.next}while(r!==null);a===null?i=a=t:a=a.next=t}else i=a=t;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Ff(e,t,r,n){var i=e.updateQueue;li=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var l=s,u=l.next;l.next=null,o===null?a=u:o.next=u,o=l;var f=e.alternate;f!==null&&(f=f.updateQueue,s=f.lastBaseUpdate,s!==o&&(s===null?f.firstBaseUpdate=u:s.next=u,f.lastBaseUpdate=l))}if(a!==null){var d=i.baseState;o=0,f=u=l=null,s=a;do{var h=s.lane,p=s.eventTime;if((n&h)===h){f!==null&&(f=f.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,m=s;switch(h=t,p=r,m.tag){case 1:if(v=m.payload,typeof v=="function"){d=v.call(p,d,h);break e}d=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(p,d,h):v,h==null)break e;d=qe({},d,h);break e;case 2:li=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[s]:h.push(s))}else p={eventTime:p,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},f===null?(u=f=p,l=d):f=f.next=p,o|=h;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;h=s,s=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(f===null&&(l=d),i.baseState=l,i.firstBaseUpdate=u,i.lastBaseUpdate=f,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Fa|=o,e.lanes=o,e.memoizedState=d}}function z0(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Yp.transition;Yp.transition={};try{e(!1),t()}finally{Oe=r,Yp.transition=n}}function Y_(){return Dr().memoizedState}function NC(e,t,r){var n=Ci(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},X_(e))Z_(t,r);else if(r=$_(e,t,r,n),r!==null){var i=qt();Jr(r,e,n,i),J_(r,t,n)}}function TC(e,t,r){var n=Ci(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(X_(e))Z_(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,r);if(i.hasEagerState=!0,i.eagerState=s,tn(s,o)){var l=t.interleaved;l===null?(i.next=i,px(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}r=$_(e,t,i,n),r!==null&&(i=qt(),Jr(r,e,n,i),J_(r,t,n))}}function X_(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function Z_(e,t){Dl=zf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function J_(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,ex(e,r)}}var Uf={readContext:Rr,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useInsertionEffect:Et,useLayoutEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useMutableSource:Et,useSyncExternalStore:Et,useId:Et,unstable_isNewReconciler:!1},$C={readContext:Rr,useCallback:function(e,t){return ln().memoizedState=[e,t===void 0?null:t],e},useContext:Rr,useEffect:q0,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,mf(4194308,4,H_.bind(null,t,e),r)},useLayoutEffect:function(e,t){return mf(4194308,4,e,t)},useInsertionEffect:function(e,t){return mf(4,2,e,t)},useMemo:function(e,t){var r=ln();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ln();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=NC.bind(null,Ue,e),[n.memoizedState,e]},useRef:function(e){var t=ln();return e={current:e},t.memoizedState=e},useState:U0,useDebugValue:jx,useDeferredValue:function(e){return ln().memoizedState=e},useTransition:function(){var e=U0(!1),t=e[0];return e=EC.bind(null,e[1]),ln().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ue,i=ln();if(Fe){if(r===void 0)throw Error(K(407));r=r()}else{if(r=t(),wt===null)throw Error(K(349));La&30||I_(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,q0(F_.bind(null,n,a,e),[e]),n.flags|=2048,fu(9,L_.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=ln(),t=wt.identifierPrefix;if(Fe){var r=Mn,n=Cn;r=(n&~(1<<32-Zr(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=uu++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[dn]=t,e[ou]=n,lk(e,t,!1,!1),t.stateNode=e;e:{switch(o=nv(r,n),r){case"dialog":Me("cancel",e),Me("close",e),i=n;break;case"iframe":case"object":case"embed":Me("load",e),i=n;break;case"video":case"audio":for(i=0;iJo&&(t.flags|=128,n=!0,ul(a,!1),t.lanes=4194304)}else{if(!n)if(e=Bf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ul(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Fe)return Nt(t),null}else 2*Ge()-a.renderingStartTime>Jo&&r!==1073741824&&(t.flags|=128,n=!0,ul(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ge(),t.sibling=null,r=ze.current,Ce(ze,n?r&1|2:r&1),t):(Nt(t),null);case 22:case 23:return Ax(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function FC(e,t){switch(lx(t),t.tag){case 1:return tr(t.type)&&Cf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xo(),Ie(er),Ie(Rt),yx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return vx(t),null;case 13:if(Ie(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(ze),null;case 4:return Xo(),null;case 10:return dx(t.type._context),null;case 22:case 23:return Ax(),null;case 24:return null;default:return null}}var zc=!1,$t=!1,BC=typeof WeakSet=="function"?WeakSet:Set,Z=null;function xo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ke(e,t,n)}else r.current=null}function Nv(e,t,r){try{r()}catch(n){Ke(e,t,n)}}var J0=!1;function zC(e,t){if(hv=Ef,e=m_(),ox(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(s=o+i),d!==a||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++u===i&&(s=o),h===a&&++f===n&&(l=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(pv={focusedElem:e,selectionRange:r},Ef=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,y=v.memoizedState,b=t.stateNode,g=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Wr(t.type,m),y);b.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(S){Ke(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return v=J0,J0=!1,v}function Il(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Nv(t,r,a)}i=i.next}while(i!==n)}}function bh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function Tv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function fk(e){var t=e.alternate;t!==null&&(e.alternate=null,fk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dn],delete t[ou],delete t[yv],delete t[jC],delete t[OC])),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 dk(e){return e.tag===5||e.tag===3||e.tag===4}function ew(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||dk(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 $v(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=$f));else if(n!==4&&(e=e.child,e!==null))for($v(e,t,r),e=e.sibling;e!==null;)$v(e,t,r),e=e.sibling}function Cv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Cv(e,t,r),e=e.sibling;e!==null;)Cv(e,t,r),e=e.sibling}var Ot=null,Vr=!1;function ri(e,t,r){for(r=r.child;r!==null;)hk(e,t,r),r=r.sibling}function hk(e,t,r){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(dh,r)}catch{}switch(r.tag){case 5:$t||xo(r,t);case 6:var n=Ot,i=Vr;Ot=null,ri(e,t,r),Ot=n,Vr=i,Ot!==null&&(Vr?(e=Ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ot.removeChild(r.stateNode));break;case 18:Ot!==null&&(Vr?(e=Ot,r=r.stateNode,e.nodeType===8?Vp(e.parentNode,r):e.nodeType===1&&Vp(e,r),tu(e)):Vp(Ot,r.stateNode));break;case 4:n=Ot,i=Vr,Ot=r.stateNode.containerInfo,Vr=!0,ri(e,t,r),Ot=n,Vr=i;break;case 0:case 11:case 14:case 15:if(!$t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Nv(r,t,o),i=i.next}while(i!==n)}ri(e,t,r);break;case 1:if(!$t&&(xo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Ke(r,t,s)}ri(e,t,r);break;case 21:ri(e,t,r);break;case 22:r.mode&1?($t=(n=$t)||r.memoizedState!==null,ri(e,t,r),$t=n):ri(e,t,r);break;default:ri(e,t,r)}}function tw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new BC),t.forEach(function(n){var i=YC.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Br(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=Ge()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*qC(n/1960))-n,10e?16:e,Si===null)var n=!1;else{if(e=Si,Si=null,Hf=0,ve&6)throw Error(K(331));var i=ve;for(ve|=4,Z=e.current;Z!==null;){var a=Z,o=a.child;if(Z.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lGe()-_x?Ta(e,0):Px|=r),rr(e,t)}function wk(e,t){t===0&&(e.mode&1?(t=$c,$c<<=1,!($c&130023424)&&($c=4194304)):t=1);var r=qt();e=qn(e,t),e!==null&&(sc(e,t,r),rr(e,r))}function QC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),wk(e,r)}function YC(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(K(314))}n!==null&&n.delete(t),wk(e,r)}var Sk;Sk=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||er.current)Zt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Zt=!1,IC(e,t,r);Zt=!!(e.flags&131072)}else Zt=!1,Fe&&t.flags&1048576&&__(t,Df,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;vf(e,t),e=t.pendingProps;var i=Go(t,Rt.current);No(t,r),i=xx(null,t,n,e,i,r);var a=bx();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tr(n)?(a=!0,Mf(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,px(t),i.updater=xh,t.stateNode=i,i._reactInternals=t,jv(t,n,e,r),t=_v(null,t,n,!0,a,r)):(t.tag=0,Fe&&a&&sx(t),Ft(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(vf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=ZC(n),e=Wr(n,e),i){case 0:t=Pv(null,t,n,e,r);break e;case 1:t=Y0(null,t,n,e,r);break e;case 11:t=G0(null,t,n,e,r);break e;case 14:t=Q0(null,t,n,Wr(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Pv(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Y0(e,t,n,i,r);case 3:e:{if(ak(t),e===null)throw Error(K(387));n=t.pendingProps,a=t.memoizedState,i=a.element,$_(e,t),Ff(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Zo(Error(K(423)),t),t=X0(e,t,n,r,i);break e}else if(n!==i){i=Zo(Error(K(424)),t),t=X0(e,t,n,r,i);break e}else for(hr=Ni(t.stateNode.containerInfo.firstChild),pr=t,Fe=!0,Yr=null,r=N_(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Qo(),n===i){t=Wn(e,t,r);break e}Ft(e,t,n,r)}t=t.child}return t;case 5:return C_(t),e===null&&bv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,mv(n,i)?o=null:a!==null&&mv(n,a)&&(t.flags|=32),ik(e,t),Ft(e,t,o,r),t.child;case 6:return e===null&&bv(t),null;case 13:return ok(e,t,r);case 4:return mx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Yo(t,null,n,r):Ft(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),G0(e,t,n,i,r);case 7:return Ft(e,t,t.pendingProps,r),t.child;case 8:return Ft(e,t,t.pendingProps.children,r),t.child;case 12:return Ft(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Ce(If,n._currentValue),n._currentValue=o,a!==null)if(tn(a.value,o)){if(a.children===i.children&&!er.current){t=Wn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Ln(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),wv(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(K(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),wv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ft(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,No(t,r),i=Rr(i),n=n(i),t.flags|=1,Ft(e,t,n,r),t.child;case 14:return n=t.type,i=Wr(n,t.pendingProps),i=Wr(n.type,i),Q0(e,t,n,i,r);case 15:return rk(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),vf(e,t),t.tag=1,tr(n)?(e=!0,Mf(t)):e=!1,No(t,r),J_(t,n,i),jv(t,n,i,r),_v(null,t,n,!0,e,r);case 19:return sk(e,t,r);case 22:return nk(e,t,r)}throw Error(K(156,t.tag))};function jk(e,t){return YP(e,t)}function XC(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(e,t,r,n){return new XC(e,t,r,n)}function Nx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ZC(e){if(typeof e=="function")return Nx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Qg)return 11;if(e===Yg)return 14}return 2}function Mi(e,t){var r=e.alternate;return r===null?(r=Tr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function xf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")Nx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case uo:return $a(r.children,i,a,t);case Gg:o=8,i|=8;break;case Vm:return e=Tr(12,r,t,i|2),e.elementType=Vm,e.lanes=a,e;case Gm:return e=Tr(13,r,t,i),e.elementType=Gm,e.lanes=a,e;case Qm:return e=Tr(19,r,t,i),e.elementType=Qm,e.lanes=a,e;case CP:return Sh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case TP:o=10;break e;case $P:o=9;break e;case Qg:o=11;break e;case Yg:o=14;break e;case si:o=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Tr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function $a(e,t,r,n){return e=Tr(7,e,n,t),e.lanes=r,e}function Sh(e,t,r,n){return e=Tr(22,e,n,t),e.elementType=CP,e.lanes=r,e.stateNode={isHidden:!1},e}function tm(e,t,r){return e=Tr(6,e,null,t),e.lanes=r,e}function rm(e,t,r){return t=Tr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function JC(e,t,r,n,i){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=Dp(0),this.expirationTimes=Dp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dp(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Tx(e,t,r,n,i,a,o,s,l){return e=new JC(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Tr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},px(a),e}function eM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kk)}catch(e){console.error(e)}}kk(),kP.exports=br;var aM=kP.exports,uw=aM;Hm.createRoot=uw.createRoot,Hm.hydrateRoot=uw.hydrateRoot;var fc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},oM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hi,Bg,oP,sM=(oP=class{constructor(){ne(this,hi,oM);ne(this,Bg,!1)}setTimeoutProvider(e){Y(this,hi,e)}setTimeout(e,t){return $(this,hi).setTimeout(e,t)}clearTimeout(e){$(this,hi).clearTimeout(e)}setInterval(e,t){return $(this,hi).setInterval(e,t)}clearInterval(e){$(this,hi).clearInterval(e)}},hi=new WeakMap,Bg=new WeakMap,oP),ma=new sM;function lM(e){setTimeout(e,0)}var za=typeof window>"u"||"Deno"in globalThis;function Yt(){}function uM(e,t){return typeof e=="function"?e(t):e}function Lv(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ak(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ri(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function cw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==Rx(o,t.options))return!1}else if(!pu(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function fw(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(hu(t.options.mutationKey)!==hu(a))return!1}else if(!pu(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Rx(e,t){return((t==null?void 0:t.queryKeyHashFn)||hu)(e)}function hu(e){return JSON.stringify(e,(t,r)=>Bv(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function pu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pu(e[r],t[r])):!1}var cM=Object.prototype.hasOwnProperty;function Ek(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=dw(e)&&dw(t);if(!n&&!(Bv(e)&&Bv(t)))return t;const a=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),s=o.length,l=n?new Array(s):{};let u=0;for(let f=0;f{ma.setTimeout(t,e)})}function zv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Ek(e,t):t}function dM(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function hM(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Dx=Symbol();function Nk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Dx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Tk(e,t){return typeof e=="function"?e(...t):!!e}function pM(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Sa,pi,Ro,sP,mM=(sP=class extends fc{constructor(){super();ne(this,Sa);ne(this,pi);ne(this,Ro);Y(this,Ro,t=>{if(!za&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){$(this,pi)||this.setEventListener($(this,Ro))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,pi))==null||t.call(this),Y(this,pi,void 0))}setEventListener(t){var r;Y(this,Ro,t),(r=$(this,pi))==null||r.call(this),Y(this,pi,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){$(this,Sa)!==t&&(Y(this,Sa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof $(this,Sa)=="boolean"?$(this,Sa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Sa=new WeakMap,pi=new WeakMap,Ro=new WeakMap,sP),Ix=new mM;function Uv(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var vM=lM;function yM(){let e=[],t=0,r=s=>{s()},n=s=>{s()},i=vM;const a=s=>{t?e.push(s):i(()=>{r(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{i=s}}}var Pt=yM(),Do,mi,Io,lP,gM=(lP=class extends fc{constructor(){super();ne(this,Do,!0);ne(this,mi);ne(this,Io);Y(this,Io,t=>{if(!za&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){$(this,mi)||this.setEventListener($(this,Io))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,mi))==null||t.call(this),Y(this,mi,void 0))}setEventListener(t){var r;Y(this,Io,t),(r=$(this,mi))==null||r.call(this),Y(this,mi,t(this.setOnline.bind(this)))}setOnline(t){$(this,Do)!==t&&(Y(this,Do,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return $(this,Do)}},Do=new WeakMap,mi=new WeakMap,Io=new WeakMap,lP),Gf=new gM;function xM(e){return Math.min(1e3*2**e,3e4)}function $k(e){return(e??"online")==="online"?Gf.isOnline():!0}var qv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ck(e){let t=!1,r=0,n;const i=Uv(),a=()=>i.status!=="pending",o=m=>{var y;if(!a()){const b=new qv(m);h(b),(y=e.onCancel)==null||y.call(e,b)}},s=()=>{t=!0},l=()=>{t=!1},u=()=>Ix.isFocused()&&(e.networkMode==="always"||Gf.isOnline())&&e.canRun(),f=()=>$k(e.networkMode)&&e.canRun(),d=m=>{a()||(n==null||n(),i.resolve(m))},h=m=>{a()||(n==null||n(),i.reject(m))},p=()=>new Promise(m=>{var y;n=b=>{(a()||u())&&m(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;n=void 0,a()||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(a())return;let m;const y=r===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{var j;if(a())return;const g=e.retry??(za?0:3),x=e.retryDelay??xM,S=typeof x=="function"?x(r,b):x,w=g===!0||typeof g=="number"&&ru()?void 0:p()).then(()=>{t?h(b):v()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n==null||n(),i),cancelRetry:s,continueRetry:l,canStart:f,start:()=>(f()?v():p().then(v),i)}}var ja,uP,Mk=(uP=class{constructor(){ne(this,ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Lv(this.gcTime)&&Y(this,ja,ma.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(za?1/0:5*60*1e3))}clearGcTimeout(){$(this,ja)&&(ma.clearTimeout($(this,ja)),Y(this,ja,void 0))}},ja=new WeakMap,uP),Oa,Lo,_r,Pa,yt,tc,_a,Hr,_n,cP,bM=(cP=class extends Mk{constructor(t){super();ne(this,Hr);ne(this,Oa);ne(this,Lo);ne(this,_r);ne(this,Pa);ne(this,yt);ne(this,tc);ne(this,_a);Y(this,_a,!1),Y(this,tc,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,Pa,t.client),Y(this,_r,$(this,Pa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,Oa,mw(this.options)),this.state=t.state??$(this,Oa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,yt))==null?void 0:t.promise}setOptions(t){if(this.options={...$(this,tc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=mw(this.options);r.data!==void 0&&(this.setState(pw(r.data,r.dataUpdatedAt)),Y(this,Oa,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,_r).remove(this)}setData(t,r){const n=zv(this.state.data,t,this.options);return he(this,Hr,_n).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){he(this,Hr,_n).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=$(this,yt))==null?void 0:n.promise;return(i=$(this,yt))==null||i.cancel(t),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($(this,Oa))}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Dx||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ri(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ak(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=$(this,yt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=$(this,yt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,_r).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||($(this,yt)&&($(this,_a)?$(this,yt).cancel({revert:!0}):$(this,yt).cancelRetry()),this.scheduleGc()),$(this,_r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,Hr,_n).call(this,{type:"invalidate"})}async fetch(t,r){var l,u,f,d,h,p,v,m,y,b,g,x;if(this.state.fetchStatus!=="idle"&&((l=$(this,yt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if($(this,yt))return $(this,yt).continueRetry(),$(this,yt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(w=>w.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Y(this,_a,!0),n.signal)})},a=()=>{const S=Nk(this.options,r),j=(()=>{const O={client:$(this,Pa),queryKey:this.queryKey,meta:this.meta};return i(O),O})();return Y(this,_a,!1),this.options.persister?this.options.persister(S,j,this):S(j)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:$(this,Pa),state:this.state,fetchFn:a};return i(S),S})();(u=this.options.behavior)==null||u.onFetch(s,this),Y(this,Lo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&he(this,Hr,_n).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta}),Y(this,yt,Ck({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof qv&&S.revert&&this.setState({...$(this,Lo),fetchStatus:"idle"}),n.abort()},onFail:(S,w)=>{he(this,Hr,_n).call(this,{type:"failed",failureCount:S,error:w})},onPause:()=>{he(this,Hr,_n).call(this,{type:"pause"})},onContinue:()=>{he(this,Hr,_n).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await $(this,yt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(h=$(this,_r).config).onSuccess)==null||p.call(h,S,this),(m=(v=$(this,_r).config).onSettled)==null||m.call(v,S,this.state.error,this),S}catch(S){if(S instanceof qv){if(S.silent)return $(this,yt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw he(this,Hr,_n).call(this,{type:"error",error:S}),(b=(y=$(this,_r).config).onError)==null||b.call(y,S,this),(x=(g=$(this,_r).config).onSettled)==null||x.call(g,this.state.data,S,this),S}finally{this.scheduleGc()}}},Oa=new WeakMap,Lo=new WeakMap,_r=new WeakMap,Pa=new WeakMap,yt=new WeakMap,tc=new WeakMap,_a=new WeakMap,Hr=new WeakSet,_n=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Rk(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...pw(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,Lo,t.manual?i:void 0),i;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Pt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),$(this,_r).notify({query:this,type:"updated",action:t})})},cP);function Rk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:$k(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function pw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Qt,pe,rc,Dt,ka,Fo,Nn,vi,nc,Bo,zo,Aa,Ea,yi,Uo,we,El,Wv,Hv,Kv,Vv,Gv,Qv,Yv,Dk,fP,wM=(fP=class extends fc{constructor(t,r){super();ne(this,we);ne(this,Qt);ne(this,pe);ne(this,rc);ne(this,Dt);ne(this,ka);ne(this,Fo);ne(this,Nn);ne(this,vi);ne(this,nc);ne(this,Bo);ne(this,zo);ne(this,Aa);ne(this,Ea);ne(this,yi);ne(this,Uo,new Set);this.options=r,Y(this,Qt,t),Y(this,vi,null),Y(this,Nn,Uv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,pe).addObserver(this),vw($(this,pe),this.options)?he(this,we,El).call(this):this.updateResult(),he(this,we,Vv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xv($(this,pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xv($(this,pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,we,Gv).call(this),he(this,we,Qv).call(this),$(this,pe).removeObserver(this)}setOptions(t){const r=this.options,n=$(this,pe);if(this.options=$(this,Qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,$(this,pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,we,Yv).call(this),$(this,pe).setOptions(this.options),r._defaulted&&!Fv(this.options,r)&&$(this,Qt).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,pe),observer:this});const i=this.hasListeners();i&&yw($(this,pe),n,this.options,r)&&he(this,we,El).call(this),this.updateResult(),i&&($(this,pe)!==n||kr(this.options.enabled,$(this,pe))!==kr(r.enabled,$(this,pe))||Ri(this.options.staleTime,$(this,pe))!==Ri(r.staleTime,$(this,pe)))&&he(this,we,Wv).call(this);const a=he(this,we,Hv).call(this);i&&($(this,pe)!==n||kr(this.options.enabled,$(this,pe))!==kr(r.enabled,$(this,pe))||a!==$(this,yi))&&he(this,we,Kv).call(this,a)}getOptimisticResult(t){const r=$(this,Qt).getQueryCache().build($(this,Qt),t),n=this.createResult(r,t);return jM(this,n)&&(Y(this,Dt,n),Y(this,Fo,this.options),Y(this,ka,$(this,pe).state)),n}getCurrentResult(){return $(this,Dt)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&$(this,Nn).status==="pending"&&$(this,Nn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){$(this,Uo).add(t)}getCurrentQuery(){return $(this,pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=$(this,Qt).defaultQueryOptions(t),n=$(this,Qt).getQueryCache().build($(this,Qt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return he(this,we,El).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,Dt)))}createResult(t,r){var A;const n=$(this,pe),i=this.options,a=$(this,Dt),o=$(this,ka),s=$(this,Fo),u=t!==n?t.state:$(this,rc),{state:f}=t;let d={...f},h=!1,p;if(r._optimisticResults){const E=this.hasListeners(),N=!E&&vw(t,r),T=E&&yw(t,n,r,i);(N||T)&&(d={...d,...Rk(f.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:m,status:y}=d;p=d.data;let b=!1;if(r.placeholderData!==void 0&&p===void 0&&y==="pending"){let E;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(E=a.data,b=!0):E=typeof r.placeholderData=="function"?r.placeholderData((A=$(this,zo))==null?void 0:A.state.data,$(this,zo)):r.placeholderData,E!==void 0&&(y="success",p=zv(a==null?void 0:a.data,E,r),h=!0)}if(r.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&r.select===$(this,nc))p=$(this,Bo);else try{Y(this,nc,r.select),p=r.select(p),p=zv(a==null?void 0:a.data,p,r),Y(this,Bo,p),Y(this,vi,null)}catch(E){Y(this,vi,E)}$(this,vi)&&(v=$(this,vi),p=$(this,Bo),m=Date.now(),y="error");const g=d.fetchStatus==="fetching",x=y==="pending",S=y==="error",w=x&&g,j=p!==void 0,P={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:S,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!x,isLoadingError:S&&!j,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&j,isStale:Lx(t,r),refetch:this.refetch,promise:$(this,Nn),isEnabled:kr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=P.data!==void 0,N=P.status==="error"&&!E,T=D=>{N?D.reject(P.error):E&&D.resolve(P.data)},M=()=>{const D=Y(this,Nn,P.promise=Uv());T(D)},R=$(this,Nn);switch(R.status){case"pending":t.queryHash===n.queryHash&&T(R);break;case"fulfilled":(N||P.data!==R.value)&&M();break;case"rejected":(!N||P.error!==R.reason)&&M();break}}return P}updateResult(){const t=$(this,Dt),r=this.createResult($(this,pe),this.options);if(Y(this,ka,$(this,pe).state),Y(this,Fo,this.options),$(this,ka).data!==void 0&&Y(this,zo,$(this,pe)),Fv(r,t))return;Y(this,Dt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!$(this,Uo).size)return!0;const o=new Set(a??$(this,Uo));return this.options.throwOnError&&o.add("error"),Object.keys($(this,Dt)).some(s=>{const l=s;return $(this,Dt)[l]!==t[l]&&o.has(l)})};he(this,we,Dk).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,we,Vv).call(this)}},Qt=new WeakMap,pe=new WeakMap,rc=new WeakMap,Dt=new WeakMap,ka=new WeakMap,Fo=new WeakMap,Nn=new WeakMap,vi=new WeakMap,nc=new WeakMap,Bo=new WeakMap,zo=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,yi=new WeakMap,Uo=new WeakMap,we=new WeakSet,El=function(t){he(this,we,Yv).call(this);let r=$(this,pe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Yt)),r},Wv=function(){he(this,we,Gv).call(this);const t=Ri(this.options.staleTime,$(this,pe));if(za||$(this,Dt).isStale||!Lv(t))return;const n=Ak($(this,Dt).dataUpdatedAt,t)+1;Y(this,Aa,ma.setTimeout(()=>{$(this,Dt).isStale||this.updateResult()},n))},Hv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,pe)):this.options.refetchInterval)??!1},Kv=function(t){he(this,we,Qv).call(this),Y(this,yi,t),!(za||kr(this.options.enabled,$(this,pe))===!1||!Lv($(this,yi))||$(this,yi)===0)&&Y(this,Ea,ma.setInterval(()=>{(this.options.refetchIntervalInBackground||Ix.isFocused())&&he(this,we,El).call(this)},$(this,yi)))},Vv=function(){he(this,we,Wv).call(this),he(this,we,Kv).call(this,he(this,we,Hv).call(this))},Gv=function(){$(this,Aa)&&(ma.clearTimeout($(this,Aa)),Y(this,Aa,void 0))},Qv=function(){$(this,Ea)&&(ma.clearInterval($(this,Ea)),Y(this,Ea,void 0))},Yv=function(){const t=$(this,Qt).getQueryCache().build($(this,Qt),this.options);if(t===$(this,pe))return;const r=$(this,pe);Y(this,pe,t),Y(this,rc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Dk=function(t){Pt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r($(this,Dt))}),$(this,Qt).getQueryCache().notify({query:$(this,pe),type:"observerResultsUpdated"})})},fP);function SM(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function vw(e,t){return SM(e,t)||e.state.data!==void 0&&Xv(e,t,t.refetchOnMount)}function Xv(e,t,r){if(kr(t.enabled,e)!==!1&&Ri(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Lx(e,t)}return!1}function yw(e,t,r,n){return(e!==t||kr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Lx(e,r)}function Lx(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(Ri(t.staleTime,e))}function jM(e,t){return!Fv(e.getCurrentResult(),t)}function gw(e){return{onFetch:(t,r)=>{var f,d,h,p,v;const n=t.options,i=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const y=x=>{pM(x,()=>t.signal,()=>m=!0)},b=Nk(t.options,t.fetchOptions),g=async(x,S,w)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const O=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};return y(N),N})(),P=await b(O),{maxPages:A}=t.options,E=w?hM:dM;return{pages:E(x.pages,P,A),pageParams:E(x.pageParams,S,A)}};if(i&&a.length){const x=i==="backward",S=x?OM:xw,w={pages:a,pageParams:o},j=S(n,w);s=await g(w,j,x)}else{const x=e??a.length;do{const S=l===0?o[0]??n.initialPageParam:xw(n,s);if(l>0&&S==null)break;s=await g(s,S),l++}while(l{var m,y;return(y=(m=t.options).persister)==null?void 0:y.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function xw(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function OM(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ic,un,It,Na,cn,ai,dP,PM=(dP=class extends Mk{constructor(t){super();ne(this,cn);ne(this,ic);ne(this,un);ne(this,It);ne(this,Na);Y(this,ic,t.client),this.mutationId=t.mutationId,Y(this,It,t.mutationCache),Y(this,un,[]),this.state=t.state||_M(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,un).includes(t)||($(this,un).push(t),this.clearGcTimeout(),$(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,un,$(this,un).filter(r=>r!==t)),this.scheduleGc(),$(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,un).length||(this.state.status==="pending"?this.scheduleGc():$(this,It).remove(this))}continue(){var t;return((t=$(this,Na))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,l,u,f,d,h,p,v,m,y,b,g,x,S,w,j,O,P,A;const r=()=>{he(this,cn,ai).call(this,{type:"continue"})},n={client:$(this,ic),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,Na,Ck({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(E,N)=>{he(this,cn,ai).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{he(this,cn,ai).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,It).canRun(this)}));const i=this.state.status==="pending",a=!$(this,Na).canStart();try{if(i)r();else{he(this,cn,ai).call(this,{type:"pending",variables:t,isPaused:a}),await((s=(o=$(this,It).config).onMutate)==null?void 0:s.call(o,t,this,n));const N=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,n));N!==this.state.context&&he(this,cn,ai).call(this,{type:"pending",context:N,variables:t,isPaused:a})}const E=await $(this,Na).start();return await((d=(f=$(this,It).config).onSuccess)==null?void 0:d.call(f,E,t,this.state.context,this,n)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,E,t,this.state.context,n)),await((m=(v=$(this,It).config).onSettled)==null?void 0:m.call(v,E,null,this.state.variables,this.state.context,this,n)),await((b=(y=this.options).onSettled)==null?void 0:b.call(y,E,null,t,this.state.context,n)),he(this,cn,ai).call(this,{type:"success",data:E}),E}catch(E){try{await((x=(g=$(this,It).config).onError)==null?void 0:x.call(g,E,t,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((w=(S=this.options).onError)==null?void 0:w.call(S,E,t,this.state.context,n))}catch(N){Promise.reject(N)}try{await((O=(j=$(this,It).config).onSettled)==null?void 0:O.call(j,void 0,E,this.state.variables,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,E,t,this.state.context,n))}catch(N){Promise.reject(N)}throw he(this,cn,ai).call(this,{type:"error",error:E}),E}finally{$(this,It).runNext(this)}}},ic=new WeakMap,un=new WeakMap,It=new WeakMap,Na=new WeakMap,cn=new WeakSet,ai=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Pt.batch(()=>{$(this,un).forEach(n=>{n.onMutationUpdate(t)}),$(this,It).notify({mutation:this,type:"updated",action:t})})},dP);function _M(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tn,Kr,ac,hP,kM=(hP=class extends fc{constructor(t={}){super();ne(this,Tn);ne(this,Kr);ne(this,ac);this.config=t,Y(this,Tn,new Set),Y(this,Kr,new Map),Y(this,ac,0)}build(t,r,n){const i=new PM({client:t,mutationCache:this,mutationId:++Pc(this,ac)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){$(this,Tn).add(t);const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r);n?n.push(t):$(this,Kr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,Tn).delete(t)){const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&$(this,Kr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Wc(t);if(typeof r=="string"){const i=(n=$(this,Kr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Pt.batch(()=>{$(this,Tn).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,Tn).clear(),$(this,Kr).clear()})}getAll(){return Array.from($(this,Tn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>fw(r,n))}findAll(t={}){return this.getAll().filter(r=>fw(t,r))}notify(t){Pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Pt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Yt))))}},Tn=new WeakMap,Kr=new WeakMap,ac=new WeakMap,hP);function Wc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var fn,pP,AM=(pP=class extends fc{constructor(t={}){super();ne(this,fn);this.config=t,Y(this,fn,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??Rx(i,r);let o=this.get(a);return o||(o=new bM({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){$(this,fn).has(t.queryHash)||($(this,fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=$(this,fn).get(t.queryHash);r&&(t.destroy(),r===t&&$(this,fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,fn).get(t)}getAll(){return[...$(this,fn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>cw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>cw(t,n)):r}notify(t){Pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Pt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fn=new WeakMap,pP),He,gi,xi,qo,Wo,bi,Ho,Ko,mP,EM=(mP=class{constructor(e={}){ne(this,He);ne(this,gi);ne(this,xi);ne(this,qo);ne(this,Wo);ne(this,bi);ne(this,Ho);ne(this,Ko);Y(this,He,e.queryCache||new AM),Y(this,gi,e.mutationCache||new kM),Y(this,xi,e.defaultOptions||{}),Y(this,qo,new Map),Y(this,Wo,new Map),Y(this,bi,0)}mount(){Pc(this,bi)._++,$(this,bi)===1&&(Y(this,Ho,Ix.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,He).onFocus())})),Y(this,Ko,Gf.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,He).onOnline())})))}unmount(){var e,t;Pc(this,bi)._--,$(this,bi)===0&&((e=$(this,Ho))==null||e.call(this),Y(this,Ho,void 0),(t=$(this,Ko))==null||t.call(this),Y(this,Ko,void 0))}isFetching(e){return $(this,He).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,gi).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=$(this,He).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=$(this,He).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ri(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return $(this,He).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=$(this,He).get(n.queryHash),a=i==null?void 0:i.state.data,o=uM(t,a);if(o!==void 0)return $(this,He).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Pt.batch(()=>$(this,He).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=$(this,He).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=$(this,He);Pt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=$(this,He);return Pt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Pt.batch(()=>$(this,He).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Yt).catch(Yt)}invalidateQueries(e,t={}){return Pt.batch(()=>($(this,He).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Pt.batch(()=>$(this,He).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Yt)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=$(this,He).build(this,t);return r.isStaleByTime(Ri(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yt).catch(Yt)}fetchInfiniteQuery(e){return e.behavior=gw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yt).catch(Yt)}ensureInfiniteQueryData(e){return e.behavior=gw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Gf.isOnline()?$(this,gi).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,He)}getMutationCache(){return $(this,gi)}getDefaultOptions(){return $(this,xi)}setDefaultOptions(e){Y(this,xi,e)}setQueryDefaults(e,t){$(this,qo).set(hu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,qo).values()],r={};return t.forEach(n=>{pu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){$(this,Wo).set(hu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,Wo).values()],r={};return t.forEach(n=>{pu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,xi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Rx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Dx&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,xi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,He).clear(),$(this,gi).clear()}},He=new WeakMap,gi=new WeakMap,xi=new WeakMap,qo=new WeakMap,Wo=new WeakMap,bi=new WeakMap,Ho=new WeakMap,Ko=new WeakMap,mP),Ik=k.createContext(void 0),NM=e=>{const t=k.useContext(Ik);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},TM=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Ik.Provider,{value:e,children:t})),Lk=k.createContext(!1),$M=()=>k.useContext(Lk);Lk.Provider;function CM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var MM=k.createContext(CM()),RM=()=>k.useContext(MM),DM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?Tk(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},IM=e=>{k.useEffect(()=>{e.clearReset()},[e])},LM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||Tk(r,[e.error,n])),FM=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},BM=(e,t)=>e.isLoading&&e.isFetching&&!t,zM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,bw=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function UM(e,t,r){var h,p,v,m;const n=$M(),i=RM(),a=NM(),o=a.defaultQueryOptions(e);(p=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,o);const s=a.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",FM(o),DM(o,i,s),IM(i);const l=!a.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(y=>{const b=d?u.subscribe(Pt.batchCalls(y)):Yt;return u.updateResult(),b},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),zM(o,f))throw bw(o,u,i);if(LM({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;if((m=(v=a.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||m.call(v,o,f),o.experimental_prefetchInRender&&!za&&BM(f,n)){const y=l?bw(o,u,i):s==null?void 0:s.promise;y==null||y.catch(Yt).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?f:u.trackResult(f)}function Qe(e,t){return UM(e,wM)}/** +`+a.stack}return{value:e,source:t,stack:i,digest:null}}function Jp(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Pv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var RC=typeof WeakMap=="function"?WeakMap:Map;function tk(e,t,r){r=Ln(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Wf||(Wf=!0,Rv=n),Pv(e,t)},r}function rk(e,t,r){r=Ln(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){Pv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Pv(e,t),typeof n!="function"&&($i===null?$i=new Set([this]):$i.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function K0(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new RC;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=QC.bind(null,e,t,r),t.then(e,e))}function V0(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function G0(e,t,r,n,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=Ln(-1,1),t.tag=2,Ti(r,t,1))),r.lanes|=1),e)}var DC=Xn.ReactCurrentOwner,Zt=!1;function Ft(e,t,r,n){t.child=e===null?T_(t,null,r,n):Yo(t,e.child,r,n)}function Q0(e,t,r,n,i){r=r.render;var a=t.ref;return No(t,i),n=bx(e,t,r,n,a,i),r=wx(),e!==null&&!Zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wn(e,t,i)):(Fe&&r&&lx(t),t.flags|=1,Ft(e,t,n,i),t.child)}function Y0(e,t,r,n,i){if(e===null){var a=r.type;return typeof a=="function"&&!Tx(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,nk(e,t,a,n,i)):(e=xf(r.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&i)){var o=a.memoizedProps;if(r=r.compare,r=r!==null?r:nu,r(o,n)&&e.ref===t.ref)return Wn(e,t,i)}return t.flags|=1,e=Mi(a,n),e.ref=t.ref,e.return=t,t.child=e}function nk(e,t,r,n,i){if(e!==null){var a=e.memoizedProps;if(nu(a,n)&&e.ref===t.ref)if(Zt=!1,t.pendingProps=n=a,(e.lanes&i)!==0)e.flags&131072&&(Zt=!0);else return t.lanes=e.lanes,Wn(e,t,i)}return _v(e,t,r,n,i)}function ik(e,t,r){var n=t.pendingProps,i=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ce(bo,cr),cr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ce(bo,cr),cr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ce(bo,cr),cr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ce(bo,cr),cr|=n;return Ft(e,t,i,r),t.child}function ak(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function _v(e,t,r,n,i){var a=tr(r)?Da:Rt.current;return a=Go(t,a),No(t,i),r=bx(e,t,r,n,a,i),n=wx(),e!==null&&!Zt?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Wn(e,t,i)):(Fe&&n&&lx(t),t.flags|=1,Ft(e,t,r,i),t.child)}function X0(e,t,r,n,i){if(tr(r)){var a=!0;Mf(t)}else a=!1;if(No(t,i),t.stateNode===null)vf(e,t),ek(t,r,n),Ov(t,r,n,i),n=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Rr(u):(u=tr(r)?Da:Rt.current,u=Go(t,u));var f=r.getDerivedStateFromProps,d=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==n||l!==u)&&H0(t,o,n,u),li=!1;var h=t.memoizedState;o.state=h,Ff(t,n,o,i),l=t.memoizedState,s!==n||h!==l||er.current||li?(typeof f=="function"&&(jv(t,r,f,n),l=t.memoizedState),(s=li||W0(t,r,s,n,h,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=u,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,C_(e,t),s=t.memoizedProps,u=t.type===t.elementType?s:Wr(t.type,s),o.props=u,d=t.pendingProps,h=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Rr(l):(l=tr(r)?Da:Rt.current,l=Go(t,l));var p=r.getDerivedStateFromProps;(f=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==d||h!==l)&&H0(t,o,n,l),li=!1,h=t.memoizedState,o.state=h,Ff(t,n,o,i);var v=t.memoizedState;s!==d||h!==v||er.current||li?(typeof p=="function"&&(jv(t,r,p,n),v=t.memoizedState),(u=li||W0(t,r,u,n,h,v,l)||!1)?(f||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),o.props=n,o.state=v,o.context=l,n=u):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return kv(e,t,r,n,a,i)}function kv(e,t,r,n,i,a){ak(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return i&&D0(t,r,!1),Wn(e,t,a);n=t.stateNode,DC.current=t;var s=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Yo(t,e.child,null,a),t.child=Yo(t,null,s,a)):Ft(e,t,s,a),t.memoizedState=n.state,i&&D0(t,r,!0),t.child}function ok(e){var t=e.stateNode;t.pendingContext?R0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&R0(e,t.context,!1),vx(e,t.containerInfo)}function Z0(e,t,r,n,i){return Qo(),cx(i),t.flags|=256,Ft(e,t,r,n),t.child}var Av={dehydrated:null,treeContext:null,retryLane:0};function Ev(e){return{baseLanes:e,cachePool:null,transitions:null}}function sk(e,t,r){var n=t.pendingProps,i=ze.current,a=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!==0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),Ce(ze,i&1),e===null)return wv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=n.children,e=n.fallback,a?(n=t.mode,a=t.child,o={mode:"hidden",children:o},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=Sh(o,n,0,null),e=$a(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Ev(r),t.memoizedState=Av,e):Ox(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return IC(e,t,o,n,s,i,r);if(a){a=n.fallback,o=t.mode,i=e.child,s=i.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&t.child!==i?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=Mi(i,l),n.subtreeFlags=i.subtreeFlags&14680064),s!==null?a=Mi(s,a):(a=$a(a,o,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,o=e.child.memoizedState,o=o===null?Ev(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~r,t.memoizedState=Av,n}return a=e.child,e=a.sibling,n=Mi(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Ox(e,t){return t=Sh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Bc(e,t,r,n){return n!==null&&cx(n),Yo(t,e.child,null,r),e=Ox(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function IC(e,t,r,n,i,a,o){if(r)return t.flags&256?(t.flags&=-257,n=Jp(Error(K(422))),Bc(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Sh({mode:"visible",children:n.children},i,0,null),a=$a(a,i,o,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&Yo(t,e.child,null,o),t.child.memoizedState=Ev(o),t.memoizedState=Av,a);if(!(t.mode&1))return Bc(e,t,o,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var s=n.dgst;return n=s,a=Error(K(419)),n=Jp(a,n,void 0),Bc(e,t,o,n)}if(s=(o&e.childLanes)!==0,Zt||s){if(n=wt,n!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|o)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,qn(e,i),Jr(n,e,i,-1))}return Nx(),n=Jp(Error(K(421))),Bc(e,t,o,n)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=YC.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,hr=Ni(i.nextSibling),pr=t,Fe=!0,Yr=null,e!==null&&(Ar[Er++]=Cn,Ar[Er++]=Mn,Ar[Er++]=Ia,Cn=e.id,Mn=e.overflow,Ia=t),t=Ox(t,n.children),t.flags|=4096,t)}function J0(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Sv(e.return,t,r)}function em(e,t,r,n,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function lk(e,t,r){var n=t.pendingProps,i=n.revealOrder,a=n.tail;if(Ft(e,t,n.children,r),n=ze.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&J0(e,r,t);else if(e.tag===19)J0(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ce(ze,n),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;r!==null;)e=r.alternate,e!==null&&Bf(e)===null&&(i=r),r=r.sibling;r=i,r===null?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),em(t,!1,i,r,a);break;case"backwards":for(r=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bf(e)===null){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}em(t,!0,r,null,a);break;case"together":em(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function vf(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wn(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Fa|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(K(153));if(t.child!==null){for(e=t.child,r=Mi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=Mi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function LC(e,t,r){switch(t.tag){case 3:ok(t),Qo();break;case 5:M_(t);break;case 1:tr(t.type)&&Mf(t);break;case 4:vx(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ce(If,n._currentValue),n._currentValue=i;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ce(ze,ze.current&1),t.flags|=128,null):r&t.child.childLanes?sk(e,t,r):(Ce(ze,ze.current&1),e=Wn(e,t,r),e!==null?e.sibling:null);Ce(ze,ze.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return lk(e,t,r);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ce(ze,ze.current),n)break;return null;case 22:case 23:return t.lanes=0,ik(e,t,r)}return Wn(e,t,r)}var uk,Nv,ck,fk;uk=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Nv=function(){};ck=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,pa(vn.current);var a=null;switch(r){case"input":i=Zm(e,i),n=Zm(e,n),a=[];break;case"select":i=qe({},i,{value:void 0}),n=qe({},n,{value:void 0}),a=[];break;case"textarea":i=tv(e,i),n=tv(e,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=$f)}nv(r,n);var o;r=null;for(u in i)if(!n.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u==="style"){var s=i[u];for(o in s)s.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yl.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var l=n[u];if(s=i!=null?i[u]:void 0,n.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(a||(a=[]),a.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(a=a||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Yl.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Me("scroll",e),a||s===l||(a=[])):(a=a||[]).push(u,l))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};fk=function(e,t,r,n){r!==n&&(t.flags|=4)};function ul(e,t){if(!Fe)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function FC(e,t,r){var n=t.pendingProps;switch(ux(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Nt(t),null;case 1:return tr(t.type)&&Cf(),Nt(t),null;case 3:return n=t.stateNode,Xo(),Ie(er),Ie(Rt),gx(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Lc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yr!==null&&(Lv(Yr),Yr=null))),Nv(e,t),Nt(t),null;case 5:yx(t);var i=pa(lu.current);if(r=t.type,e!==null&&t.stateNode!=null)ck(e,t,r,n,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(K(166));return Nt(t),null}if(e=pa(vn.current),Lc(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[dn]=t,n[ou]=a,e=(t.mode&1)!==0,r){case"dialog":Me("cancel",n),Me("close",n);break;case"iframe":case"object":case"embed":Me("load",n);break;case"video":case"audio":for(i=0;i<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[dn]=t,e[ou]=n,uk(e,t,!1,!1),t.stateNode=e;e:{switch(o=iv(r,n),r){case"dialog":Me("cancel",e),Me("close",e),i=n;break;case"iframe":case"object":case"embed":Me("load",e),i=n;break;case"video":case"audio":for(i=0;iJo&&(t.flags|=128,n=!0,ul(a,!1),t.lanes=4194304)}else{if(!n)if(e=Bf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),ul(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Fe)return Nt(t),null}else 2*Ge()-a.renderingStartTime>Jo&&r!==1073741824&&(t.flags|=128,n=!0,ul(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(r=a.last,r!==null?r.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ge(),t.sibling=null,r=ze.current,Ce(ze,n?r&1|2:r&1),t):(Nt(t),null);case 22:case 23:return Ex(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?cr&1073741824&&(Nt(t),t.subtreeFlags&6&&(t.flags|=8192)):Nt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function BC(e,t){switch(ux(t),t.tag){case 1:return tr(t.type)&&Cf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xo(),Ie(er),Ie(Rt),gx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return yx(t),null;case 13:if(Ie(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Qo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ie(ze),null;case 4:return Xo(),null;case 10:return hx(t.type._context),null;case 22:case 23:return Ex(),null;case 24:return null;default:return null}}var zc=!1,$t=!1,zC=typeof WeakSet=="function"?WeakSet:Set,Z=null;function xo(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Ke(e,t,n)}else r.current=null}function Tv(e,t,r){try{r()}catch(n){Ke(e,t,n)}}var ew=!1;function UC(e,t){if(pv=Ef,e=v_(),sx(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,u=0,f=0,d=e,h=null;t:for(;;){for(var p;d!==r||i!==0&&d.nodeType!==3||(s=o+i),d!==a||n!==0&&d.nodeType!==3||(l=o+n),d.nodeType===3&&(o+=d.nodeValue.length),(p=d.firstChild)!==null;)h=d,d=p;for(;;){if(d===e)break t;if(h===r&&++u===i&&(s=o),h===a&&++f===n&&(l=o),(p=d.nextSibling)!==null)break;d=h,h=d.parentNode}d=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(mv={focusedElem:e,selectionRange:r},Ef=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,y=v.memoizedState,b=t.stateNode,g=b.getSnapshotBeforeUpdate(t.elementType===t.type?m:Wr(t.type,m),y);b.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(S){Ke(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return v=ew,ew=!1,v}function Il(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Tv(t,r,a)}i=i.next}while(i!==n)}}function bh(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function $v(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function dk(e){var t=e.alternate;t!==null&&(e.alternate=null,dk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[dn],delete t[ou],delete t[gv],delete t[OC],delete t[PC])),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 hk(e){return e.tag===5||e.tag===3||e.tag===4}function tw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hk(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 Cv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=$f));else if(n!==4&&(e=e.child,e!==null))for(Cv(e,t,r),e=e.sibling;e!==null;)Cv(e,t,r),e=e.sibling}function Mv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Mv(e,t,r),e=e.sibling;e!==null;)Mv(e,t,r),e=e.sibling}var Ot=null,Vr=!1;function ri(e,t,r){for(r=r.child;r!==null;)pk(e,t,r),r=r.sibling}function pk(e,t,r){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(dh,r)}catch{}switch(r.tag){case 5:$t||xo(r,t);case 6:var n=Ot,i=Vr;Ot=null,ri(e,t,r),Ot=n,Vr=i,Ot!==null&&(Vr?(e=Ot,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ot.removeChild(r.stateNode));break;case 18:Ot!==null&&(Vr?(e=Ot,r=r.stateNode,e.nodeType===8?Vp(e.parentNode,r):e.nodeType===1&&Vp(e,r),tu(e)):Vp(Ot,r.stateNode));break;case 4:n=Ot,i=Vr,Ot=r.stateNode.containerInfo,Vr=!0,ri(e,t,r),Ot=n,Vr=i;break;case 0:case 11:case 14:case 15:if(!$t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Tv(r,t,o),i=i.next}while(i!==n)}ri(e,t,r);break;case 1:if(!$t&&(xo(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Ke(r,t,s)}ri(e,t,r);break;case 21:ri(e,t,r);break;case 22:r.mode&1?($t=(n=$t)||r.memoizedState!==null,ri(e,t,r),$t=n):ri(e,t,r);break;default:ri(e,t,r)}}function rw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new zC),t.forEach(function(n){var i=XC.bind(null,e,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Br(e,t){var r=t.deletions;if(r!==null)for(var n=0;ni&&(i=o),n&=~a}if(n=i,n=Ge()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*WC(n/1960))-n,10e?16:e,Si===null)var n=!1;else{if(e=Si,Si=null,Hf=0,ve&6)throw Error(K(331));var i=ve;for(ve|=4,Z=e.current;Z!==null;){var a=Z,o=a.child;if(Z.flags&16){var s=a.deletions;if(s!==null){for(var l=0;lGe()-kx?Ta(e,0):_x|=r),rr(e,t)}function Sk(e,t){t===0&&(e.mode&1?(t=$c,$c<<=1,!($c&130023424)&&($c=4194304)):t=1);var r=qt();e=qn(e,t),e!==null&&(sc(e,t,r),rr(e,r))}function YC(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Sk(e,r)}function XC(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(K(314))}n!==null&&n.delete(t),Sk(e,r)}var jk;jk=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||er.current)Zt=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Zt=!1,LC(e,t,r);Zt=!!(e.flags&131072)}else Zt=!1,Fe&&t.flags&1048576&&k_(t,Df,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;vf(e,t),e=t.pendingProps;var i=Go(t,Rt.current);No(t,r),i=bx(null,t,n,e,i,r);var a=wx();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,tr(n)?(a=!0,Mf(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,mx(t),i.updater=xh,t.stateNode=i,i._reactInternals=t,Ov(t,n,e,r),t=kv(null,t,n,!0,a,r)):(t.tag=0,Fe&&a&&lx(t),Ft(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(vf(e,t),e=t.pendingProps,i=n._init,n=i(n._payload),t.type=n,i=t.tag=JC(n),e=Wr(n,e),i){case 0:t=_v(null,t,n,e,r);break e;case 1:t=X0(null,t,n,e,r);break e;case 11:t=Q0(null,t,n,e,r);break e;case 14:t=Y0(null,t,n,Wr(n.type,e),r);break e}throw Error(K(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),_v(e,t,n,i,r);case 1:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),X0(e,t,n,i,r);case 3:e:{if(ok(t),e===null)throw Error(K(387));n=t.pendingProps,a=t.memoizedState,i=a.element,C_(e,t),Ff(t,n,null,r);var o=t.memoizedState;if(n=o.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=Zo(Error(K(423)),t),t=Z0(e,t,n,r,i);break e}else if(n!==i){i=Zo(Error(K(424)),t),t=Z0(e,t,n,r,i);break e}else for(hr=Ni(t.stateNode.containerInfo.firstChild),pr=t,Fe=!0,Yr=null,r=T_(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Qo(),n===i){t=Wn(e,t,r);break e}Ft(e,t,n,r)}t=t.child}return t;case 5:return M_(t),e===null&&wv(t),n=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,vv(n,i)?o=null:a!==null&&vv(n,a)&&(t.flags|=32),ak(e,t),Ft(e,t,o,r),t.child;case 6:return e===null&&wv(t),null;case 13:return sk(e,t,r);case 4:return vx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Yo(t,null,n,r):Ft(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),Q0(e,t,n,i,r);case 7:return Ft(e,t,t.pendingProps,r),t.child;case 8:return Ft(e,t,t.pendingProps.children,r),t.child;case 12:return Ft(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Ce(If,n._currentValue),n._currentValue=o,a!==null)if(tn(a.value,o)){if(a.children===i.children&&!er.current){t=Wn(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var s=a.dependencies;if(s!==null){o=a.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Ln(-1,r&-r),l.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),Sv(a.return,r,t),s.lanes|=r;break}l=l.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(K(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),Sv(o,r,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ft(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,No(t,r),i=Rr(i),n=n(i),t.flags|=1,Ft(e,t,n,r),t.child;case 14:return n=t.type,i=Wr(n,t.pendingProps),i=Wr(n.type,i),Y0(e,t,n,i,r);case 15:return nk(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:Wr(n,i),vf(e,t),t.tag=1,tr(n)?(e=!0,Mf(t)):e=!1,No(t,r),ek(t,n,i),Ov(t,n,i,r),kv(null,t,n,!0,e,r);case 19:return lk(e,t,r);case 22:return ik(e,t,r)}throw Error(K(156,t.tag))};function Ok(e,t){return XP(e,t)}function ZC(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tr(e,t,r,n){return new ZC(e,t,r,n)}function Tx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function JC(e){if(typeof e=="function")return Tx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Yg)return 11;if(e===Xg)return 14}return 2}function Mi(e,t){var r=e.alternate;return r===null?(r=Tr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function xf(e,t,r,n,i,a){var o=2;if(n=e,typeof e=="function")Tx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case uo:return $a(r.children,i,a,t);case Qg:o=8,i|=8;break;case Gm:return e=Tr(12,r,t,i|2),e.elementType=Gm,e.lanes=a,e;case Qm:return e=Tr(13,r,t,i),e.elementType=Qm,e.lanes=a,e;case Ym:return e=Tr(19,r,t,i),e.elementType=Ym,e.lanes=a,e;case MP:return Sh(r,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case $P:o=10;break e;case CP:o=9;break e;case Yg:o=11;break e;case Xg:o=14;break e;case si:o=16,n=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=Tr(o,r,t,i),t.elementType=e,t.type=n,t.lanes=a,t}function $a(e,t,r,n){return e=Tr(7,e,n,t),e.lanes=r,e}function Sh(e,t,r,n){return e=Tr(22,e,n,t),e.elementType=MP,e.lanes=r,e.stateNode={isHidden:!1},e}function tm(e,t,r){return e=Tr(6,e,null,t),e.lanes=r,e}function rm(e,t,r){return t=Tr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function eM(e,t,r,n,i){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=Dp(0),this.expirationTimes=Dp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Dp(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function $x(e,t,r,n,i,a,o,s,l){return e=new eM(e,t,r,s,l),t===1?(t=1,a===!0&&(t|=8)):t=0,a=Tr(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},mx(a),e}function tM(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Ak)}catch(e){console.error(e)}}Ak(),AP.exports=br;var oM=AP.exports,cw=oM;Km.createRoot=cw.createRoot,Km.hydrateRoot=cw.hydrateRoot;var fc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},hi,zg,sP,lM=(sP=class{constructor(){ne(this,hi,sM);ne(this,zg,!1)}setTimeoutProvider(e){Y(this,hi,e)}setTimeout(e,t){return $(this,hi).setTimeout(e,t)}clearTimeout(e){$(this,hi).clearTimeout(e)}setInterval(e,t){return $(this,hi).setInterval(e,t)}clearInterval(e){$(this,hi).clearInterval(e)}},hi=new WeakMap,zg=new WeakMap,sP),ma=new lM;function uM(e){setTimeout(e,0)}var za=typeof window>"u"||"Deno"in globalThis;function Yt(){}function cM(e,t){return typeof e=="function"?e(t):e}function Fv(e){return typeof e=="number"&&e>=0&&e!==1/0}function Ek(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ri(e,t){return typeof e=="function"?e(t):e}function kr(e,t){return typeof e=="function"?e(t):e}function fw(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==Dx(o,t.options))return!1}else if(!pu(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function dw(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(hu(t.options.mutationKey)!==hu(a))return!1}else if(!pu(t.options.mutationKey,a))return!1}return!(n&&t.state.status!==n||i&&!i(t))}function Dx(e,t){return((t==null?void 0:t.queryKeyHashFn)||hu)(e)}function hu(e){return JSON.stringify(e,(t,r)=>zv(r)?Object.keys(r).sort().reduce((n,i)=>(n[i]=r[i],n),{}):r)}function pu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pu(e[r],t[r])):!1}var fM=Object.prototype.hasOwnProperty;function Nk(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=hw(e)&&hw(t);if(!n&&!(zv(e)&&zv(t)))return t;const a=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),s=o.length,l=n?new Array(s):{};let u=0;for(let f=0;f{ma.setTimeout(t,e)})}function Uv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?Nk(e,t):t}function hM(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function pM(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Ix=Symbol();function Tk(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Ix?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function $k(e,t){return typeof e=="function"?e(...t):!!e}function mM(e,t,r){let n=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??(i=t()),n||(n=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}var Sa,pi,Ro,lP,vM=(lP=class extends fc{constructor(){super();ne(this,Sa);ne(this,pi);ne(this,Ro);Y(this,Ro,t=>{if(!za&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){$(this,pi)||this.setEventListener($(this,Ro))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,pi))==null||t.call(this),Y(this,pi,void 0))}setEventListener(t){var r;Y(this,Ro,t),(r=$(this,pi))==null||r.call(this),Y(this,pi,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){$(this,Sa)!==t&&(Y(this,Sa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof $(this,Sa)=="boolean"?$(this,Sa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Sa=new WeakMap,pi=new WeakMap,Ro=new WeakMap,lP),Lx=new vM;function qv(){let e,t;const r=new Promise((i,a)=>{e=i,t=a});r.status="pending",r.catch(()=>{});function n(i){Object.assign(r,i),delete r.resolve,delete r.reject}return r.resolve=i=>{n({status:"fulfilled",value:i}),e(i)},r.reject=i=>{n({status:"rejected",reason:i}),t(i)},r}var yM=uM;function gM(){let e=[],t=0,r=s=>{s()},n=s=>{s()},i=yM;const a=s=>{t?e.push(s):i(()=>{r(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{i=s}}}var Pt=gM(),Do,mi,Io,uP,xM=(uP=class extends fc{constructor(){super();ne(this,Do,!0);ne(this,mi);ne(this,Io);Y(this,Io,t=>{if(!za&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){$(this,mi)||this.setEventListener($(this,Io))}onUnsubscribe(){var t;this.hasListeners()||((t=$(this,mi))==null||t.call(this),Y(this,mi,void 0))}setEventListener(t){var r;Y(this,Io,t),(r=$(this,mi))==null||r.call(this),Y(this,mi,t(this.setOnline.bind(this)))}setOnline(t){$(this,Do)!==t&&(Y(this,Do,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return $(this,Do)}},Do=new WeakMap,mi=new WeakMap,Io=new WeakMap,uP),Gf=new xM;function bM(e){return Math.min(1e3*2**e,3e4)}function Ck(e){return(e??"online")==="online"?Gf.isOnline():!0}var Wv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Mk(e){let t=!1,r=0,n;const i=qv(),a=()=>i.status!=="pending",o=m=>{var y;if(!a()){const b=new Wv(m);h(b),(y=e.onCancel)==null||y.call(e,b)}},s=()=>{t=!0},l=()=>{t=!1},u=()=>Lx.isFocused()&&(e.networkMode==="always"||Gf.isOnline())&&e.canRun(),f=()=>Ck(e.networkMode)&&e.canRun(),d=m=>{a()||(n==null||n(),i.resolve(m))},h=m=>{a()||(n==null||n(),i.reject(m))},p=()=>new Promise(m=>{var y;n=b=>{(a()||u())&&m(b)},(y=e.onPause)==null||y.call(e)}).then(()=>{var m;n=void 0,a()||(m=e.onContinue)==null||m.call(e)}),v=()=>{if(a())return;let m;const y=r===0?e.initialPromise:void 0;try{m=y??e.fn()}catch(b){m=Promise.reject(b)}Promise.resolve(m).then(d).catch(b=>{var j;if(a())return;const g=e.retry??(za?0:3),x=e.retryDelay??bM,S=typeof x=="function"?x(r,b):x,w=g===!0||typeof g=="number"&&ru()?void 0:p()).then(()=>{t?h(b):v()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(n==null||n(),i),cancelRetry:s,continueRetry:l,canStart:f,start:()=>(f()?v():p().then(v),i)}}var ja,cP,Rk=(cP=class{constructor(){ne(this,ja)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Fv(this.gcTime)&&Y(this,ja,ma.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(za?1/0:5*60*1e3))}clearGcTimeout(){$(this,ja)&&(ma.clearTimeout($(this,ja)),Y(this,ja,void 0))}},ja=new WeakMap,cP),Oa,Lo,_r,Pa,yt,tc,_a,Hr,_n,fP,wM=(fP=class extends Rk{constructor(t){super();ne(this,Hr);ne(this,Oa);ne(this,Lo);ne(this,_r);ne(this,Pa);ne(this,yt);ne(this,tc);ne(this,_a);Y(this,_a,!1),Y(this,tc,t.defaultOptions),this.setOptions(t.options),this.observers=[],Y(this,Pa,t.client),Y(this,_r,$(this,Pa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Y(this,Oa,vw(this.options)),this.state=t.state??$(this,Oa),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=$(this,yt))==null?void 0:t.promise}setOptions(t){if(this.options={...$(this,tc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=vw(this.options);r.data!==void 0&&(this.setState(mw(r.data,r.dataUpdatedAt)),Y(this,Oa,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&$(this,_r).remove(this)}setData(t,r){const n=Uv(this.state.data,t,this.options);return he(this,Hr,_n).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){he(this,Hr,_n).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,i;const r=(n=$(this,yt))==null?void 0:n.promise;return(i=$(this,yt))==null||i.cancel(t),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState($(this,Oa))}isActive(){return this.observers.some(t=>kr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ix||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Ri(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Ek(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=$(this,yt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=$(this,yt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),$(this,_r).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||($(this,yt)&&($(this,_a)?$(this,yt).cancel({revert:!0}):$(this,yt).cancelRetry()),this.scheduleGc()),$(this,_r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||he(this,Hr,_n).call(this,{type:"invalidate"})}async fetch(t,r){var l,u,f,d,h,p,v,m,y,b,g,x;if(this.state.fetchStatus!=="idle"&&((l=$(this,yt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if($(this,yt))return $(this,yt).continueRetry(),$(this,yt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(w=>w.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(Y(this,_a,!0),n.signal)})},a=()=>{const S=Tk(this.options,r),j=(()=>{const O={client:$(this,Pa),queryKey:this.queryKey,meta:this.meta};return i(O),O})();return Y(this,_a,!1),this.options.persister?this.options.persister(S,j,this):S(j)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:$(this,Pa),state:this.state,fetchFn:a};return i(S),S})();(u=this.options.behavior)==null||u.onFetch(s,this),Y(this,Lo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((f=s.fetchOptions)==null?void 0:f.meta))&&he(this,Hr,_n).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta}),Y(this,yt,Mk({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof Wv&&S.revert&&this.setState({...$(this,Lo),fetchStatus:"idle"}),n.abort()},onFail:(S,w)=>{he(this,Hr,_n).call(this,{type:"failed",failureCount:S,error:w})},onPause:()=>{he(this,Hr,_n).call(this,{type:"pause"})},onContinue:()=>{he(this,Hr,_n).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await $(this,yt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(p=(h=$(this,_r).config).onSuccess)==null||p.call(h,S,this),(m=(v=$(this,_r).config).onSettled)==null||m.call(v,S,this.state.error,this),S}catch(S){if(S instanceof Wv){if(S.silent)return $(this,yt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw he(this,Hr,_n).call(this,{type:"error",error:S}),(b=(y=$(this,_r).config).onError)==null||b.call(y,S,this),(x=(g=$(this,_r).config).onSettled)==null||x.call(g,this.state.data,S,this),S}finally{this.scheduleGc()}}},Oa=new WeakMap,Lo=new WeakMap,_r=new WeakMap,Pa=new WeakMap,yt=new WeakMap,tc=new WeakMap,_a=new WeakMap,Hr=new WeakSet,_n=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Dk(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,...mw(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Y(this,Lo,t.manual?i:void 0),i;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Pt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),$(this,_r).notify({query:this,type:"updated",action:t})})},fP);function Dk(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ck(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function mw(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vw(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Qt,pe,rc,Dt,ka,Fo,Nn,vi,nc,Bo,zo,Aa,Ea,yi,Uo,we,El,Hv,Kv,Vv,Gv,Qv,Yv,Xv,Ik,dP,SM=(dP=class extends fc{constructor(t,r){super();ne(this,we);ne(this,Qt);ne(this,pe);ne(this,rc);ne(this,Dt);ne(this,ka);ne(this,Fo);ne(this,Nn);ne(this,vi);ne(this,nc);ne(this,Bo);ne(this,zo);ne(this,Aa);ne(this,Ea);ne(this,yi);ne(this,Uo,new Set);this.options=r,Y(this,Qt,t),Y(this,vi,null),Y(this,Nn,qv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&($(this,pe).addObserver(this),yw($(this,pe),this.options)?he(this,we,El).call(this):this.updateResult(),he(this,we,Gv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zv($(this,pe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zv($(this,pe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,he(this,we,Qv).call(this),he(this,we,Yv).call(this),$(this,pe).removeObserver(this)}setOptions(t){const r=this.options,n=$(this,pe);if(this.options=$(this,Qt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof kr(this.options.enabled,$(this,pe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");he(this,we,Xv).call(this),$(this,pe).setOptions(this.options),r._defaulted&&!Bv(this.options,r)&&$(this,Qt).getQueryCache().notify({type:"observerOptionsUpdated",query:$(this,pe),observer:this});const i=this.hasListeners();i&&gw($(this,pe),n,this.options,r)&&he(this,we,El).call(this),this.updateResult(),i&&($(this,pe)!==n||kr(this.options.enabled,$(this,pe))!==kr(r.enabled,$(this,pe))||Ri(this.options.staleTime,$(this,pe))!==Ri(r.staleTime,$(this,pe)))&&he(this,we,Hv).call(this);const a=he(this,we,Kv).call(this);i&&($(this,pe)!==n||kr(this.options.enabled,$(this,pe))!==kr(r.enabled,$(this,pe))||a!==$(this,yi))&&he(this,we,Vv).call(this,a)}getOptimisticResult(t){const r=$(this,Qt).getQueryCache().build($(this,Qt),t),n=this.createResult(r,t);return OM(this,n)&&(Y(this,Dt,n),Y(this,Fo,this.options),Y(this,ka,$(this,pe).state)),n}getCurrentResult(){return $(this,Dt)}trackResult(t,r){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),r==null||r(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&$(this,Nn).status==="pending"&&$(this,Nn).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(t){$(this,Uo).add(t)}getCurrentQuery(){return $(this,pe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=$(this,Qt).defaultQueryOptions(t),n=$(this,Qt).getQueryCache().build($(this,Qt),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return he(this,we,El).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),$(this,Dt)))}createResult(t,r){var A;const n=$(this,pe),i=this.options,a=$(this,Dt),o=$(this,ka),s=$(this,Fo),u=t!==n?t.state:$(this,rc),{state:f}=t;let d={...f},h=!1,p;if(r._optimisticResults){const E=this.hasListeners(),N=!E&&yw(t,r),T=E&&gw(t,n,r,i);(N||T)&&(d={...d,...Dk(f.data,t.options)}),r._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:v,errorUpdatedAt:m,status:y}=d;p=d.data;let b=!1;if(r.placeholderData!==void 0&&p===void 0&&y==="pending"){let E;a!=null&&a.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(E=a.data,b=!0):E=typeof r.placeholderData=="function"?r.placeholderData((A=$(this,zo))==null?void 0:A.state.data,$(this,zo)):r.placeholderData,E!==void 0&&(y="success",p=Uv(a==null?void 0:a.data,E,r),h=!0)}if(r.select&&p!==void 0&&!b)if(a&&p===(o==null?void 0:o.data)&&r.select===$(this,nc))p=$(this,Bo);else try{Y(this,nc,r.select),p=r.select(p),p=Uv(a==null?void 0:a.data,p,r),Y(this,Bo,p),Y(this,vi,null)}catch(E){Y(this,vi,E)}$(this,vi)&&(v=$(this,vi),p=$(this,Bo),m=Date.now(),y="error");const g=d.fetchStatus==="fetching",x=y==="pending",S=y==="error",w=x&&g,j=p!==void 0,P={status:y,fetchStatus:d.fetchStatus,isPending:x,isSuccess:y==="success",isError:S,isInitialLoading:w,isLoading:w,data:p,dataUpdatedAt:d.dataUpdatedAt,error:v,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:g,isRefetching:g&&!x,isLoadingError:S&&!j,isPaused:d.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:S&&j,isStale:Fx(t,r),refetch:this.refetch,promise:$(this,Nn),isEnabled:kr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const E=P.data!==void 0,N=P.status==="error"&&!E,T=D=>{N?D.reject(P.error):E&&D.resolve(P.data)},M=()=>{const D=Y(this,Nn,P.promise=qv());T(D)},R=$(this,Nn);switch(R.status){case"pending":t.queryHash===n.queryHash&&T(R);break;case"fulfilled":(N||P.data!==R.value)&&M();break;case"rejected":(!N||P.error!==R.reason)&&M();break}}return P}updateResult(){const t=$(this,Dt),r=this.createResult($(this,pe),this.options);if(Y(this,ka,$(this,pe).state),Y(this,Fo,this.options),$(this,ka).data!==void 0&&Y(this,zo,$(this,pe)),Bv(r,t))return;Y(this,Dt,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!$(this,Uo).size)return!0;const o=new Set(a??$(this,Uo));return this.options.throwOnError&&o.add("error"),Object.keys($(this,Dt)).some(s=>{const l=s;return $(this,Dt)[l]!==t[l]&&o.has(l)})};he(this,we,Ik).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&he(this,we,Gv).call(this)}},Qt=new WeakMap,pe=new WeakMap,rc=new WeakMap,Dt=new WeakMap,ka=new WeakMap,Fo=new WeakMap,Nn=new WeakMap,vi=new WeakMap,nc=new WeakMap,Bo=new WeakMap,zo=new WeakMap,Aa=new WeakMap,Ea=new WeakMap,yi=new WeakMap,Uo=new WeakMap,we=new WeakSet,El=function(t){he(this,we,Xv).call(this);let r=$(this,pe).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Yt)),r},Hv=function(){he(this,we,Qv).call(this);const t=Ri(this.options.staleTime,$(this,pe));if(za||$(this,Dt).isStale||!Fv(t))return;const n=Ek($(this,Dt).dataUpdatedAt,t)+1;Y(this,Aa,ma.setTimeout(()=>{$(this,Dt).isStale||this.updateResult()},n))},Kv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval($(this,pe)):this.options.refetchInterval)??!1},Vv=function(t){he(this,we,Yv).call(this),Y(this,yi,t),!(za||kr(this.options.enabled,$(this,pe))===!1||!Fv($(this,yi))||$(this,yi)===0)&&Y(this,Ea,ma.setInterval(()=>{(this.options.refetchIntervalInBackground||Lx.isFocused())&&he(this,we,El).call(this)},$(this,yi)))},Gv=function(){he(this,we,Hv).call(this),he(this,we,Vv).call(this,he(this,we,Kv).call(this))},Qv=function(){$(this,Aa)&&(ma.clearTimeout($(this,Aa)),Y(this,Aa,void 0))},Yv=function(){$(this,Ea)&&(ma.clearInterval($(this,Ea)),Y(this,Ea,void 0))},Xv=function(){const t=$(this,Qt).getQueryCache().build($(this,Qt),this.options);if(t===$(this,pe))return;const r=$(this,pe);Y(this,pe,t),Y(this,rc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},Ik=function(t){Pt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r($(this,Dt))}),$(this,Qt).getQueryCache().notify({query:$(this,pe),type:"observerResultsUpdated"})})},dP);function jM(e,t){return kr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function yw(e,t){return jM(e,t)||e.state.data!==void 0&&Zv(e,t,t.refetchOnMount)}function Zv(e,t,r){if(kr(t.enabled,e)!==!1&&Ri(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Fx(e,t)}return!1}function gw(e,t,r,n){return(e!==t||kr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Fx(e,r)}function Fx(e,t){return kr(t.enabled,e)!==!1&&e.isStaleByTime(Ri(t.staleTime,e))}function OM(e,t){return!Bv(e.getCurrentResult(),t)}function xw(e){return{onFetch:(t,r)=>{var f,d,h,p,v;const n=t.options,i=(h=(d=(f=t.fetchOptions)==null?void 0:f.meta)==null?void 0:d.fetchMore)==null?void 0:h.direction,a=((p=t.state.data)==null?void 0:p.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const u=async()=>{let m=!1;const y=x=>{mM(x,()=>t.signal,()=>m=!0)},b=Tk(t.options,t.fetchOptions),g=async(x,S,w)=>{if(m)return Promise.reject();if(S==null&&x.pages.length)return Promise.resolve(x);const O=(()=>{const N={client:t.client,queryKey:t.queryKey,pageParam:S,direction:w?"backward":"forward",meta:t.options.meta};return y(N),N})(),P=await b(O),{maxPages:A}=t.options,E=w?pM:hM;return{pages:E(x.pages,P,A),pageParams:E(x.pageParams,S,A)}};if(i&&a.length){const x=i==="backward",S=x?PM:bw,w={pages:a,pageParams:o},j=S(n,w);s=await g(w,j,x)}else{const x=e??a.length;do{const S=l===0?o[0]??n.initialPageParam:bw(n,s);if(l>0&&S==null)break;s=await g(s,S),l++}while(l{var m,y;return(y=(m=t.options).persister)==null?void 0:y.call(m,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=u}}}function bw(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function PM(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var ic,un,It,Na,cn,ai,hP,_M=(hP=class extends Rk{constructor(t){super();ne(this,cn);ne(this,ic);ne(this,un);ne(this,It);ne(this,Na);Y(this,ic,t.client),this.mutationId=t.mutationId,Y(this,It,t.mutationCache),Y(this,un,[]),this.state=t.state||kM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){$(this,un).includes(t)||($(this,un).push(t),this.clearGcTimeout(),$(this,It).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Y(this,un,$(this,un).filter(r=>r!==t)),this.scheduleGc(),$(this,It).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){$(this,un).length||(this.state.status==="pending"?this.scheduleGc():$(this,It).remove(this))}continue(){var t;return((t=$(this,Na))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,l,u,f,d,h,p,v,m,y,b,g,x,S,w,j,O,P,A;const r=()=>{he(this,cn,ai).call(this,{type:"continue"})},n={client:$(this,ic),meta:this.options.meta,mutationKey:this.options.mutationKey};Y(this,Na,Mk({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(E,N)=>{he(this,cn,ai).call(this,{type:"failed",failureCount:E,error:N})},onPause:()=>{he(this,cn,ai).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>$(this,It).canRun(this)}));const i=this.state.status==="pending",a=!$(this,Na).canStart();try{if(i)r();else{he(this,cn,ai).call(this,{type:"pending",variables:t,isPaused:a}),await((s=(o=$(this,It).config).onMutate)==null?void 0:s.call(o,t,this,n));const N=await((u=(l=this.options).onMutate)==null?void 0:u.call(l,t,n));N!==this.state.context&&he(this,cn,ai).call(this,{type:"pending",context:N,variables:t,isPaused:a})}const E=await $(this,Na).start();return await((d=(f=$(this,It).config).onSuccess)==null?void 0:d.call(f,E,t,this.state.context,this,n)),await((p=(h=this.options).onSuccess)==null?void 0:p.call(h,E,t,this.state.context,n)),await((m=(v=$(this,It).config).onSettled)==null?void 0:m.call(v,E,null,this.state.variables,this.state.context,this,n)),await((b=(y=this.options).onSettled)==null?void 0:b.call(y,E,null,t,this.state.context,n)),he(this,cn,ai).call(this,{type:"success",data:E}),E}catch(E){try{await((x=(g=$(this,It).config).onError)==null?void 0:x.call(g,E,t,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((w=(S=this.options).onError)==null?void 0:w.call(S,E,t,this.state.context,n))}catch(N){Promise.reject(N)}try{await((O=(j=$(this,It).config).onSettled)==null?void 0:O.call(j,void 0,E,this.state.variables,this.state.context,this,n))}catch(N){Promise.reject(N)}try{await((A=(P=this.options).onSettled)==null?void 0:A.call(P,void 0,E,t,this.state.context,n))}catch(N){Promise.reject(N)}throw he(this,cn,ai).call(this,{type:"error",error:E}),E}finally{$(this,It).runNext(this)}}},ic=new WeakMap,un=new WeakMap,It=new WeakMap,Na=new WeakMap,cn=new WeakSet,ai=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Pt.batch(()=>{$(this,un).forEach(n=>{n.onMutationUpdate(t)}),$(this,It).notify({mutation:this,type:"updated",action:t})})},hP);function kM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Tn,Kr,ac,pP,AM=(pP=class extends fc{constructor(t={}){super();ne(this,Tn);ne(this,Kr);ne(this,ac);this.config=t,Y(this,Tn,new Set),Y(this,Kr,new Map),Y(this,ac,0)}build(t,r,n){const i=new _M({client:t,mutationCache:this,mutationId:++Pc(this,ac)._,options:t.defaultMutationOptions(r),state:n});return this.add(i),i}add(t){$(this,Tn).add(t);const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r);n?n.push(t):$(this,Kr).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if($(this,Tn).delete(t)){const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&$(this,Kr).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=Wc(t);if(typeof r=="string"){const n=$(this,Kr).get(r),i=n==null?void 0:n.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){var n;const r=Wc(t);if(typeof r=="string"){const i=(n=$(this,Kr).get(r))==null?void 0:n.find(a=>a!==t&&a.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Pt.batch(()=>{$(this,Tn).forEach(t=>{this.notify({type:"removed",mutation:t})}),$(this,Tn).clear(),$(this,Kr).clear()})}getAll(){return Array.from($(this,Tn))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>dw(r,n))}findAll(t={}){return this.getAll().filter(r=>dw(t,r))}notify(t){Pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Pt.batch(()=>Promise.all(t.map(r=>r.continue().catch(Yt))))}},Tn=new WeakMap,Kr=new WeakMap,ac=new WeakMap,pP);function Wc(e){var t;return(t=e.options.scope)==null?void 0:t.id}var fn,mP,EM=(mP=class extends fc{constructor(t={}){super();ne(this,fn);this.config=t,Y(this,fn,new Map)}build(t,r,n){const i=r.queryKey,a=r.queryHash??Dx(i,r);let o=this.get(a);return o||(o=new wM({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(o)),o}add(t){$(this,fn).has(t.queryHash)||($(this,fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=$(this,fn).get(t.queryHash);r&&(t.destroy(),r===t&&$(this,fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Pt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return $(this,fn).get(t)}getAll(){return[...$(this,fn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>fw(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>fw(t,n)):r}notify(t){Pt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Pt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Pt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},fn=new WeakMap,mP),He,gi,xi,qo,Wo,bi,Ho,Ko,vP,NM=(vP=class{constructor(e={}){ne(this,He);ne(this,gi);ne(this,xi);ne(this,qo);ne(this,Wo);ne(this,bi);ne(this,Ho);ne(this,Ko);Y(this,He,e.queryCache||new EM),Y(this,gi,e.mutationCache||new AM),Y(this,xi,e.defaultOptions||{}),Y(this,qo,new Map),Y(this,Wo,new Map),Y(this,bi,0)}mount(){Pc(this,bi)._++,$(this,bi)===1&&(Y(this,Ho,Lx.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,He).onFocus())})),Y(this,Ko,Gf.subscribe(async e=>{e&&(await this.resumePausedMutations(),$(this,He).onOnline())})))}unmount(){var e,t;Pc(this,bi)._--,$(this,bi)===0&&((e=$(this,Ho))==null||e.call(this),Y(this,Ho,void 0),(t=$(this,Ko))==null||t.call(this),Y(this,Ko,void 0))}isFetching(e){return $(this,He).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return $(this,gi).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=$(this,He).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=$(this,He).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(Ri(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return $(this,He).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),i=$(this,He).get(n.queryHash),a=i==null?void 0:i.state.data,o=cM(t,a);if(o!==void 0)return $(this,He).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return Pt.batch(()=>$(this,He).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=$(this,He).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=$(this,He);Pt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=$(this,He);return Pt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Pt.batch(()=>$(this,He).findAll(e).map(i=>i.cancel(r)));return Promise.all(n).then(Yt).catch(Yt)}invalidateQueries(e,t={}){return Pt.batch(()=>($(this,He).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Pt.batch(()=>$(this,He).findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,r);return r.throwOnError||(a=a.catch(Yt)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(n).then(Yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=$(this,He).build(this,t);return r.isStaleByTime(Ri(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yt).catch(Yt)}fetchInfiniteQuery(e){return e.behavior=xw(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yt).catch(Yt)}ensureInfiniteQueryData(e){return e.behavior=xw(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Gf.isOnline()?$(this,gi).resumePausedMutations():Promise.resolve()}getQueryCache(){return $(this,He)}getMutationCache(){return $(this,gi)}getDefaultOptions(){return $(this,xi)}setDefaultOptions(e){Y(this,xi,e)}setQueryDefaults(e,t){$(this,qo).set(hu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...$(this,qo).values()],r={};return t.forEach(n=>{pu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){$(this,Wo).set(hu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...$(this,Wo).values()],r={};return t.forEach(n=>{pu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...$(this,xi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Dx(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Ix&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...$(this,xi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){$(this,He).clear(),$(this,gi).clear()}},He=new WeakMap,gi=new WeakMap,xi=new WeakMap,qo=new WeakMap,Wo=new WeakMap,bi=new WeakMap,Ho=new WeakMap,Ko=new WeakMap,vP),Lk=k.createContext(void 0),TM=e=>{const t=k.useContext(Lk);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},$M=({client:e,children:t})=>(k.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(Lk.Provider,{value:e,children:t})),Fk=k.createContext(!1),CM=()=>k.useContext(Fk);Fk.Provider;function MM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var RM=k.createContext(MM()),DM=()=>k.useContext(RM),IM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?$k(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},LM=e=>{k.useEffect(()=>{e.clearReset()},[e])},FM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(i&&e.data===void 0||$k(r,[e.error,n])),BM=e=>{if(e.suspense){const r=i=>i==="static"?i:Math.max(i??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...i)=>r(n(...i)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},zM=(e,t)=>e.isLoading&&e.isFetching&&!t,UM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ww=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function qM(e,t,r){var h,p,v,m;const n=CM(),i=DM(),a=TM(),o=a.defaultQueryOptions(e);(p=(h=a.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||p.call(h,o);const s=a.getQueryCache().get(o.queryHash);o._optimisticResults=n?"isRestoring":"optimistic",BM(o),IM(o,i,s),LM(i);const l=!a.getQueryCache().get(o.queryHash),[u]=k.useState(()=>new t(a,o)),f=u.getOptimisticResult(o),d=!n&&e.subscribed!==!1;if(k.useSyncExternalStore(k.useCallback(y=>{const b=d?u.subscribe(Pt.batchCalls(y)):Yt;return u.updateResult(),b},[u,d]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),k.useEffect(()=>{u.setOptions(o)},[o,u]),UM(o,f))throw ww(o,u,i);if(FM({result:f,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw f.error;if((m=(v=a.getDefaultOptions().queries)==null?void 0:v._experimental_afterQuery)==null||m.call(v,o,f),o.experimental_prefetchInRender&&!za&&zM(f,n)){const y=l?ww(o,u,i):s==null?void 0:s.promise;y==null||y.catch(Yt).finally(()=>{u.updateResult()})}return o.notifyOnChangeProps?f:u.trackResult(f)}function Qe(e,t){return qM(e,SM)}/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Fx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function WM(){return Math.random().toString(36).substr(2,8)}function Sw(e,t){return{usr:e.state,key:e.key,idx:t}}function Zv(e,t,r,n){return r===void 0&&(r=null),mu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rs(t):t,{state:r,key:t&&t.key||n||WM()})}function Qf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Rs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function HM(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=ji.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(mu({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){s=ji.Pop;let y=f(),b=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:b})}function h(y,b){s=ji.Push;let g=Zv(m.location,y,b);u=f()+1;let x=Sw(g,u),S=m.createHref(g);try{o.pushState(x,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function p(y,b){s=ji.Replace;let g=Zv(m.location,y,b);u=f();let x=Sw(g,u),S=m.createHref(g);o.replaceState(x,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function v(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,g=typeof y=="string"?y:Qf(y);return g=g.replace(/ $/,"%20"),rt(b,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,b)}let m={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(ww,d),l=y,()=>{i.removeEventListener(ww,d),l=null}},createHref(y){return t(i,y)},createURL:v,encodeLocation(y){let b=v(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var jw;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(jw||(jw={}));function KM(e,t,r){return r===void 0&&(r="/"),VM(e,t,r)}function VM(e,t,r,n){let i=typeof t=="string"?Rs(t):t,a=Bx(i.pathname||"/",r);if(a==null)return null;let o=Fk(e);GM(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(rt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Di([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(rt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Fk(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:tR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of Bk(a.path))i(a,o,l)}),t}function Bk(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=Bk(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function GM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:rR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const QM=/^:[\w-]+$/,YM=3,XM=2,ZM=1,JM=10,eR=-2,Ow=e=>e==="*";function tR(e,t){let r=e.split("/"),n=r.length;return r.some(Ow)&&(n+=eR),t&&(n+=XM),r.filter(i=>!Ow(i)).reduce((i,a)=>i+(QM.test(a)?YM:a===""?ZM:JM),n)}function rR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function nR(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:h,isOptional:p}=f;if(h==="*"){let m=s[d]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const v=s[d];return p&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function aR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Fx(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function oR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fx(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Bx(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const sR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lR=e=>sR.test(e);function uR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Rs(e):e,a;if(r)if(lR(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),Fx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=Pw(r.substring(1),"/"):a=Pw(r,t)}else a=t;return{pathname:a,search:dR(n),hash:hR(i)}}function Pw(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function nm(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function cR(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function zk(e,t){let r=cR(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function Uk(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Rs(e):(i=mu({},e),rt(!i.pathname||!i.pathname.includes("?"),nm("?","pathname","search",i)),rt(!i.pathname||!i.pathname.includes("#"),nm("#","pathname","hash",i)),rt(!i.search||!i.search.includes("#"),nm("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=uR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Di=e=>e.join("/").replace(/\/\/+/g,"/"),fR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),dR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,hR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function pR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const qk=["post","put","patch","delete"];new Set(qk);const mR=["get",...qk];new Set(mR);/** + */function mu(){return mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Bx(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function HM(){return Math.random().toString(36).substr(2,8)}function jw(e,t){return{usr:e.state,key:e.key,idx:t}}function Jv(e,t,r,n){return r===void 0&&(r=null),mu({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Rs(t):t,{state:r,key:t&&t.key||n||HM()})}function Qf(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Rs(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function KM(e,t,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,o=i.history,s=ji.Pop,l=null,u=f();u==null&&(u=0,o.replaceState(mu({},o.state,{idx:u}),""));function f(){return(o.state||{idx:null}).idx}function d(){s=ji.Pop;let y=f(),b=y==null?null:y-u;u=y,l&&l({action:s,location:m.location,delta:b})}function h(y,b){s=ji.Push;let g=Jv(m.location,y,b);u=f()+1;let x=jw(g,u),S=m.createHref(g);try{o.pushState(x,"",S)}catch(w){if(w instanceof DOMException&&w.name==="DataCloneError")throw w;i.location.assign(S)}a&&l&&l({action:s,location:m.location,delta:1})}function p(y,b){s=ji.Replace;let g=Jv(m.location,y,b);u=f();let x=jw(g,u),S=m.createHref(g);o.replaceState(x,"",S),a&&l&&l({action:s,location:m.location,delta:0})}function v(y){let b=i.location.origin!=="null"?i.location.origin:i.location.href,g=typeof y=="string"?y:Qf(y);return g=g.replace(/ $/,"%20"),rt(b,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,b)}let m={get action(){return s},get location(){return e(i,o)},listen(y){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(Sw,d),l=y,()=>{i.removeEventListener(Sw,d),l=null}},createHref(y){return t(i,y)},createURL:v,encodeLocation(y){let b=v(y);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:p,go(y){return o.go(y)}};return m}var Ow;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ow||(Ow={}));function VM(e,t,r){return r===void 0&&(r="/"),GM(e,t,r)}function GM(e,t,r,n){let i=typeof t=="string"?Rs(t):t,a=zx(i.pathname||"/",r);if(a==null)return null;let o=Bk(e);QM(o);let s=null;for(let l=0;s==null&&l{let l={relativePath:s===void 0?a.path||"":s,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};l.relativePath.startsWith("/")&&(rt(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Di([n,l.relativePath]),f=r.concat(l);a.children&&a.children.length>0&&(rt(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Bk(a.children,t,f,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:rR(u,a.index),routesMeta:f})};return e.forEach((a,o)=>{var s;if(a.path===""||!((s=a.path)!=null&&s.includes("?")))i(a,o);else for(let l of zk(a.path))i(a,o,l)}),t}function zk(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,i=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return i?[a,""]:[a];let o=zk(n.join("/")),s=[];return s.push(...o.map(l=>l===""?a:[a,l].join("/"))),i&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function QM(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:nR(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const YM=/^:[\w-]+$/,XM=3,ZM=2,JM=1,eR=10,tR=-2,Pw=e=>e==="*";function rR(e,t){let r=e.split("/"),n=r.length;return r.some(Pw)&&(n+=tR),t&&(n+=ZM),r.filter(i=>!Pw(i)).reduce((i,a)=>i+(YM.test(a)?XM:a===""?JM:eR),n)}function nR(e,t){return e.length===t.length&&e.slice(0,-1).every((n,i)=>n===t[i])?e[e.length-1]-t[t.length-1]:0}function iR(e,t,r){let{routesMeta:n}=e,i={},a="/",o=[];for(let s=0;s{let{paramName:h,isOptional:p}=f;if(h==="*"){let m=s[d]||"";o=a.slice(0,a.length-m.length).replace(/(.)\/+$/,"$1")}const v=s[d];return p&&!v?u[h]=void 0:u[h]=(v||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function oR(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),Bx(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 n=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(n.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),n]}function sR(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Bx(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function zx(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}const lR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uR=e=>lR.test(e);function cR(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:i=""}=typeof e=="string"?Rs(e):e,a;if(r)if(uR(r))a=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),Bx(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?a=_w(r.substring(1),"/"):a=_w(r,t)}else a=t;return{pathname:a,search:hR(n),hash:pR(i)}}function _w(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function nm(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function fR(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Uk(e,t){let r=fR(e);return t?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function qk(e,t,r,n){n===void 0&&(n=!1);let i;typeof e=="string"?i=Rs(e):(i=mu({},e),rt(!i.pathname||!i.pathname.includes("?"),nm("?","pathname","search",i)),rt(!i.pathname||!i.pathname.includes("#"),nm("#","pathname","hash",i)),rt(!i.search||!i.search.includes("#"),nm("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,s;if(o==null)s=r;else{let d=t.length-1;if(!n&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),d-=1;i.pathname=h.join("/")}s=d>=0?t[d]:"/"}let l=cR(i,s),u=o&&o!=="/"&&o.endsWith("/"),f=(a||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||f)&&(l.pathname+="/"),l}const Di=e=>e.join("/").replace(/\/\/+/g,"/"),dR=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hR=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pR=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function mR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Wk=["post","put","patch","delete"];new Set(Wk);const vR=["get",...Wk];new Set(vR);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),k.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let d=Uk(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Di([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,o,a,e])}function xR(){let{matches:e}=k.useContext(Ki),t=e[e.length-1];return t?t.params:{}}function Kk(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=k.useContext(Ya),{matches:i}=k.useContext(Ki),{pathname:a}=Vi(),o=JSON.stringify(zk(i,n.v7_relativeSplatPath));return k.useMemo(()=>Uk(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function bR(e,t){return wR(e,t)}function wR(e,t,r,n){dc()||rt(!1);let{navigator:i}=k.useContext(Ya),{matches:a}=k.useContext(Ki),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Vi(),f;if(t){var d;let y=typeof t=="string"?Rs(t):t;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||rt(!1),f=y}else f=u;let h=f.pathname||"/",p=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=KM(e,{pathname:p}),m=_R(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Di([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Di([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?k.createElement(kh.Provider,{value:{location:vu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:ji.Pop}},m):m}function SR(){let e=NR(),t=pR(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),r?k.createElement("pre",{style:i},r):null,null)}const jR=k.createElement(SR,null);class OR extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?k.createElement(Ki.Provider,{value:this.props.routeContext},k.createElement(Wk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function PR(e){let{routeContext:t,match:r,children:n}=e,i=k.useContext(zx);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),k.createElement(Ki.Provider,{value:t},n)}function _R(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||rt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,h)=>{let p,v=!1,m=null,y=null;r&&(p=s&&d.route.id?s[d.route.id]:void 0,m=d.route.errorElement||jR,l&&(u<0&&h===0?($R("route-fallback"),v=!0,y=null):u===h&&(v=!0,y=d.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,h+1)),g=()=>{let x;return p?x=m:v?x=y:d.route.Component?x=k.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,k.createElement(PR,{match:d,routeContext:{outlet:f,matches:b,isDataRoute:r!=null},children:x})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?k.createElement(OR,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):g()},null)}var Vk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Vk||{}),Gk=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Gk||{});function kR(e){let t=k.useContext(zx);return t||rt(!1),t}function AR(e){let t=k.useContext(vR);return t||rt(!1),t}function ER(e){let t=k.useContext(Ki);return t||rt(!1),t}function Qk(e){let t=ER(),r=t.matches[t.matches.length-1];return r.route.id||rt(!1),r.route.id}function NR(){var e;let t=k.useContext(Wk),r=AR(),n=Qk();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function TR(){let{router:e}=kR(Vk.UseNavigateStable),t=Qk(Gk.UseNavigateStable),r=k.useRef(!1);return Hk(()=>{r.current=!0}),k.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,vu({fromRouteId:t},a)))},[e,t])}const _w={};function $R(e,t,r){_w[e]||(_w[e]=!0)}function CR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function qr(e){rt(!1)}function MR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=ji.Pop,navigator:a,static:o=!1,future:s}=e;dc()&&rt(!1);let l=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:a,static:o,future:vu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=Rs(n));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:v="default"}=n,m=k.useMemo(()=>{let y=Bx(f,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:p,key:v},navigationType:i}},[l,f,d,h,p,v,i]);return m==null?null:k.createElement(Ya.Provider,{value:u},k.createElement(kh.Provider,{children:r,value:m}))}function RR(e){let{children:t,location:r}=e;return bR(Jv(t),r)}new Promise(()=>{});function Jv(e,t){t===void 0&&(t=[]);let r=[];return k.Children.forEach(e,(n,i)=>{if(!k.isValidElement(n))return;let a=[...t,i];if(n.type===k.Fragment){r.push.apply(r,Jv(n.props.children,a));return}n.type!==qr&&rt(!1),!n.props.index||!n.props.children||rt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Jv(n.props.children,a)),r.push(o)}),r}/** + */function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{s.current=!0}),k.useCallback(function(u,f){if(f===void 0&&(f={}),!s.current)return;if(typeof u=="number"){n.go(u);return}let d=qk(u,JSON.parse(o),a,f.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:Di([t,d.pathname])),(f.replace?n.replace:n.push)(d,f.state,f)},[t,n,o,a,e])}function bR(){let{matches:e}=k.useContext(Ki),t=e[e.length-1];return t?t.params:{}}function Vk(e,t){let{relative:r}=t===void 0?{}:t,{future:n}=k.useContext(Ya),{matches:i}=k.useContext(Ki),{pathname:a}=Vi(),o=JSON.stringify(Uk(i,n.v7_relativeSplatPath));return k.useMemo(()=>qk(e,JSON.parse(o),a,r==="path"),[e,o,a,r])}function wR(e,t){return SR(e,t)}function SR(e,t,r,n){dc()||rt(!1);let{navigator:i}=k.useContext(Ya),{matches:a}=k.useContext(Ki),o=a[a.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Vi(),f;if(t){var d;let y=typeof t=="string"?Rs(t):t;l==="/"||(d=y.pathname)!=null&&d.startsWith(l)||rt(!1),f=y}else f=u;let h=f.pathname||"/",p=h;if(l!=="/"){let y=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let v=VM(e,{pathname:p}),m=kR(v&&v.map(y=>Object.assign({},y,{params:Object.assign({},s,y.params),pathname:Di([l,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?l:Di([l,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,r,n);return t&&m?k.createElement(kh.Provider,{value:{location:vu({pathname:"/",search:"",hash:"",state:null,key:"default"},f),navigationType:ji.Pop}},m):m}function jR(){let e=TR(),t=mR(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return k.createElement(k.Fragment,null,k.createElement("h2",null,"Unexpected Application Error!"),k.createElement("h3",{style:{fontStyle:"italic"}},t),r?k.createElement("pre",{style:i},r):null,null)}const OR=k.createElement(jR,null);class PR extends k.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error!==void 0?k.createElement(Ki.Provider,{value:this.props.routeContext},k.createElement(Hk.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _R(e){let{routeContext:t,match:r,children:n}=e,i=k.useContext(Ux);return i&&i.static&&i.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=r.route.id),k.createElement(Ki.Provider,{value:t},n)}function kR(e,t,r,n){var i;if(t===void 0&&(t=[]),r===void 0&&(r=null),n===void 0&&(n=null),e==null){var a;if(!r)return null;if(r.errors)e=r.matches;else if((a=n)!=null&&a.v7_partialHydration&&t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=(i=r)==null?void 0:i.errors;if(s!=null){let f=o.findIndex(d=>d.route.id&&(s==null?void 0:s[d.route.id])!==void 0);f>=0||rt(!1),o=o.slice(0,Math.min(o.length,f+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let f=0;f=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((f,d,h)=>{let p,v=!1,m=null,y=null;r&&(p=s&&d.route.id?s[d.route.id]:void 0,m=d.route.errorElement||OR,l&&(u<0&&h===0?(CR("route-fallback"),v=!0,y=null):u===h&&(v=!0,y=d.route.hydrateFallbackElement||null)));let b=t.concat(o.slice(0,h+1)),g=()=>{let x;return p?x=m:v?x=y:d.route.Component?x=k.createElement(d.route.Component,null):d.route.element?x=d.route.element:x=f,k.createElement(_R,{match:d,routeContext:{outlet:f,matches:b,isDataRoute:r!=null},children:x})};return r&&(d.route.ErrorBoundary||d.route.errorElement||h===0)?k.createElement(PR,{location:r.location,revalidation:r.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):g()},null)}var Gk=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Gk||{}),Qk=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Qk||{});function AR(e){let t=k.useContext(Ux);return t||rt(!1),t}function ER(e){let t=k.useContext(yR);return t||rt(!1),t}function NR(e){let t=k.useContext(Ki);return t||rt(!1),t}function Yk(e){let t=NR(),r=t.matches[t.matches.length-1];return r.route.id||rt(!1),r.route.id}function TR(){var e;let t=k.useContext(Hk),r=ER(),n=Yk();return t!==void 0?t:(e=r.errors)==null?void 0:e[n]}function $R(){let{router:e}=AR(Gk.UseNavigateStable),t=Yk(Qk.UseNavigateStable),r=k.useRef(!1);return Kk(()=>{r.current=!0}),k.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,vu({fromRouteId:t},a)))},[e,t])}const kw={};function CR(e,t,r){kw[e]||(kw[e]=!0)}function MR(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function qr(e){rt(!1)}function RR(e){let{basename:t="/",children:r=null,location:n,navigationType:i=ji.Pop,navigator:a,static:o=!1,future:s}=e;dc()&&rt(!1);let l=t.replace(/^\/*/,"/"),u=k.useMemo(()=>({basename:l,navigator:a,static:o,future:vu({v7_relativeSplatPath:!1},s)}),[l,s,a,o]);typeof n=="string"&&(n=Rs(n));let{pathname:f="/",search:d="",hash:h="",state:p=null,key:v="default"}=n,m=k.useMemo(()=>{let y=zx(f,l);return y==null?null:{location:{pathname:y,search:d,hash:h,state:p,key:v},navigationType:i}},[l,f,d,h,p,v,i]);return m==null?null:k.createElement(Ya.Provider,{value:u},k.createElement(kh.Provider,{children:r,value:m}))}function DR(e){let{children:t,location:r}=e;return wR(ey(t),r)}new Promise(()=>{});function ey(e,t){t===void 0&&(t=[]);let r=[];return k.Children.forEach(e,(n,i)=>{if(!k.isValidElement(n))return;let a=[...t,i];if(n.type===k.Fragment){r.push.apply(r,ey(n.props.children,a));return}n.type!==qr&&rt(!1),!n.props.index||!n.props.children||rt(!1);let o={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=ey(n.props.children,a)),r.push(o)}),r}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. @@ -64,22 +64,22 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function ey(){return ey=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function IR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function LR(e,t){return e.button===0&&(!t||t==="_self")&&!IR(e)}function ty(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function FR(e,t){let r=ty(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(a=>{r.append(i,a)})}),r}const BR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],zR="6";try{window.__reactRouterVersion=zR}catch{}const UR="startTransition",kw=GT[UR];function qR(e){let{basename:t,children:r,future:n,window:i}=e,a=k.useRef();a.current==null&&(a.current=qM({window:i,v5Compat:!0}));let o=a.current,[s,l]=k.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=k.useCallback(d=>{u&&kw?kw(()=>l(d)):l(d)},[l,u]);return k.useLayoutEffect(()=>o.listen(f),[o,f]),k.useEffect(()=>CR(n),[n]),k.createElement(MR,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const WR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",HR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,KR=k.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:d}=t,h=DR(t,BR),{basename:p}=k.useContext(Ya),v,m=!1;if(typeof u=="string"&&HR.test(u)&&(v=u,WR))try{let x=new URL(window.location.href),S=u.startsWith("//")?new URL(x.protocol+u):new URL(u),w=Bx(S.pathname,p);S.origin===x.origin&&w!=null?u=w+S.search+S.hash:m=!0}catch{}let y=yR(u,{relative:i}),b=VR(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:d});function g(x){n&&n(x),x.defaultPrevented||b(x)}return k.createElement("a",ey({},h,{href:v||y,onClick:m||a?n:g,ref:r,target:l}))});var Aw;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Aw||(Aw={}));var Ew;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ew||(Ew={}));function VR(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=mt(),u=Vi(),f=Kk(e,{relative:o});return k.useCallback(d=>{if(LR(d,r)){d.preventDefault();let h=n!==void 0?n:Qf(u)===Qf(f);l(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function Ah(e){let t=k.useRef(ty(e)),r=k.useRef(!1),n=Vi(),i=k.useMemo(()=>FR(n.search,r.current?null:t.current),[n.search]),a=mt(),o=k.useCallback((s,l)=>{const u=ty(typeof s=="function"?s(i):s);r.current=!0,a("?"+u,l)},[a,i]);return[i,o]}/** + */function ty(){return ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(r[i]=e[i]);return r}function LR(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function FR(e,t){return e.button===0&&(!t||t==="_self")&&!LR(e)}function ry(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(i=>[r,i]):[[r,n]])},[]))}function BR(e,t){let r=ry(e);return t&&t.forEach((n,i)=>{r.has(i)||t.getAll(i).forEach(a=>{r.append(i,a)})}),r}const zR=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],UR="6";try{window.__reactRouterVersion=UR}catch{}const qR="startTransition",Aw=QT[qR];function WR(e){let{basename:t,children:r,future:n,window:i}=e,a=k.useRef();a.current==null&&(a.current=WM({window:i,v5Compat:!0}));let o=a.current,[s,l]=k.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},f=k.useCallback(d=>{u&&Aw?Aw(()=>l(d)):l(d)},[l,u]);return k.useLayoutEffect(()=>o.listen(f),[o,f]),k.useEffect(()=>MR(n),[n]),k.createElement(RR,{basename:t,children:r,location:s.location,navigationType:s.action,navigator:o,future:n})}const HR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",KR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,VR=k.forwardRef(function(t,r){let{onClick:n,relative:i,reloadDocument:a,replace:o,state:s,target:l,to:u,preventScrollReset:f,viewTransition:d}=t,h=IR(t,zR),{basename:p}=k.useContext(Ya),v,m=!1;if(typeof u=="string"&&KR.test(u)&&(v=u,HR))try{let x=new URL(window.location.href),S=u.startsWith("//")?new URL(x.protocol+u):new URL(u),w=zx(S.pathname,p);S.origin===x.origin&&w!=null?u=w+S.search+S.hash:m=!0}catch{}let y=gR(u,{relative:i}),b=GR(u,{replace:o,state:s,target:l,preventScrollReset:f,relative:i,viewTransition:d});function g(x){n&&n(x),x.defaultPrevented||b(x)}return k.createElement("a",ty({},h,{href:v||y,onClick:m||a?n:g,ref:r,target:l}))});var Ew;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Ew||(Ew={}));var Nw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Nw||(Nw={}));function GR(e,t){let{target:r,replace:n,state:i,preventScrollReset:a,relative:o,viewTransition:s}=t===void 0?{}:t,l=mt(),u=Vi(),f=Vk(e,{relative:o});return k.useCallback(d=>{if(FR(d,r)){d.preventDefault();let h=n!==void 0?n:Qf(u)===Qf(f);l(e,{replace:h,state:i,preventScrollReset:a,relative:o,viewTransition:s})}},[u,l,f,n,i,r,e,a,o,s])}function Ah(e){let t=k.useRef(ry(e)),r=k.useRef(!1),n=Vi(),i=k.useMemo(()=>BR(n.search,r.current?null:t.current),[n.search]),a=mt(),o=k.useCallback((s,l)=>{const u=ry(typeof s=="function"?s(i):s);r.current=!0,a("?"+u,l)},[a,i]);return[i,o]}/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var GR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var QR={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const QR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ze=(e,t)=>{const r=k.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>k.createElement("svg",{ref:f,...GR,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:["lucide",`lucide-${QR(e)}`,s].join(" "),...u},[...t.map(([d,h])=>k.createElement(d,h)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** + */const YR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Ze=(e,t)=>{const r=k.forwardRef(({color:n="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:s="",children:l,...u},f)=>k.createElement("svg",{ref:f,...QR,width:i,height:i,stroke:n,strokeWidth:o?Number(a)*24/Number(i):a,className:["lucide",`lucide-${YR(e)}`,s].join(" "),...u},[...t.map(([d,h])=>k.createElement(d,h)),...Array.isArray(l)?l:[l]]));return r.displayName=`${e}`,r};/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YR=Ze("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const XR=Ze("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. @@ -89,22 +89,22 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XR=Ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const ZR=Ze("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZR=Ze("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** + */const JR=Ze("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JR=Ze("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/** + */const eD=Ze("Calendar",[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",ry:"2",key:"eu3xkr"}],["line",{x1:"16",x2:"16",y1:"2",y2:"6",key:"m3sa8f"}],["line",{x1:"8",x2:"8",y1:"2",y2:"6",key:"18kwsl"}],["line",{x1:"3",x2:"21",y1:"10",y2:"10",key:"xt86sb"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eD=Ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const tD=Ze("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. @@ -119,12 +119,12 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tD=Ze("Code2",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** + */const rD=Ze("Code2",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rD=Ze("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const nD=Ze("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. @@ -134,37 +134,37 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nD=Ze("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** + */const iD=Ze("ExternalLink",[["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}],["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["line",{x1:"10",x2:"21",y1:"14",y2:"3",key:"18c3s4"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iD=Ze("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** + */const aD=Ze("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aD=Ze("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + */const oD=Ze("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oD=Ze("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/** + */const sD=Ze("GitCompare",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sD=Ze("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/** + */const lD=Ze("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Yk=Ze("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const Xk=Ze("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lD=Ze("Printer",[["polyline",{points:"6 9 6 2 18 2 18 9",key:"1306q4"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["rect",{width:"12",height:"8",x:"6",y:"14",key:"5ipwut"}]]);/** + */const uD=Ze("Printer",[["polyline",{points:"6 9 6 2 18 2 18 9",key:"1306q4"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["rect",{width:"12",height:"8",x:"6",y:"14",key:"5ipwut"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. @@ -174,19 +174,19 @@ Error generating stack: `+a.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uD=Ze("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const cD=Ze("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.294.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Xk=Ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Zk(e,t){return function(){return e.apply(t,arguments)}}const{toString:cD}=Object.prototype,{getPrototypeOf:Ux}=Object,{iterator:Nh,toStringTag:Jk}=Symbol,Th=(e=>t=>{const r=cD.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),rn=e=>(e=e.toLowerCase(),t=>Th(t)===e),$h=e=>t=>typeof t===e,{isArray:Ds}=Array,es=$h("undefined");function hc(e){return e!==null&&!es(e)&&e.constructor!==null&&!es(e.constructor)&&nr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const eA=rn("ArrayBuffer");function fD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&eA(e.buffer),t}const dD=$h("string"),nr=$h("function"),tA=$h("number"),pc=e=>e!==null&&typeof e=="object",hD=e=>e===!0||e===!1,bf=e=>{if(Th(e)!=="object")return!1;const t=Ux(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Jk in e)&&!(Nh in e)},pD=e=>{if(!pc(e)||hc(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},mD=rn("Date"),vD=rn("File"),yD=rn("Blob"),gD=rn("FileList"),xD=e=>pc(e)&&nr(e.pipe),bD=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||nr(e.append)&&((t=Th(e))==="formdata"||t==="object"&&nr(e.toString)&&e.toString()==="[object FormData]"))},wD=rn("URLSearchParams"),[SD,jD,OD,PD]=["ReadableStream","Request","Response","Headers"].map(rn),_D=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mc(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Ds(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const va=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,nA=e=>!es(e)&&e!==va;function ry(){const{caseless:e,skipUndefined:t}=nA(this)&&this||{},r={},n=(i,a)=>{const o=e&&rA(r,a)||a;bf(r[o])&&bf(i)?r[o]=ry(r[o],i):bf(i)?r[o]=ry({},i):Ds(i)?r[o]=i.slice():(!t||!es(i))&&(r[o]=i)};for(let i=0,a=arguments.length;i(mc(t,(i,a)=>{r&&nr(i)?e[a]=Zk(i,r):e[a]=i},{allOwnKeys:n}),e),AD=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ED=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},ND=(e,t,r,n)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=r!==!1&&Ux(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},TD=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},$D=e=>{if(!e)return null;if(Ds(e))return e;let t=e.length;if(!tA(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},CD=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Ux(Uint8Array)),MD=(e,t)=>{const n=(e&&e[Nh]).call(e);let i;for(;(i=n.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},RD=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},DD=rn("HTMLFormElement"),ID=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Nw=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),LD=rn("RegExp"),iA=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};mc(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},FD=e=>{iA(e,(t,r)=>{if(nr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(nr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},BD=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Ds(e)?n(e):n(String(e).split(t)),r},zD=()=>{},UD=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function qD(e){return!!(e&&nr(e.append)&&e[Jk]==="FormData"&&e[Nh])}const WD=e=>{const t=new Array(10),r=(n,i)=>{if(pc(n)){if(t.indexOf(n)>=0)return;if(hc(n))return n;if(!("toJSON"in n)){t[i]=n;const a=Ds(n)?[]:{};return mc(n,(o,s)=>{const l=r(o,i+1);!es(l)&&(a[s]=l)}),t[i]=void 0,a}}return n};return r(e,0)},HD=rn("AsyncFunction"),KD=e=>e&&(pc(e)||nr(e))&&nr(e.then)&&nr(e.catch),aA=((e,t)=>e?setImmediate:t?((r,n)=>(va.addEventListener("message",({source:i,data:a})=>{i===va&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),va.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",nr(va.postMessage)),VD=typeof queueMicrotask<"u"?queueMicrotask.bind(va):typeof process<"u"&&process.nextTick||aA,GD=e=>e!=null&&nr(e[Nh]),I={isArray:Ds,isArrayBuffer:eA,isBuffer:hc,isFormData:bD,isArrayBufferView:fD,isString:dD,isNumber:tA,isBoolean:hD,isObject:pc,isPlainObject:bf,isEmptyObject:pD,isReadableStream:SD,isRequest:jD,isResponse:OD,isHeaders:PD,isUndefined:es,isDate:mD,isFile:vD,isBlob:yD,isRegExp:LD,isFunction:nr,isStream:xD,isURLSearchParams:wD,isTypedArray:CD,isFileList:gD,forEach:mc,merge:ry,extend:kD,trim:_D,stripBOM:AD,inherits:ED,toFlatObject:ND,kindOf:Th,kindOfTest:rn,endsWith:TD,toArray:$D,forEachEntry:MD,matchAll:RD,isHTMLForm:DD,hasOwnProperty:Nw,hasOwnProp:Nw,reduceDescriptors:iA,freezeMethods:FD,toObjectSet:BD,toCamelCase:ID,noop:zD,toFiniteNumber:UD,findKey:rA,global:va,isContextDefined:nA,isSpecCompliantForm:qD,toJSONObject:WD,isAsyncFn:HD,isThenable:KD,setImmediate:aA,asap:VD,isIterable:GD};function ue(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}I.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.status}}});const oA=ue.prototype,sA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{sA[e]={value:e}});Object.defineProperties(ue,sA);Object.defineProperty(oA,"isAxiosError",{value:!0});ue.from=(e,t,r,n,i,a)=>{const o=Object.create(oA);I.toFlatObject(e,o,function(f){return f!==Error.prototype},u=>u!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return ue.call(o,s,l,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};const QD=null;function ny(e){return I.isPlainObject(e)||I.isArray(e)}function lA(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function Tw(e,t,r){return e?e.concat(t).map(function(i,a){return i=lA(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function YD(e){return I.isArray(e)&&!e.some(ny)}const XD=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function Ch(e,t,r){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=I.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!I.isUndefined(y[m])});const n=r.metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(I.isDate(v))return v.toISOString();if(I.isBoolean(v))return v.toString();if(!l&&I.isBlob(v))throw new ue("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(v)||I.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,m,y){let b=v;if(v&&!y&&typeof v=="object"){if(I.endsWith(m,"{}"))m=n?m:m.slice(0,-2),v=JSON.stringify(v);else if(I.isArray(v)&&YD(v)||(I.isFileList(v)||I.endsWith(m,"[]"))&&(b=I.toArray(v)))return m=lA(m),b.forEach(function(x,S){!(I.isUndefined(x)||x===null)&&t.append(o===!0?Tw([m],S,a):o===null?m:m+"[]",u(x))}),!1}return ny(v)?!0:(t.append(Tw(y,m,a),u(v)),!1)}const d=[],h=Object.assign(XD,{defaultVisitor:f,convertValue:u,isVisitable:ny});function p(v,m){if(!I.isUndefined(v)){if(d.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(v),I.forEach(v,function(b,g){(!(I.isUndefined(b)||b===null)&&i.call(t,b,I.isString(g)?g.trim():g,m,h))===!0&&p(b,m?m.concat(g):[g])}),d.pop()}}if(!I.isObject(e))throw new TypeError("data must be an object");return p(e),t}function $w(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function qx(e,t){this._pairs=[],e&&Ch(e,this,t)}const uA=qx.prototype;uA.append=function(t,r){this._pairs.push([t,r])};uA.toString=function(t){const r=t?function(n){return t.call(this,n,$w)}:$w;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function ZD(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function cA(e,t,r){if(!t)return e;const n=r&&r.encode||ZD;I.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let a;if(i?a=i(t,r):a=I.isURLSearchParams(t)?t.toString():new qx(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Cw{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){I.forEach(this.handlers,function(n){n!==null&&t(n)})}}const fA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},JD=typeof URLSearchParams<"u"?URLSearchParams:qx,eI=typeof FormData<"u"?FormData:null,tI=typeof Blob<"u"?Blob:null,rI={isBrowser:!0,classes:{URLSearchParams:JD,FormData:eI,Blob:tI},protocols:["http","https","file","blob","url","data"]},Wx=typeof window<"u"&&typeof document<"u",iy=typeof navigator=="object"&&navigator||void 0,nI=Wx&&(!iy||["ReactNative","NativeScript","NS"].indexOf(iy.product)<0),iI=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",aI=Wx&&window.location.href||"http://localhost",oI=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wx,hasStandardBrowserEnv:nI,hasStandardBrowserWebWorkerEnv:iI,navigator:iy,origin:aI},Symbol.toStringTag,{value:"Module"})),Mt={...oI,...rI};function sI(e,t){return Ch(e,new Mt.classes.URLSearchParams,{visitor:function(r,n,i,a){return Mt.isNode&&I.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function lI(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function uI(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n=r.length;return o=!o&&I.isArray(i)?i.length:o,l?(I.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!I.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&I.isArray(i[o])&&(i[o]=uI(i[o])),!s)}if(I.isFormData(e)&&I.isFunction(e.entries)){const r={};return I.forEachEntry(e,(n,i)=>{t(lI(n),i,r,0)}),r}return null}function cI(e,t,r){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const vc={transitional:fA,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=I.isObject(t);if(a&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return i?JSON.stringify(dA(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return sI(t,this.formSerializer).toString();if((s=I.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ch(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),cI(t)):t}],transformResponse:[function(t){const r=this.transitional||vc.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(s){if(o)throw s.name==="SyntaxError"?ue.from(s,ue.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],e=>{vc.headers[e]={}});const fI=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),dI=e=>{const t={};let r,n,i;return e&&e.split(` -`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&fI[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Mw=Symbol("internals");function fl(e){return e&&String(e).trim().toLowerCase()}function wf(e){return e===!1||e==null?e:I.isArray(e)?e.map(wf):String(e)}function hI(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const pI=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sm(e,t,r,n,i){if(I.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!I.isString(t)){if(I.isString(n))return t.indexOf(n)!==-1;if(I.isRegExp(n))return n.test(t)}}function mI(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function vI(e,t){const r=I.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}let ir=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(s,l,u){const f=fl(l);if(!f)throw new Error("header name must be a non-empty string");const d=I.findKey(i,f);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=wf(s))}const o=(s,l)=>I.forEach(s,(u,f)=>a(u,f,l));if(I.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(I.isString(t)&&(t=t.trim())&&!pI(t))o(dI(t),r);else if(I.isObject(t)&&I.isIterable(t)){let s={},l,u;for(const f of t){if(!I.isArray(f))throw TypeError("Object iterator must return a key-value pair");s[u=f[0]]=(l=s[u])?I.isArray(l)?[...l,f[1]]:[l,f[1]]:f[1]}o(s,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=fl(t),t){const n=I.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return hI(i);if(I.isFunction(r))return r.call(this,i,n);if(I.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=fl(t),t){const n=I.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||sm(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(o){if(o=fl(o),o){const s=I.findKey(n,o);s&&(!r||sm(n,n[s],s,r))&&(delete n[s],i=!0)}}return I.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||sm(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return I.forEach(this,(i,a)=>{const o=I.findKey(n,a);if(o){r[o]=wf(i),delete r[a];return}const s=t?mI(a):String(a).trim();s!==a&&delete r[a],r[s]=wf(i),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return I.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&I.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` -`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Mw]=this[Mw]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=fl(o);n[s]||(vI(i,o),n[s]=!0)}return I.isArray(t)?t.forEach(a):a(t),this}};ir.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(ir.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});I.freezeMethods(ir);function lm(e,t){const r=this||vc,n=t||r,i=ir.from(n.headers);let a=n.data;return I.forEach(e,function(s){a=s.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function hA(e){return!!(e&&e.__CANCEL__)}function Is(e,t,r){ue.call(this,e??"canceled",ue.ERR_CANCELED,t,r),this.name="CanceledError"}I.inherits(Is,ue,{__CANCEL__:!0});function pA(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ue("Request failed with status code "+r.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function yI(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function gI(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),f=n[a];o||(o=u),r[i]=l,n[i]=u;let d=a,h=0;for(;d!==i;)h+=r[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o{r=f,i=null,a&&(clearTimeout(a),a=null),e(...u)};return[(...u)=>{const f=Date.now(),d=f-r;d>=n?o(u,f):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-d)))},()=>i&&o(i)]}const Xf=(e,t,r=3)=>{let n=0;const i=gI(50,250);return xI(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,l=o-n,u=i(l),f=o<=s;n=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&f?(s-o)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},r)},Rw=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Dw=e=>(...t)=>I.asap(()=>e(...t)),bI=Mt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Mt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,wI=Mt.hasStandardBrowserEnv?{write(e,t,r,n,i,a,o){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];I.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),I.isString(n)&&s.push(`path=${n}`),I.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push("secure"),I.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function SI(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function jI(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mA(e,t,r){let n=!SI(t);return e&&(n||r==!1)?jI(e,t):t}const Iw=e=>e instanceof ir?{...e}:e;function Ua(e,t){t=t||{};const r={};function n(u,f,d,h){return I.isPlainObject(u)&&I.isPlainObject(f)?I.merge.call({caseless:h},u,f):I.isPlainObject(f)?I.merge({},f):I.isArray(f)?f.slice():f}function i(u,f,d,h){if(I.isUndefined(f)){if(!I.isUndefined(u))return n(void 0,u,d,h)}else return n(u,f,d,h)}function a(u,f){if(!I.isUndefined(f))return n(void 0,f)}function o(u,f){if(I.isUndefined(f)){if(!I.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function s(u,f,d){if(d in t)return n(u,f);if(d in e)return n(void 0,u)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,f,d)=>i(Iw(u),Iw(f),d,!0)};return I.forEach(Object.keys({...e,...t}),function(f){const d=l[f]||i,h=d(e[f],t[f],f);I.isUndefined(h)&&d!==s||(r[f]=h)}),r}const vA=e=>{const t=Ua({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=ir.from(o),t.url=cA(mA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),I.isFormData(r)){if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(I.isFunction(r.getHeaders)){const l=r.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([f,d])=>{u.includes(f.toLowerCase())&&o.set(f,d)})}}if(Mt.hasStandardBrowserEnv&&(n&&I.isFunction(n)&&(n=n(t)),n||n!==!1&&bI(t.url))){const l=i&&a&&wI.read(a);l&&o.set(i,l)}return t},OI=typeof XMLHttpRequest<"u",PI=OI&&function(e){return new Promise(function(r,n){const i=vA(e);let a=i.data;const o=ir.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,f,d,h,p,v;function m(){p&&p(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function b(){if(!y)return;const x=ir.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:e,request:y};pA(function(O){r(O),m()},function(O){n(O),m()},w),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(n(new ue("Request aborted",ue.ECONNABORTED,e,y)),y=null)},y.onerror=function(S){const w=S&&S.message?S.message:"Network Error",j=new ue(w,ue.ERR_NETWORK,e,y);j.event=S||null,n(j),y=null},y.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||fA;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),n(new ue(S,w.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,e,y)),y=null},a===void 0&&o.setContentType(null),"setRequestHeader"in y&&I.forEach(o.toJSON(),function(S,w){y.setRequestHeader(w,S)}),I.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),s&&s!=="json"&&(y.responseType=i.responseType),u&&([h,v]=Xf(u,!0),y.addEventListener("progress",h)),l&&y.upload&&([d,p]=Xf(l),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(f=x=>{y&&(n(!x||x.type?new Is(null,e,y):x),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const g=yI(i.url);if(g&&Mt.protocols.indexOf(g)===-1){n(new ue("Unsupported protocol "+g+":",ue.ERR_BAD_REQUEST,e));return}y.send(a||null)})},_I=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const a=function(u){if(!i){i=!0,s();const f=u instanceof Error?u:this.reason;n.abort(f instanceof ue?f:new Is(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,a(new ue(`timeout ${t} of ms exceeded`,ue.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:l}=n;return l.unsubscribe=()=>I.asap(s),l}},kI=function*(e,t){let r=e.byteLength;if(r{const i=AI(e,t);let a=0,o,s=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:f}=await i.next();if(u){s(),l.close();return}let d=f.byteLength;if(r){let h=a+=d;r(h)}l.enqueue(new Uint8Array(f))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},Fw=64*1024,{isFunction:Hc}=I,NI=(({Request:e,Response:t})=>({Request:e,Response:t}))(I.global),{ReadableStream:Bw,TextEncoder:zw}=I.global,Uw=(e,...t)=>{try{return!!e(...t)}catch{return!1}},TI=e=>{e=I.merge.call({skipUndefined:!0},NI,e);const{fetch:t,Request:r,Response:n}=e,i=t?Hc(t):typeof fetch=="function",a=Hc(r),o=Hc(n);if(!i)return!1;const s=i&&Hc(Bw),l=i&&(typeof zw=="function"?(v=>m=>v.encode(m))(new zw):async v=>new Uint8Array(await new r(v).arrayBuffer())),u=a&&s&&Uw(()=>{let v=!1;const m=new r(Mt.origin,{body:new Bw,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!m}),f=o&&s&&Uw(()=>I.isReadableStream(new n("").body)),d={stream:f&&(v=>v.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!d[v]&&(d[v]=(m,y)=>{let b=m&&m[v];if(b)return b.call(m);throw new ue(`Response type '${v}' is not supported`,ue.ERR_NOT_SUPPORT,y)})});const h=async v=>{if(v==null)return 0;if(I.isBlob(v))return v.size;if(I.isSpecCompliantForm(v))return(await new r(Mt.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(I.isArrayBufferView(v)||I.isArrayBuffer(v))return v.byteLength;if(I.isURLSearchParams(v)&&(v=v+""),I.isString(v))return(await l(v)).byteLength},p=async(v,m)=>{const y=I.toFiniteNumber(v.getContentLength());return y??h(m)};return async v=>{let{url:m,method:y,data:b,signal:g,cancelToken:x,timeout:S,onDownloadProgress:w,onUploadProgress:j,responseType:O,headers:P,withCredentials:A="same-origin",fetchOptions:E}=vA(v),N=t||fetch;O=O?(O+"").toLowerCase():"text";let T=_I([g,x&&x.toAbortSignal()],S),M=null;const R=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let D;try{if(j&&u&&y!=="get"&&y!=="head"&&(D=await p(P,b))!==0){let G=new r(m,{method:"POST",body:b,duplex:"half"}),q;if(I.isFormData(b)&&(q=G.headers.get("content-type"))&&P.setContentType(q),G.body){const[ee,ce]=Rw(D,Xf(Dw(j)));b=Lw(G.body,Fw,ee,ce)}}I.isString(A)||(A=A?"include":"omit");const L=a&&"credentials"in r.prototype,z={...E,signal:T,method:y.toUpperCase(),headers:P.normalize().toJSON(),body:b,duplex:"half",credentials:L?A:void 0};M=a&&new r(m,z);let C=await(a?N(M,E):N(m,z));const B=f&&(O==="stream"||O==="response");if(f&&(w||B&&R)){const G={};["status","statusText","headers"].forEach(V=>{G[V]=C[V]});const q=I.toFiniteNumber(C.headers.get("content-length")),[ee,ce]=w&&Rw(q,Xf(Dw(w),!0))||[];C=new n(Lw(C.body,Fw,ee,()=>{ce&&ce(),R&&R()}),G)}O=O||"text";let U=await d[I.findKey(d,O)||"text"](C,v);return!B&&R&&R(),await new Promise((G,q)=>{pA(G,q,{data:U,headers:ir.from(C.headers),status:C.status,statusText:C.statusText,config:v,request:M})})}catch(L){throw R&&R(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,v,M),{cause:L.cause||L}):ue.from(L,L&&L.code,v,M)}}},$I=new Map,yA=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,a=[n,i,r];let o=a.length,s=o,l,u,f=$I;for(;s--;)l=a[s],u=f.get(l),u===void 0&&f.set(l,u=s?new Map:TI(t)),f=u;return u};yA();const Hx={http:QD,xhr:PI,fetch:{get:yA}};I.forEach(Hx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const qw=e=>`- ${e}`,CI=e=>I.isFunction(e)||e===null||e===!1;function MI(e,t){e=I.isArray(e)?e:[e];const{length:r}=e;let n,i;const a={};for(let o=0;o`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=r?o.length>1?`since : -`+o.map(qw).join(` -`):" "+qw(o[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const gA={getAdapter:MI,adapters:Hx};function um(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Is(null,e)}function Ww(e){return um(e),e.headers=ir.from(e.headers),e.data=lm.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),gA.getAdapter(e.adapter||vc.adapter,e)(e).then(function(n){return um(e),n.data=lm.call(e,e.transformResponse,n),n.headers=ir.from(n.headers),n},function(n){return hA(n)||(um(e),n&&n.response&&(n.response.data=lm.call(e,e.transformResponse,n.response),n.response.headers=ir.from(n.response.headers))),Promise.reject(n)})}const xA="1.13.2",Mh={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Mh[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Hw={};Mh.transitional=function(t,r,n){function i(a,o){return"[Axios v"+xA+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(t===!1)throw new ue(i(o," has been removed"+(r?" in "+r:"")),ue.ERR_DEPRECATED);return r&&!Hw[o]&&(Hw[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,o,s):!0}};Mh.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function RI(e,t,r){if(typeof e!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const s=e[a],l=s===void 0||o(s,a,e);if(l!==!0)throw new ue("option "+a+" must be "+l,ue.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ue("Unknown option "+a,ue.ERR_BAD_OPTION)}}const Sf={assertOptions:RI,validators:Mh},sn=Sf.validators;let Ca=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Cw,response:new Cw}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` -`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ua(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&Sf.assertOptions(n,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean)},!1),i!=null&&(I.isFunction(i)?r.paramsSerializer={serialize:i}:Sf.assertOptions(i,{encode:sn.function,serialize:sn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Sf.assertOptions(r,{baseUrl:sn.spelling("baseURL"),withXsrfToken:sn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=a&&I.merge(a.common,a[r.method]);a&&I.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),r.headers=ir.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(l=l&&m.synchronous,s.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let f,d=0,h;if(!l){const v=[Ww.bind(this),void 0];for(v.unshift(...s),v.push(...u),h=v.length,f=Promise.resolve(r);d{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},t(function(a,o,s){n.reason||(n.reason=new Is(a,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new bA(function(i){t=i}),cancel:t}}};function II(e){return function(r){return e.apply(null,r)}}function LI(e){return I.isObject(e)&&e.isAxiosError===!0}const ay={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ay).forEach(([e,t])=>{ay[t]=e});function wA(e){const t=new Ca(e),r=Zk(Ca.prototype.request,t);return I.extend(r,Ca.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return wA(Ua(e,i))},r}const Xe=wA(vc);Xe.Axios=Ca;Xe.CanceledError=Is;Xe.CancelToken=DI;Xe.isCancel=hA;Xe.VERSION=xA;Xe.toFormData=Ch;Xe.AxiosError=ue;Xe.Cancel=Xe.CanceledError;Xe.all=function(t){return Promise.all(t)};Xe.spread=II;Xe.isAxiosError=LI;Xe.mergeConfig=Ua;Xe.AxiosHeaders=ir;Xe.formToJSON=e=>dA(I.isHTMLForm(e)?new FormData(e):e);Xe.getAdapter=gA.getAdapter;Xe.HttpStatusCode=ay;Xe.default=Xe;const{Axios:Mle,AxiosError:Rle,CanceledError:Dle,isCancel:Ile,CancelToken:Lle,VERSION:Fle,all:Ble,Cancel:zle,isAxiosError:Ule,spread:qle,toFormData:Wle,AxiosHeaders:Hle,HttpStatusCode:Kle,formToJSON:Vle,getAdapter:Gle,mergeConfig:Qle}=Xe,ni=Xe.create({baseURL:"/api",headers:{"Content-Type":"application/json"}}),Ye={getRuns:async e=>{const t={};return e!=null&&e.project&&(t.project=e.project),e!=null&&e.provider&&(t.provider=e.provider),e!=null&&e.status&&(t.status=e.status),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),e!=null&&e.algorithm&&(t.algorithm=e.algorithm),e!=null&&e.limit&&(t.limit=e.limit),console.log("API params:",JSON.stringify(t,null,2)),(await ni.get("/runs",{params:t})).data},getAlgorithms:async()=>(await ni.get("/algorithms")).data.algorithms||[],getRun:async(e,t)=>{try{const[r,n]=await Promise.all([ni.get(`/runs/${e}/${t}/event`),ni.get(`/runs/${e}/${t}/analysis`)]);return{event:r.data,analysis:n.data}}catch{const[n,i]=await Promise.all([ni.get(`/runs/${t}`),ni.get(`/runs/${t}/analysis`)]);return{event:n.data,analysis:i.data}}},health:async()=>(await ni.get("/health")).data,getSettings:async()=>(await ni.get("/settings")).data};function FI({onDateRangeChange:e,initialStartDate:t,initialEndDate:r}){const[n,i]=k.useState(!0),[a,o]=k.useState(t||""),[s,l]=k.useState(r||""),u=k.useRef(null);k.useEffect(()=>{t!==void 0&&o(t),r!==void 0&&l(r)},[t,r]),k.useEffect(()=>{const p=v=>{u.current&&!u.current.contains(v.target)&&i(!1)};if(n)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const f=()=>{a&&s?new Date(s)>=new Date(a)?(e==null||e(a,s),i(!1)):alert("End date must be after start date"):(a||s)&&alert("Please select both start and end dates")},d=()=>{o(""),l(""),e==null||e(void 0,void 0),i(!1)},h=new Date().toISOString().split("T")[0];return c.jsxs("div",{className:"relative",ref:u,children:[c.jsxs("button",{onClick:()=>i(!n),className:"bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm flex items-center gap-2 hover:border-primary/50 transition-colors",children:[c.jsx(JR,{size:16}),a&&s?c.jsxs("span",{className:"text-xs",children:[new Date(a).toLocaleDateString()," - ",new Date(s).toLocaleDateString()]}):c.jsx("span",{children:"Select Dates"})]}),n&&c.jsxs("div",{className:"absolute top-full mt-2 right-0 bg-dark-surface border border-dark-border rounded-lg p-4 shadow-xl z-50 min-w-[320px]",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-sm font-semibold text-white",children:"Select Date Range"}),c.jsx("button",{onClick:()=>i(!1),className:"text-dark-text-muted hover:text-dark-text transition-colors",children:c.jsx(Xk,{size:18})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:"Start Date"}),c.jsx("input",{type:"date",value:a,onChange:p=>o(p.target.value),max:s||h,className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50 transition-colors"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:"End Date"}),c.jsx("input",{type:"date",value:s,onChange:p=>l(p.target.value),min:a||void 0,max:h,className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50 transition-colors"})]}),c.jsxs("div",{className:"flex gap-2 pt-2",children:[c.jsx("button",{onClick:f,className:"flex-1 bg-primary hover:bg-primary/90 text-white text-sm py-2 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!a||!s,children:"Apply"}),c.jsx("button",{onClick:d,className:"px-4 py-2 bg-dark-bg border border-dark-border hover:bg-dark-bg/80 text-dark-text text-sm rounded-lg transition-colors",children:"Clear"})]})]})]})]})}function SA(e,t){if(e.length===0){alert("No data to export");return}const r=Object.keys(e[0]),n=[r.join(","),...e.map(s=>r.map(l=>{const u=s[l];if(u==null)return"";const f=String(u);return f.includes(",")||f.includes('"')||f.includes(` + */const Zk=Ze("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Jk(e,t){return function(){return e.apply(t,arguments)}}const{toString:fD}=Object.prototype,{getPrototypeOf:qx}=Object,{iterator:Nh,toStringTag:eA}=Symbol,Th=(e=>t=>{const r=fD.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),rn=e=>(e=e.toLowerCase(),t=>Th(t)===e),$h=e=>t=>typeof t===e,{isArray:Ds}=Array,es=$h("undefined");function hc(e){return e!==null&&!es(e)&&e.constructor!==null&&!es(e.constructor)&&nr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tA=rn("ArrayBuffer");function dD(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&tA(e.buffer),t}const hD=$h("string"),nr=$h("function"),rA=$h("number"),pc=e=>e!==null&&typeof e=="object",pD=e=>e===!0||e===!1,bf=e=>{if(Th(e)!=="object")return!1;const t=qx(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(eA in e)&&!(Nh in e)},mD=e=>{if(!pc(e)||hc(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},vD=rn("Date"),yD=rn("File"),gD=rn("Blob"),xD=rn("FileList"),bD=e=>pc(e)&&nr(e.pipe),wD=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||nr(e.append)&&((t=Th(e))==="formdata"||t==="object"&&nr(e.toString)&&e.toString()==="[object FormData]"))},SD=rn("URLSearchParams"),[jD,OD,PD,_D]=["ReadableStream","Request","Response","Headers"].map(rn),kD=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function mc(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let n,i;if(typeof e!="object"&&(e=[e]),Ds(e))for(n=0,i=e.length;n0;)if(i=r[n],t===i.toLowerCase())return i;return null}const va=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,iA=e=>!es(e)&&e!==va;function ny(){const{caseless:e,skipUndefined:t}=iA(this)&&this||{},r={},n=(i,a)=>{const o=e&&nA(r,a)||a;bf(r[o])&&bf(i)?r[o]=ny(r[o],i):bf(i)?r[o]=ny({},i):Ds(i)?r[o]=i.slice():(!t||!es(i))&&(r[o]=i)};for(let i=0,a=arguments.length;i(mc(t,(i,a)=>{r&&nr(i)?e[a]=Jk(i,r):e[a]=i},{allOwnKeys:n}),e),ED=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),ND=(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},TD=(e,t,r,n)=>{let i,a,o;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],(!n||n(o,e,t))&&!s[o]&&(t[o]=e[o],s[o]=!0);e=r!==!1&&qx(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},$D=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return n!==-1&&n===r},CD=e=>{if(!e)return null;if(Ds(e))return e;let t=e.length;if(!rA(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},MD=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&qx(Uint8Array)),RD=(e,t)=>{const n=(e&&e[Nh]).call(e);let i;for(;(i=n.next())&&!i.done;){const a=i.value;t.call(e,a[0],a[1])}},DD=(e,t)=>{let r;const n=[];for(;(r=e.exec(t))!==null;)n.push(r);return n},ID=rn("HTMLFormElement"),LD=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,n,i){return n.toUpperCase()+i}),Tw=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),FD=rn("RegExp"),aA=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};mc(r,(i,a)=>{let o;(o=t(i,a,e))!==!1&&(n[a]=o||i)}),Object.defineProperties(e,n)},BD=e=>{aA(e,(t,r)=>{if(nr(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;const n=e[r];if(nr(n)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},zD=(e,t)=>{const r={},n=i=>{i.forEach(a=>{r[a]=!0})};return Ds(e)?n(e):n(String(e).split(t)),r},UD=()=>{},qD=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function WD(e){return!!(e&&nr(e.append)&&e[eA]==="FormData"&&e[Nh])}const HD=e=>{const t=new Array(10),r=(n,i)=>{if(pc(n)){if(t.indexOf(n)>=0)return;if(hc(n))return n;if(!("toJSON"in n)){t[i]=n;const a=Ds(n)?[]:{};return mc(n,(o,s)=>{const l=r(o,i+1);!es(l)&&(a[s]=l)}),t[i]=void 0,a}}return n};return r(e,0)},KD=rn("AsyncFunction"),VD=e=>e&&(pc(e)||nr(e))&&nr(e.then)&&nr(e.catch),oA=((e,t)=>e?setImmediate:t?((r,n)=>(va.addEventListener("message",({source:i,data:a})=>{i===va&&a===r&&n.length&&n.shift()()},!1),i=>{n.push(i),va.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",nr(va.postMessage)),GD=typeof queueMicrotask<"u"?queueMicrotask.bind(va):typeof process<"u"&&process.nextTick||oA,QD=e=>e!=null&&nr(e[Nh]),I={isArray:Ds,isArrayBuffer:tA,isBuffer:hc,isFormData:wD,isArrayBufferView:dD,isString:hD,isNumber:rA,isBoolean:pD,isObject:pc,isPlainObject:bf,isEmptyObject:mD,isReadableStream:jD,isRequest:OD,isResponse:PD,isHeaders:_D,isUndefined:es,isDate:vD,isFile:yD,isBlob:gD,isRegExp:FD,isFunction:nr,isStream:bD,isURLSearchParams:SD,isTypedArray:MD,isFileList:xD,forEach:mc,merge:ny,extend:AD,trim:kD,stripBOM:ED,inherits:ND,toFlatObject:TD,kindOf:Th,kindOfTest:rn,endsWith:$D,toArray:CD,forEachEntry:RD,matchAll:DD,isHTMLForm:ID,hasOwnProperty:Tw,hasOwnProp:Tw,reduceDescriptors:aA,freezeMethods:BD,toObjectSet:zD,toCamelCase:LD,noop:UD,toFiniteNumber:qD,findKey:nA,global:va,isContextDefined:iA,isSpecCompliantForm:WD,toJSONObject:HD,isAsyncFn:KD,isThenable:VD,setImmediate:oA,asap:GD,isIterable:QD};function ue(e,t,r,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}I.inherits(ue,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.status}}});const sA=ue.prototype,lA={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{lA[e]={value:e}});Object.defineProperties(ue,lA);Object.defineProperty(sA,"isAxiosError",{value:!0});ue.from=(e,t,r,n,i,a)=>{const o=Object.create(sA);I.toFlatObject(e,o,function(f){return f!==Error.prototype},u=>u!=="isAxiosError");const s=e&&e.message?e.message:"Error",l=t==null&&e?e.code:t;return ue.call(o,s,l,r,n,i),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",a&&Object.assign(o,a),o};const YD=null;function iy(e){return I.isPlainObject(e)||I.isArray(e)}function uA(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function $w(e,t,r){return e?e.concat(t).map(function(i,a){return i=uA(i),!r&&a?"["+i+"]":i}).join(r?".":""):t}function XD(e){return I.isArray(e)&&!e.some(iy)}const ZD=I.toFlatObject(I,{},null,function(t){return/^is[A-Z]/.test(t)});function Ch(e,t,r){if(!I.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,r=I.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(m,y){return!I.isUndefined(y[m])});const n=r.metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,l=(r.Blob||typeof Blob<"u"&&Blob)&&I.isSpecCompliantForm(t);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function u(v){if(v===null)return"";if(I.isDate(v))return v.toISOString();if(I.isBoolean(v))return v.toString();if(!l&&I.isBlob(v))throw new ue("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(v)||I.isTypedArray(v)?l&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function f(v,m,y){let b=v;if(v&&!y&&typeof v=="object"){if(I.endsWith(m,"{}"))m=n?m:m.slice(0,-2),v=JSON.stringify(v);else if(I.isArray(v)&&XD(v)||(I.isFileList(v)||I.endsWith(m,"[]"))&&(b=I.toArray(v)))return m=uA(m),b.forEach(function(x,S){!(I.isUndefined(x)||x===null)&&t.append(o===!0?$w([m],S,a):o===null?m:m+"[]",u(x))}),!1}return iy(v)?!0:(t.append($w(y,m,a),u(v)),!1)}const d=[],h=Object.assign(ZD,{defaultVisitor:f,convertValue:u,isVisitable:iy});function p(v,m){if(!I.isUndefined(v)){if(d.indexOf(v)!==-1)throw Error("Circular reference detected in "+m.join("."));d.push(v),I.forEach(v,function(b,g){(!(I.isUndefined(b)||b===null)&&i.call(t,b,I.isString(g)?g.trim():g,m,h))===!0&&p(b,m?m.concat(g):[g])}),d.pop()}}if(!I.isObject(e))throw new TypeError("data must be an object");return p(e),t}function Cw(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(n){return t[n]})}function Wx(e,t){this._pairs=[],e&&Ch(e,this,t)}const cA=Wx.prototype;cA.append=function(t,r){this._pairs.push([t,r])};cA.toString=function(t){const r=t?function(n){return t.call(this,n,Cw)}:Cw;return this._pairs.map(function(i){return r(i[0])+"="+r(i[1])},"").join("&")};function JD(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function fA(e,t,r){if(!t)return e;const n=r&&r.encode||JD;I.isFunction(r)&&(r={serialize:r});const i=r&&r.serialize;let a;if(i?a=i(t,r):a=I.isURLSearchParams(t)?t.toString():new Wx(t,r).toString(n),a){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Mw{constructor(){this.handlers=[]}use(t,r,n){return this.handlers.push({fulfilled:t,rejected:r,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){I.forEach(this.handlers,function(n){n!==null&&t(n)})}}const dA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eI=typeof URLSearchParams<"u"?URLSearchParams:Wx,tI=typeof FormData<"u"?FormData:null,rI=typeof Blob<"u"?Blob:null,nI={isBrowser:!0,classes:{URLSearchParams:eI,FormData:tI,Blob:rI},protocols:["http","https","file","blob","url","data"]},Hx=typeof window<"u"&&typeof document<"u",ay=typeof navigator=="object"&&navigator||void 0,iI=Hx&&(!ay||["ReactNative","NativeScript","NS"].indexOf(ay.product)<0),aI=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",oI=Hx&&window.location.href||"http://localhost",sI=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Hx,hasStandardBrowserEnv:iI,hasStandardBrowserWebWorkerEnv:aI,navigator:ay,origin:oI},Symbol.toStringTag,{value:"Module"})),Mt={...sI,...nI};function lI(e,t){return Ch(e,new Mt.classes.URLSearchParams,{visitor:function(r,n,i,a){return Mt.isNode&&I.isBuffer(r)?(this.append(n,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)},...t})}function uI(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function cI(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n=r.length;return o=!o&&I.isArray(i)?i.length:o,l?(I.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!I.isObject(i[o]))&&(i[o]=[]),t(r,n,i[o],a)&&I.isArray(i[o])&&(i[o]=cI(i[o])),!s)}if(I.isFormData(e)&&I.isFunction(e.entries)){const r={};return I.forEachEntry(e,(n,i)=>{t(uI(n),i,r,0)}),r}return null}function fI(e,t,r){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(e)}const vc={transitional:dA,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){const n=r.getContentType()||"",i=n.indexOf("application/json")>-1,a=I.isObject(t);if(a&&I.isHTMLForm(t)&&(t=new FormData(t)),I.isFormData(t))return i?JSON.stringify(hA(t)):t;if(I.isArrayBuffer(t)||I.isBuffer(t)||I.isStream(t)||I.isFile(t)||I.isBlob(t)||I.isReadableStream(t))return t;if(I.isArrayBufferView(t))return t.buffer;if(I.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return lI(t,this.formSerializer).toString();if((s=I.isFileList(t))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Ch(s?{"files[]":t}:t,l&&new l,this.formSerializer)}}return a||i?(r.setContentType("application/json",!1),fI(t)):t}],transformResponse:[function(t){const r=this.transitional||vc.transitional,n=r&&r.forcedJSONParsing,i=this.responseType==="json";if(I.isResponse(t)||I.isReadableStream(t))return t;if(t&&I.isString(t)&&(n&&!this.responseType||i)){const o=!(r&&r.silentJSONParsing)&&i;try{return JSON.parse(t,this.parseReviver)}catch(s){if(o)throw s.name==="SyntaxError"?ue.from(s,ue.ERR_BAD_RESPONSE,this,null,this.response):s}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};I.forEach(["delete","get","head","post","put","patch"],e=>{vc.headers[e]={}});const dI=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),hI=e=>{const t={};let r,n,i;return e&&e.split(` +`).forEach(function(o){i=o.indexOf(":"),r=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!r||t[r]&&dI[r])&&(r==="set-cookie"?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)}),t},Rw=Symbol("internals");function fl(e){return e&&String(e).trim().toLowerCase()}function wf(e){return e===!1||e==null?e:I.isArray(e)?e.map(wf):String(e)}function pI(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}const mI=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function sm(e,t,r,n,i){if(I.isFunction(n))return n.call(this,t,r);if(i&&(t=r),!!I.isString(t)){if(I.isString(n))return t.indexOf(n)!==-1;if(I.isRegExp(n))return n.test(t)}}function vI(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,n)=>r.toUpperCase()+n)}function yI(e,t){const r=I.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(i,a,o){return this[n].call(this,t,i,a,o)},configurable:!0})})}let ir=class{constructor(t){t&&this.set(t)}set(t,r,n){const i=this;function a(s,l,u){const f=fl(l);if(!f)throw new Error("header name must be a non-empty string");const d=I.findKey(i,f);(!d||i[d]===void 0||u===!0||u===void 0&&i[d]!==!1)&&(i[d||l]=wf(s))}const o=(s,l)=>I.forEach(s,(u,f)=>a(u,f,l));if(I.isPlainObject(t)||t instanceof this.constructor)o(t,r);else if(I.isString(t)&&(t=t.trim())&&!mI(t))o(hI(t),r);else if(I.isObject(t)&&I.isIterable(t)){let s={},l,u;for(const f of t){if(!I.isArray(f))throw TypeError("Object iterator must return a key-value pair");s[u=f[0]]=(l=s[u])?I.isArray(l)?[...l,f[1]]:[l,f[1]]:f[1]}o(s,r)}else t!=null&&a(r,t,n);return this}get(t,r){if(t=fl(t),t){const n=I.findKey(this,t);if(n){const i=this[n];if(!r)return i;if(r===!0)return pI(i);if(I.isFunction(r))return r.call(this,i,n);if(I.isRegExp(r))return r.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=fl(t),t){const n=I.findKey(this,t);return!!(n&&this[n]!==void 0&&(!r||sm(this,this[n],n,r)))}return!1}delete(t,r){const n=this;let i=!1;function a(o){if(o=fl(o),o){const s=I.findKey(n,o);s&&(!r||sm(n,n[s],s,r))&&(delete n[s],i=!0)}}return I.isArray(t)?t.forEach(a):a(t),i}clear(t){const r=Object.keys(this);let n=r.length,i=!1;for(;n--;){const a=r[n];(!t||sm(this,this[a],a,t,!0))&&(delete this[a],i=!0)}return i}normalize(t){const r=this,n={};return I.forEach(this,(i,a)=>{const o=I.findKey(n,a);if(o){r[o]=wf(i),delete r[a];return}const s=t?vI(a):String(a).trim();s!==a&&delete r[a],r[s]=wf(i),n[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const r=Object.create(null);return I.forEach(this,(n,i)=>{n!=null&&n!==!1&&(r[i]=t&&I.isArray(n)?n.join(", "):n)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(i=>n.set(i)),n}static accessor(t){const n=(this[Rw]=this[Rw]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=fl(o);n[s]||(yI(i,o),n[s]=!0)}return I.isArray(t)?t.forEach(a):a(t),this}};ir.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);I.reduceDescriptors(ir.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}});I.freezeMethods(ir);function lm(e,t){const r=this||vc,n=t||r,i=ir.from(n.headers);let a=n.data;return I.forEach(e,function(s){a=s.call(r,a,i.normalize(),t?t.status:void 0)}),i.normalize(),a}function pA(e){return!!(e&&e.__CANCEL__)}function Is(e,t,r){ue.call(this,e??"canceled",ue.ERR_CANCELED,t,r),this.name="CanceledError"}I.inherits(Is,ue,{__CANCEL__:!0});function mA(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new ue("Request failed with status code "+r.status,[ue.ERR_BAD_REQUEST,ue.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function gI(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function xI(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i=0,a=0,o;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),f=n[a];o||(o=u),r[i]=l,n[i]=u;let d=a,h=0;for(;d!==i;)h+=r[d++],d=d%e;if(i=(i+1)%e,i===a&&(a=(a+1)%e),u-o{r=f,i=null,a&&(clearTimeout(a),a=null),e(...u)};return[(...u)=>{const f=Date.now(),d=f-r;d>=n?o(u,f):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-d)))},()=>i&&o(i)]}const Xf=(e,t,r=3)=>{let n=0;const i=xI(50,250);return bI(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,l=o-n,u=i(l),f=o<=s;n=o;const d={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&f?(s-o)/u:void 0,event:a,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(d)},r)},Dw=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},Iw=e=>(...t)=>I.asap(()=>e(...t)),wI=Mt.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,Mt.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,SI=Mt.hasStandardBrowserEnv?{write(e,t,r,n,i,a,o){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];I.isNumber(r)&&s.push(`expires=${new Date(r).toUTCString()}`),I.isString(n)&&s.push(`path=${n}`),I.isString(i)&&s.push(`domain=${i}`),a===!0&&s.push("secure"),I.isString(o)&&s.push(`SameSite=${o}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function jI(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function OI(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function vA(e,t,r){let n=!jI(t);return e&&(n||r==!1)?OI(e,t):t}const Lw=e=>e instanceof ir?{...e}:e;function Ua(e,t){t=t||{};const r={};function n(u,f,d,h){return I.isPlainObject(u)&&I.isPlainObject(f)?I.merge.call({caseless:h},u,f):I.isPlainObject(f)?I.merge({},f):I.isArray(f)?f.slice():f}function i(u,f,d,h){if(I.isUndefined(f)){if(!I.isUndefined(u))return n(void 0,u,d,h)}else return n(u,f,d,h)}function a(u,f){if(!I.isUndefined(f))return n(void 0,f)}function o(u,f){if(I.isUndefined(f)){if(!I.isUndefined(u))return n(void 0,u)}else return n(void 0,f)}function s(u,f,d){if(d in t)return n(u,f);if(d in e)return n(void 0,u)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,f,d)=>i(Lw(u),Lw(f),d,!0)};return I.forEach(Object.keys({...e,...t}),function(f){const d=l[f]||i,h=d(e[f],t[f],f);I.isUndefined(h)&&d!==s||(r[f]=h)}),r}const yA=e=>{const t=Ua({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=t;if(t.headers=o=ir.from(o),t.url=fA(vA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):""))),I.isFormData(r)){if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(I.isFunction(r.getHeaders)){const l=r.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([f,d])=>{u.includes(f.toLowerCase())&&o.set(f,d)})}}if(Mt.hasStandardBrowserEnv&&(n&&I.isFunction(n)&&(n=n(t)),n||n!==!1&&wI(t.url))){const l=i&&a&&SI.read(a);l&&o.set(i,l)}return t},PI=typeof XMLHttpRequest<"u",_I=PI&&function(e){return new Promise(function(r,n){const i=yA(e);let a=i.data;const o=ir.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,f,d,h,p,v;function m(){p&&p(),v&&v(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function b(){if(!y)return;const x=ir.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),w={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:x,config:e,request:y};mA(function(O){r(O),m()},function(O){n(O),m()},w),y=null}"onloadend"in y?y.onloadend=b:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(b)},y.onabort=function(){y&&(n(new ue("Request aborted",ue.ECONNABORTED,e,y)),y=null)},y.onerror=function(S){const w=S&&S.message?S.message:"Network Error",j=new ue(w,ue.ERR_NETWORK,e,y);j.event=S||null,n(j),y=null},y.ontimeout=function(){let S=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const w=i.transitional||dA;i.timeoutErrorMessage&&(S=i.timeoutErrorMessage),n(new ue(S,w.clarifyTimeoutError?ue.ETIMEDOUT:ue.ECONNABORTED,e,y)),y=null},a===void 0&&o.setContentType(null),"setRequestHeader"in y&&I.forEach(o.toJSON(),function(S,w){y.setRequestHeader(w,S)}),I.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),s&&s!=="json"&&(y.responseType=i.responseType),u&&([h,v]=Xf(u,!0),y.addEventListener("progress",h)),l&&y.upload&&([d,p]=Xf(l),y.upload.addEventListener("progress",d),y.upload.addEventListener("loadend",p)),(i.cancelToken||i.signal)&&(f=x=>{y&&(n(!x||x.type?new Is(null,e,y):x),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const g=gI(i.url);if(g&&Mt.protocols.indexOf(g)===-1){n(new ue("Unsupported protocol "+g+":",ue.ERR_BAD_REQUEST,e));return}y.send(a||null)})},kI=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,i;const a=function(u){if(!i){i=!0,s();const f=u instanceof Error?u:this.reason;n.abort(f instanceof ue?f:new Is(f instanceof Error?f.message:f))}};let o=t&&setTimeout(()=>{o=null,a(new ue(`timeout ${t} of ms exceeded`,ue.ETIMEDOUT))},t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),e=null)};e.forEach(u=>u.addEventListener("abort",a));const{signal:l}=n;return l.unsubscribe=()=>I.asap(s),l}},AI=function*(e,t){let r=e.byteLength;if(r{const i=EI(e,t);let a=0,o,s=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:f}=await i.next();if(u){s(),l.close();return}let d=f.byteLength;if(r){let h=a+=d;r(h)}l.enqueue(new Uint8Array(f))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},Bw=64*1024,{isFunction:Hc}=I,TI=(({Request:e,Response:t})=>({Request:e,Response:t}))(I.global),{ReadableStream:zw,TextEncoder:Uw}=I.global,qw=(e,...t)=>{try{return!!e(...t)}catch{return!1}},$I=e=>{e=I.merge.call({skipUndefined:!0},TI,e);const{fetch:t,Request:r,Response:n}=e,i=t?Hc(t):typeof fetch=="function",a=Hc(r),o=Hc(n);if(!i)return!1;const s=i&&Hc(zw),l=i&&(typeof Uw=="function"?(v=>m=>v.encode(m))(new Uw):async v=>new Uint8Array(await new r(v).arrayBuffer())),u=a&&s&&qw(()=>{let v=!1;const m=new r(Mt.origin,{body:new zw,method:"POST",get duplex(){return v=!0,"half"}}).headers.has("Content-Type");return v&&!m}),f=o&&s&&qw(()=>I.isReadableStream(new n("").body)),d={stream:f&&(v=>v.body)};i&&["text","arrayBuffer","blob","formData","stream"].forEach(v=>{!d[v]&&(d[v]=(m,y)=>{let b=m&&m[v];if(b)return b.call(m);throw new ue(`Response type '${v}' is not supported`,ue.ERR_NOT_SUPPORT,y)})});const h=async v=>{if(v==null)return 0;if(I.isBlob(v))return v.size;if(I.isSpecCompliantForm(v))return(await new r(Mt.origin,{method:"POST",body:v}).arrayBuffer()).byteLength;if(I.isArrayBufferView(v)||I.isArrayBuffer(v))return v.byteLength;if(I.isURLSearchParams(v)&&(v=v+""),I.isString(v))return(await l(v)).byteLength},p=async(v,m)=>{const y=I.toFiniteNumber(v.getContentLength());return y??h(m)};return async v=>{let{url:m,method:y,data:b,signal:g,cancelToken:x,timeout:S,onDownloadProgress:w,onUploadProgress:j,responseType:O,headers:P,withCredentials:A="same-origin",fetchOptions:E}=yA(v),N=t||fetch;O=O?(O+"").toLowerCase():"text";let T=kI([g,x&&x.toAbortSignal()],S),M=null;const R=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let D;try{if(j&&u&&y!=="get"&&y!=="head"&&(D=await p(P,b))!==0){let G=new r(m,{method:"POST",body:b,duplex:"half"}),q;if(I.isFormData(b)&&(q=G.headers.get("content-type"))&&P.setContentType(q),G.body){const[ee,ce]=Dw(D,Xf(Iw(j)));b=Fw(G.body,Bw,ee,ce)}}I.isString(A)||(A=A?"include":"omit");const L=a&&"credentials"in r.prototype,U={...E,signal:T,method:y.toUpperCase(),headers:P.normalize().toJSON(),body:b,duplex:"half",credentials:L?A:void 0};M=a&&new r(m,U);let C=await(a?N(M,E):N(m,U));const F=f&&(O==="stream"||O==="response");if(f&&(w||F&&R)){const G={};["status","statusText","headers"].forEach(V=>{G[V]=C[V]});const q=I.toFiniteNumber(C.headers.get("content-length")),[ee,ce]=w&&Dw(q,Xf(Iw(w),!0))||[];C=new n(Fw(C.body,Bw,ee,()=>{ce&&ce(),R&&R()}),G)}O=O||"text";let z=await d[I.findKey(d,O)||"text"](C,v);return!F&&R&&R(),await new Promise((G,q)=>{mA(G,q,{data:z,headers:ir.from(C.headers),status:C.status,statusText:C.statusText,config:v,request:M})})}catch(L){throw R&&R(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new ue("Network Error",ue.ERR_NETWORK,v,M),{cause:L.cause||L}):ue.from(L,L&&L.code,v,M)}}},CI=new Map,gA=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:i}=t,a=[n,i,r];let o=a.length,s=o,l,u,f=CI;for(;s--;)l=a[s],u=f.get(l),u===void 0&&f.set(l,u=s?new Map:$I(t)),f=u;return u};gA();const Kx={http:YD,xhr:_I,fetch:{get:gA}};I.forEach(Kx,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Ww=e=>`- ${e}`,MI=e=>I.isFunction(e)||e===null||e===!1;function RI(e,t){e=I.isArray(e)?e:[e];const{length:r}=e;let n,i;const a={};for(let o=0;o`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=r?o.length>1?`since : +`+o.map(Ww).join(` +`):" "+Ww(o[0]):"as no adapter specified";throw new ue("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const xA={getAdapter:RI,adapters:Kx};function um(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Is(null,e)}function Hw(e){return um(e),e.headers=ir.from(e.headers),e.data=lm.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xA.getAdapter(e.adapter||vc.adapter,e)(e).then(function(n){return um(e),n.data=lm.call(e,e.transformResponse,n),n.headers=ir.from(n.headers),n},function(n){return pA(n)||(um(e),n&&n.response&&(n.response.data=lm.call(e,e.transformResponse,n.response),n.response.headers=ir.from(n.response.headers))),Promise.reject(n)})}const bA="1.13.2",Mh={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Mh[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Kw={};Mh.transitional=function(t,r,n){function i(a,o){return"[Axios v"+bA+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(t===!1)throw new ue(i(o," has been removed"+(r?" in "+r:"")),ue.ERR_DEPRECATED);return r&&!Kw[o]&&(Kw[o]=!0,console.warn(i(o," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,o,s):!0}};Mh.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function DI(e,t,r){if(typeof e!="object")throw new ue("options must be an object",ue.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const s=e[a],l=s===void 0||o(s,a,e);if(l!==!0)throw new ue("option "+a+" must be "+l,ue.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new ue("Unknown option "+a,ue.ERR_BAD_OPTION)}}const Sf={assertOptions:DI,validators:Mh},sn=Sf.validators;let Ca=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Mw,response:new Mw}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` +`+a):n.stack=a}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=Ua(this.defaults,r);const{transitional:n,paramsSerializer:i,headers:a}=r;n!==void 0&&Sf.assertOptions(n,{silentJSONParsing:sn.transitional(sn.boolean),forcedJSONParsing:sn.transitional(sn.boolean),clarifyTimeoutError:sn.transitional(sn.boolean)},!1),i!=null&&(I.isFunction(i)?r.paramsSerializer={serialize:i}:Sf.assertOptions(i,{encode:sn.function,serialize:sn.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Sf.assertOptions(r,{baseUrl:sn.spelling("baseURL"),withXsrfToken:sn.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let o=a&&I.merge(a.common,a[r.method]);a&&I.forEach(["delete","get","head","post","put","patch","common"],v=>{delete a[v]}),r.headers=ir.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(r)===!1||(l=l&&m.synchronous,s.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let f,d=0,h;if(!l){const v=[Hw.bind(this),void 0];for(v.unshift(...s),v.push(...u),h=v.length,f=Promise.resolve(r);d{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},t(function(a,o,s){n.reason||(n.reason=new Is(a,o,s),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new wA(function(i){t=i}),cancel:t}}};function LI(e){return function(r){return e.apply(null,r)}}function FI(e){return I.isObject(e)&&e.isAxiosError===!0}const oy={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(oy).forEach(([e,t])=>{oy[t]=e});function SA(e){const t=new Ca(e),r=Jk(Ca.prototype.request,t);return I.extend(r,Ca.prototype,t,{allOwnKeys:!0}),I.extend(r,t,null,{allOwnKeys:!0}),r.create=function(i){return SA(Ua(e,i))},r}const Xe=SA(vc);Xe.Axios=Ca;Xe.CanceledError=Is;Xe.CancelToken=II;Xe.isCancel=pA;Xe.VERSION=bA;Xe.toFormData=Ch;Xe.AxiosError=ue;Xe.Cancel=Xe.CanceledError;Xe.all=function(t){return Promise.all(t)};Xe.spread=LI;Xe.isAxiosError=FI;Xe.mergeConfig=Ua;Xe.AxiosHeaders=ir;Xe.formToJSON=e=>hA(I.isHTMLForm(e)?new FormData(e):e);Xe.getAdapter=xA.getAdapter;Xe.HttpStatusCode=oy;Xe.default=Xe;const{Axios:Rle,AxiosError:Dle,CanceledError:Ile,isCancel:Lle,CancelToken:Fle,VERSION:Ble,all:zle,Cancel:Ule,isAxiosError:qle,spread:Wle,toFormData:Hle,AxiosHeaders:Kle,HttpStatusCode:Vle,formToJSON:Gle,getAdapter:Qle,mergeConfig:Yle}=Xe,ni=Xe.create({baseURL:"/api",headers:{"Content-Type":"application/json"}}),Ye={getRuns:async e=>{const t={};return e!=null&&e.project&&(t.project=e.project),e!=null&&e.provider&&(t.provider=e.provider),e!=null&&e.status&&(t.status=e.status),e!=null&&e.startDate&&(t.start_date=e.startDate),e!=null&&e.endDate&&(t.end_date=e.endDate),e!=null&&e.algorithm&&(t.algorithm=e.algorithm),e!=null&&e.limit&&(t.limit=e.limit),(await ni.get("/runs",{params:t})).data},getAlgorithms:async()=>(await ni.get("/algorithms")).data.algorithms||[],getRun:async(e,t)=>{try{const[r,n]=await Promise.all([ni.get(`/runs/${e}/${t}/event`),ni.get(`/runs/${e}/${t}/analysis`)]);return{event:r.data,analysis:n.data}}catch{const[n,i]=await Promise.all([ni.get(`/runs/${t}`),ni.get(`/runs/${t}/analysis`)]);return{event:n.data,analysis:i.data}}},health:async()=>(await ni.get("/health")).data,getSettings:async()=>(await ni.get("/settings")).data};function BI({onDateRangeChange:e,initialStartDate:t,initialEndDate:r}){const[n,i]=k.useState(!0),[a,o]=k.useState(t||""),[s,l]=k.useState(r||""),u=k.useRef(null);k.useEffect(()=>{t!==void 0&&o(t),r!==void 0&&l(r)},[t,r]),k.useEffect(()=>{const p=v=>{u.current&&!u.current.contains(v.target)&&i(!1)};if(n)return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const f=()=>{a&&s?new Date(s)>=new Date(a)?(e==null||e(a,s),i(!1)):alert("End date must be after start date"):(a||s)&&alert("Please select both start and end dates")},d=()=>{o(""),l(""),e==null||e(void 0,void 0),i(!1)},h=new Date().toISOString().split("T")[0];return c.jsxs("div",{className:"relative",ref:u,children:[c.jsxs("button",{onClick:()=>i(!n),className:"bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm flex items-center gap-2 hover:border-primary/50 transition-colors",children:[c.jsx(eD,{size:16}),a&&s?c.jsxs("span",{className:"text-xs",children:[new Date(a).toLocaleDateString()," - ",new Date(s).toLocaleDateString()]}):c.jsx("span",{children:"Select Dates"})]}),n&&c.jsxs("div",{className:"absolute top-full mt-2 right-0 bg-dark-surface border border-dark-border rounded-lg p-4 shadow-xl z-50 min-w-[320px]",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-sm font-semibold text-white",children:"Select Date Range"}),c.jsx("button",{onClick:()=>i(!1),className:"text-dark-text-muted hover:text-dark-text transition-colors",children:c.jsx(Zk,{size:18})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:"Start Date"}),c.jsx("input",{type:"date",value:a,onChange:p=>o(p.target.value),max:s||h,className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50 transition-colors"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:"End Date"}),c.jsx("input",{type:"date",value:s,onChange:p=>l(p.target.value),min:a||void 0,max:h,className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50 transition-colors"})]}),c.jsxs("div",{className:"flex gap-2 pt-2",children:[c.jsx("button",{onClick:f,className:"flex-1 bg-primary hover:bg-primary/90 text-white text-sm py-2 px-4 rounded-lg transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:!a||!s,children:"Apply"}),c.jsx("button",{onClick:d,className:"px-4 py-2 bg-dark-bg border border-dark-border hover:bg-dark-bg/80 text-dark-text text-sm rounded-lg transition-colors",children:"Clear"})]})]})]})]})}function jA(e,t){if(e.length===0){alert("No data to export");return}const r=Object.keys(e[0]),n=[r.join(","),...e.map(s=>r.map(l=>{const u=s[l];if(u==null)return"";const f=String(u);return f.includes(",")||f.includes('"')||f.includes(` `)?`"${f.replace(/"/g,'""')}"`:f}).join(","))].join(` -`),i=new Blob([n],{type:"text/csv;charset=utf-8;"}),a=document.createElement("a"),o=URL.createObjectURL(i);a.setAttribute("href",o),a.setAttribute("download",`${t}.csv`),a.style.visibility="hidden",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}function Kx(e,t="qobserva-runs"){const r=e.map(n=>({"Run ID":n.run_id,Time:new Date(n.created_at).toISOString(),Project:n.project,Provider:n.provider,Backend:n.backend_name,Status:n.status,Shots:n.shots}));SA(r,t)}function BI(e,t="qobserva-backends"){const r=e.map(n=>({"Backend Name":n.backend_name,Provider:n.provider,"Total Runs":n.total,Success:n.success,Failed:n.failed,Cancelled:n.cancelled,"Success Rate (%)":n.total>0?(n.success/n.total*100).toFixed(2):"0.00"}));SA(r,t)}function zI({onFilterChange:e,disabled:t=!1,disabledMessage:r="Filters are not available for individual run details or comparisons",visible:n={project:!0,provider:!0,status:!0,time:!0,algorithm:!1},showExport:i=!0}){const[a]=Ah(),o=Vi(),s=mt(),{data:l=[]}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3})}),{data:u=[]}=Qe({queryKey:["algorithms"],queryFn:()=>Ye.getAlgorithms(),enabled:n.algorithm===!0}),f=o.pathname==="/runs-filtered",d=a.get("project"),h=a.get("provider"),p=a.get("status"),v=a.get("startDate"),m=a.get("endDate"),y=a.get("algorithm"),[b,g]=k.useState(d||"All"),[x,S]=k.useState(h||"All"),[w,j]=k.useState(p||"All"),[O,P]=k.useState(y||"All"),[A,E]=k.useState("All Time"),[N,T]=k.useState(v||void 0),[M,R]=k.useState(m||void 0);k.useEffect(()=>{n.provider===!1&&x!=="All"&&S("All"),n.status===!1&&w!=="All"&&j("All"),n.algorithm===!1&&O!=="All"&&P("All")},[n.provider,n.status,n.algorithm]),k.useEffect(()=>{h?h!==x&&S(h):x!=="All"&&S("All"),d?d!==b&&g(d):b!=="All"&&g("All"),p?p!==w&&j(p):w!=="All"&&j("All"),v!==N&&T(v||void 0),m!==M&&R(m||void 0),!v&&!m&&A!=="All Time"?E("All Time"):(v||m)&&A==="All Time"&&E("Custom")},[h,d,p,v,m,f]);const D=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.project))).sort(),[l]),L=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.provider))).sort(),[l]),z=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.status))).sort(),[l]),C=()=>{const V={project:n.project===!1||b==="All"?void 0:b,provider:n.provider===!1||x==="All"?void 0:x,status:n.status===!1||w==="All"?void 0:w,algorithm:n.algorithm===!1||O==="All"?void 0:O,startDate:n.time===!1?void 0:N,endDate:n.time===!1?void 0:M};if(console.log("FilterRibbon: Calling onFilterChange with",V),e==null||e(V),f){const ie=new URLSearchParams(a),Le=a.get("type");Le&&ie.set("type",Le),V.project?ie.set("project",V.project):ie.delete("project"),V.provider?ie.set("provider",V.provider):ie.delete("provider"),V.status?ie.set("status",V.status):ie.delete("status"),V.startDate?ie.set("startDate",V.startDate):ie.delete("startDate"),V.endDate?ie.set("endDate",V.endDate):ie.delete("endDate"),V.algorithm?ie.set("algorithm",V.algorithm):ie.delete("algorithm"),s(`/runs-filtered?${ie.toString()}`,{replace:!0})}},B=V=>{g(V)},U=V=>{S(V)},G=V=>{j(V)},q=V=>{P(V)},ee=V=>{if(E(V),V==="All Time")T(void 0),R(void 0);else if(V!=="Custom"){const ie=new Date;let Le=null;switch(V){case"Last 24 Hours":Le=new Date(ie.getTime()-24*60*60*1e3);break;case"Last 7 Days":Le=new Date(ie.getTime()-7*24*60*60*1e3);break;case"Last 30 Days":Le=new Date(ie.getTime()-30*24*60*60*1e3);break}const ot=Le?Le.toISOString().replace(/\.\d{3}Z$/,"Z").replace("+00:00","Z"):void 0,Q=ie.toISOString().replace("+00:00","Z");T(ot),R(Q)}},ce=(V,ie)=>{let Le,ot;V&&(Le=new Date(V+"T00:00:00.000Z").toISOString().replace(/\.\d{3}Z$/,"Z").replace("+00:00","Z")),ie&&(ot=new Date(ie+"T23:59:59.999Z").toISOString().replace("+00:00","Z")),T(Le),R(ot),E("Custom")};return k.useEffect(()=>{console.log("FilterRibbon: Filter state changed",{project:b,provider:x,status:w,algorithm:O,startDate:N,endDate:M}),C()},[b,x,w,O,N,M]),c.jsxs("div",{className:"bg-dark-surface border-b border-dark-border px-6 py-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-4 flex-1",title:t?r:void 0,children:[n.project!==!1&&c.jsxs("select",{value:b,onChange:V=>B(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Projects"}),D.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.provider!==!1&&c.jsxs("select",{value:x,onChange:V=>U(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Providers"}),L.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.status!==!1&&c.jsxs("select",{value:w,onChange:V=>G(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Statuses"}),z.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.algorithm===!0&&u.length>0&&c.jsxs("select",{value:O,onChange:V=>q(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Algorithms"}),u.map(V=>c.jsxs("option",{value:V.name,children:[V.name," (",V.count,")"]},V.name))]}),n.time!==!1&&c.jsxs("select",{value:A,onChange:V=>ee(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All Time",children:"All Time"}),c.jsx("option",{value:"Last 24 Hours",children:"Last 24 Hours"}),c.jsx("option",{value:"Last 7 Days",children:"Last 7 Days"}),c.jsx("option",{value:"Last 30 Days",children:"Last 30 Days"}),c.jsx("option",{value:"Custom",children:"Custom"})]}),n.time!==!1&&A==="Custom"&&!t&&c.jsx(FI,{onDateRangeChange:ce,initialStartDate:N?new Date(N).toISOString().split("T")[0]:void 0,initialEndDate:M?new Date(M).toISOString().split("T")[0]:void 0})]}),c.jsx("div",{className:"flex-1"}),!t&&i&&c.jsx(UI,{filters:{project:n.project===!1||b==="All"?void 0:b,provider:n.provider===!1||x==="All"?void 0:x,status:n.status===!1||w==="All"?void 0:w,algorithm:n.algorithm===!1||O==="All"?void 0:O,startDate:n.time===!1?void 0:N,endDate:n.time===!1?void 0:M}})]})}function UI({filters:e}){const[t,r]=k.useState(!1),i=Vi().pathname==="/",a=()=>{const l=new URLSearchParams;l.set("type","home"),e.project&&l.set("project",e.project),e.startDate&&l.set("startDate",e.startDate),e.endDate&&l.set("endDate",e.endDate);const u=`/report?${l.toString()}`;window.open(u,"_blank","noopener,noreferrer")},{refetch:o}=Qe({queryKey:["runs-export",e],queryFn:()=>Ye.getRuns({limit:1e4,...e}),enabled:!1}),s=async()=>{r(!0);try{const u=(await o()).data||[];if(u.length===0){alert("No data to export with current filters"),r(!1);return}const f=[];e.project&&f.push(e.project),e.provider&&f.push(e.provider),e.status&&f.push(e.status);const d=f.length>0?`qobserva-${f.join("-")}`:"qobserva-all-runs";Kx(u,d)}catch(l){console.error("Export failed:",l),alert("Failed to export data. Please try again.")}finally{r(!1)}};return i?c.jsxs("button",{onClick:a,className:"btn-secondary flex items-center gap-2",title:"Export dashboard via browser print (Save as PDF)",children:[c.jsx(lD,{size:16}),"Export PDF"]}):c.jsxs("button",{onClick:s,disabled:t,className:"btn-secondary flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Export filtered runs to CSV",children:[c.jsx(Eh,{size:16}),t?"Exporting...":"Export"]})}const xn="/assets/qoblogo-E43t-2-U.png",qI=[{path:"/",icon:sD,label:"Home"},{path:"/search",icon:Yf,label:"Search Runs"},{path:"/compare",icon:oD,label:"Compare"},{path:"/analytics",icon:ZR,label:"Run Analytics"},{path:"/algorithms",icon:tD,label:"Algorithm Analytics"},{path:"/reports",icon:iD,label:"Generate Report"},{path:"/settings",icon:uD,label:"Settings"}];function WI({children:e,onFilterChange:t}){const r=Vi(),n=r.pathname==="/report",i=r.pathname.startsWith("/runs/"),a=r.pathname==="/compare",o=r.pathname==="/search",s=r.pathname==="/analytics",l=r.pathname==="/algorithms",u=r.pathname==="/reports",f=r.pathname==="/settings",d=i||a||o||u||f;return n?c.jsx("div",{className:"min-h-screen bg-white text-black",children:e}):c.jsxs("div",{className:"min-h-screen bg-dark-bg",children:[c.jsxs("aside",{className:"fixed left-0 top-0 h-screen w-80 bg-dark-surface border-r border-dark-border flex flex-col",children:[c.jsx("div",{className:"p-6 border-b border-dark-border relative",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 min-w-0 pr-3",children:[c.jsx("h1",{className:"text-2xl font-bold text-white leading-tight",children:"QObserva"}),c.jsx("p",{className:"text-sm text-dark-text-muted leading-tight mt-0.5 whitespace-nowrap",children:"Quantum Observability"})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-16 w-16 sm:h-20 sm:w-20 md:h-24 md:w-24 object-contain flex-shrink-0"})]})}),c.jsx("nav",{className:"flex-1 p-4 space-y-2",children:qI.map(h=>{const p=h.icon,v=r.pathname===h.path;return c.jsxs(KR,{to:h.path,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${v?"bg-primary/20 text-primary border border-primary/30":"text-dark-text-muted hover:bg-dark-bg hover:text-dark-text"}`,children:[c.jsx(p,{size:20}),c.jsx("span",{className:"font-medium",children:h.label})]},h.path)})})]}),c.jsxs("div",{className:"ml-80",children:[c.jsx(zI,{onFilterChange:t,disabled:d,visible:s?{project:!0,provider:!1,status:!1,time:!0,algorithm:!1}:l?{project:!0,provider:!0,status:!0,time:!0,algorithm:!1}:void 0,showExport:!(u||f||s||l),disabledMessage:i?"Filters are not available for individual run details":u?"Filters are not used on Generate Report (use the report inputs instead)":f?"Filters are not used on Settings":"Filters are not available for run comparisons"}),c.jsx("main",{className:"p-8",children:e})]})]})}function be({label:e,value:t,change:r,onClick:n,clickable:i=!1}){const a=()=>{i&&n&&n()};return c.jsxs("div",{className:`metric-card ${i?"cursor-pointer hover:border-primary/50 transition-colors":""}`,onClick:a,children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:e}),c.jsx("div",{className:"text-3xl font-bold text-white",children:t}),r&&c.jsx("div",{className:"text-xs text-dark-text-muted mt-2",children:r})]})}function jA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var qL=UL,WL=Dh;function HL(e,t){var r=this.__data__,n=WL(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var KL=HL,VL=EL,GL=IL,QL=BL,YL=qL,XL=KL;function zs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t({"Run ID":n.run_id,Time:new Date(n.created_at).toISOString(),Project:n.project,Provider:n.provider,Backend:n.backend_name,Status:n.status,Shots:n.shots}));jA(r,t)}function zI(e,t="qobserva-backends"){const r=e.map(n=>({"Backend Name":n.backend_name,Provider:n.provider,"Total Runs":n.total,Success:n.success,Failed:n.failed,Cancelled:n.cancelled,"Success Rate (%)":n.total>0?(n.success/n.total*100).toFixed(2):"0.00"}));jA(r,t)}function UI({onFilterChange:e,disabled:t=!1,disabledMessage:r="Filters are not available for individual run details or comparisons",visible:n={project:!0,provider:!0,status:!0,time:!0,algorithm:!1},showExport:i=!0}){const[a]=Ah(),o=Vi(),s=mt(),{data:l=[]}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3})}),{data:u=[]}=Qe({queryKey:["algorithms"],queryFn:()=>Ye.getAlgorithms(),enabled:n.algorithm===!0}),f=o.pathname==="/runs-filtered",d=a.get("project"),h=a.get("provider"),p=a.get("status"),v=a.get("startDate"),m=a.get("endDate"),y=a.get("algorithm"),[b,g]=k.useState(d||"All"),[x,S]=k.useState(h||"All"),[w,j]=k.useState(p||"All"),[O,P]=k.useState(y||"All"),[A,E]=k.useState("All Time"),[N,T]=k.useState(v||void 0),[M,R]=k.useState(m||void 0);k.useEffect(()=>{n.provider===!1&&x!=="All"&&S("All"),n.status===!1&&w!=="All"&&j("All"),n.algorithm===!1&&O!=="All"&&P("All")},[n.provider,n.status,n.algorithm]),k.useEffect(()=>{h?h!==x&&S(h):x!=="All"&&S("All"),d?d!==b&&g(d):b!=="All"&&g("All"),p?p!==w&&j(p):w!=="All"&&j("All"),v!==N&&T(v||void 0),m!==M&&R(m||void 0),!v&&!m&&A!=="All Time"?E("All Time"):(v||m)&&A==="All Time"&&E("Custom")},[h,d,p,v,m,f]);const D=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.project))).sort(),[l]),L=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.provider))).sort(),[l]),U=k.useMemo(()=>Array.from(new Set(l.map(ie=>ie.status))).sort(),[l]),C=()=>{const V={project:n.project===!1||b==="All"?void 0:b,provider:n.provider===!1||x==="All"?void 0:x,status:n.status===!1||w==="All"?void 0:w,algorithm:n.algorithm===!1||O==="All"?void 0:O,startDate:n.time===!1?void 0:N,endDate:n.time===!1?void 0:M};if(e==null||e(V),f){const ie=new URLSearchParams(a),Le=a.get("type");Le&&ie.set("type",Le),V.project?ie.set("project",V.project):ie.delete("project"),V.provider?ie.set("provider",V.provider):ie.delete("provider"),V.status?ie.set("status",V.status):ie.delete("status"),V.startDate?ie.set("startDate",V.startDate):ie.delete("startDate"),V.endDate?ie.set("endDate",V.endDate):ie.delete("endDate"),V.algorithm?ie.set("algorithm",V.algorithm):ie.delete("algorithm"),s(`/runs-filtered?${ie.toString()}`,{replace:!0})}},F=V=>{g(V)},z=V=>{S(V)},G=V=>{j(V)},q=V=>{P(V)},ee=V=>{if(E(V),V==="All Time")T(void 0),R(void 0);else if(V!=="Custom"){const ie=new Date;let Le=null;switch(V){case"Last 24 Hours":Le=new Date(ie.getTime()-24*60*60*1e3);break;case"Last 7 Days":Le=new Date(ie.getTime()-7*24*60*60*1e3);break;case"Last 30 Days":Le=new Date(ie.getTime()-30*24*60*60*1e3);break}const ot=Le?Le.toISOString().replace(/\.\d{3}Z$/,"Z").replace("+00:00","Z"):void 0,Q=ie.toISOString().replace("+00:00","Z");T(ot),R(Q)}},ce=(V,ie)=>{let Le,ot;V&&(Le=new Date(V+"T00:00:00.000Z").toISOString().replace(/\.\d{3}Z$/,"Z").replace("+00:00","Z")),ie&&(ot=new Date(ie+"T23:59:59.999Z").toISOString().replace("+00:00","Z")),T(Le),R(ot),E("Custom")};return k.useEffect(()=>{C()},[b,x,w,O,N,M]),c.jsxs("div",{className:"bg-dark-surface border-b border-dark-border px-6 py-4 flex items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-4 flex-1",title:t?r:void 0,children:[n.project!==!1&&c.jsxs("select",{value:b,onChange:V=>F(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Projects"}),D.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.provider!==!1&&c.jsxs("select",{value:x,onChange:V=>z(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Providers"}),L.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.status!==!1&&c.jsxs("select",{value:w,onChange:V=>G(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Statuses"}),U.map(V=>c.jsx("option",{value:V,children:V},V))]}),n.algorithm===!0&&u.length>0&&c.jsxs("select",{value:O,onChange:V=>q(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All",children:"All Algorithms"}),u.map(V=>c.jsxs("option",{value:V.name,children:[V.name," (",V.count,")"]},V.name))]}),n.time!==!1&&c.jsxs("select",{value:A,onChange:V=>ee(V.target.value),disabled:t,className:`bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm ${t?"opacity-50 cursor-not-allowed":""}`,children:[c.jsx("option",{value:"All Time",children:"All Time"}),c.jsx("option",{value:"Last 24 Hours",children:"Last 24 Hours"}),c.jsx("option",{value:"Last 7 Days",children:"Last 7 Days"}),c.jsx("option",{value:"Last 30 Days",children:"Last 30 Days"}),c.jsx("option",{value:"Custom",children:"Custom"})]}),n.time!==!1&&A==="Custom"&&!t&&c.jsx(BI,{onDateRangeChange:ce,initialStartDate:N?new Date(N).toISOString().split("T")[0]:void 0,initialEndDate:M?new Date(M).toISOString().split("T")[0]:void 0})]}),c.jsx("div",{className:"flex-1"}),!t&&i&&c.jsx(qI,{filters:{project:n.project===!1||b==="All"?void 0:b,provider:n.provider===!1||x==="All"?void 0:x,status:n.status===!1||w==="All"?void 0:w,algorithm:n.algorithm===!1||O==="All"?void 0:O,startDate:n.time===!1?void 0:N,endDate:n.time===!1?void 0:M}})]})}function qI({filters:e}){const[t,r]=k.useState(!1),i=Vi().pathname==="/",a=()=>{const l=new URLSearchParams;l.set("type","home"),e.project&&l.set("project",e.project),e.startDate&&l.set("startDate",e.startDate),e.endDate&&l.set("endDate",e.endDate);const u=`/report?${l.toString()}`;window.open(u,"_blank","noopener,noreferrer")},{refetch:o}=Qe({queryKey:["runs-export",e],queryFn:()=>Ye.getRuns({limit:1e4,...e}),enabled:!1}),s=async()=>{r(!0);try{const u=(await o()).data||[];if(u.length===0){alert("No data to export with current filters"),r(!1);return}const f=[];e.project&&f.push(e.project),e.provider&&f.push(e.provider),e.status&&f.push(e.status);const d=f.length>0?`qobserva-${f.join("-")}`:"qobserva-all-runs";Vx(u,d)}catch(l){console.error("Export failed:",l),alert("Failed to export data. Please try again.")}finally{r(!1)}};return i?c.jsxs("button",{onClick:a,className:"btn-secondary flex items-center gap-2",title:"Export dashboard via browser print (Save as PDF)",children:[c.jsx(uD,{size:16}),"Export PDF"]}):c.jsxs("button",{onClick:s,disabled:t,className:"btn-secondary flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",title:"Export filtered runs to CSV",children:[c.jsx(Eh,{size:16}),t?"Exporting...":"Export"]})}const xn="/assets/qoblogo-E43t-2-U.png",WI=[{path:"/",icon:lD,label:"Home"},{path:"/search",icon:Yf,label:"Search Runs"},{path:"/compare",icon:sD,label:"Compare"},{path:"/analytics",icon:JR,label:"Run Analytics"},{path:"/algorithms",icon:rD,label:"Algorithm Analytics"},{path:"/reports",icon:aD,label:"Generate Report"},{path:"/settings",icon:cD,label:"Settings"}];function HI({children:e,onFilterChange:t}){const r=Vi(),n=r.pathname==="/report",i=r.pathname.startsWith("/runs/"),a=r.pathname==="/compare",o=r.pathname==="/search",s=r.pathname==="/analytics",l=r.pathname==="/algorithms",u=r.pathname==="/reports",f=r.pathname==="/settings",d=i||a||o||u||f;return n?c.jsx("div",{className:"min-h-screen bg-white text-black",children:e}):c.jsxs("div",{className:"min-h-screen bg-dark-bg",children:[c.jsxs("aside",{className:"fixed left-0 top-0 h-screen w-80 bg-dark-surface border-r border-dark-border flex flex-col",children:[c.jsx("div",{className:"p-6 border-b border-dark-border relative",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex-1 min-w-0 pr-3",children:[c.jsx("h1",{className:"text-2xl font-bold text-white leading-tight",children:"QObserva"}),c.jsx("p",{className:"text-sm text-dark-text-muted leading-tight mt-0.5 whitespace-nowrap",children:"Quantum Observability"})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-16 w-16 sm:h-20 sm:w-20 md:h-24 md:w-24 object-contain flex-shrink-0"})]})}),c.jsx("nav",{className:"flex-1 p-4 space-y-2",children:WI.map(h=>{const p=h.icon,v=r.pathname===h.path;return c.jsxs(VR,{to:h.path,className:`flex items-center gap-3 px-4 py-3 rounded-lg transition-colors ${v?"bg-primary/20 text-primary border border-primary/30":"text-dark-text-muted hover:bg-dark-bg hover:text-dark-text"}`,children:[c.jsx(p,{size:20}),c.jsx("span",{className:"font-medium",children:h.label})]},h.path)})})]}),c.jsxs("div",{className:"ml-80",children:[c.jsx(UI,{onFilterChange:t,disabled:d,visible:s?{project:!0,provider:!1,status:!1,time:!0,algorithm:!1}:l?{project:!0,provider:!0,status:!0,time:!0,algorithm:!1}:void 0,showExport:!(u||f||s||l),disabledMessage:i?"Filters are not available for individual run details":u?"Filters are not used on Generate Report (use the report inputs instead)":f?"Filters are not used on Settings":"Filters are not available for run comparisons"}),c.jsx("main",{className:"p-8",children:e})]})]})}function be({label:e,value:t,change:r,onClick:n,clickable:i=!1}){const a=()=>{i&&n&&n()};return c.jsxs("div",{className:`metric-card ${i?"cursor-pointer hover:border-primary/50 transition-colors":""}`,onClick:a,children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:e}),c.jsx("div",{className:"text-3xl font-bold text-white",children:t}),r&&c.jsx("div",{className:"text-xs text-dark-text-muted mt-2",children:r})]})}function OA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t-1}var WL=qL,HL=Dh;function KL(e,t){var r=this.__data__,n=HL(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var VL=KL,GL=NL,QL=LL,YL=zL,XL=WL,ZL=VL;function zs(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t0?1:-1},ya=function(t){return qa(t)&&t.indexOf("%")===t.length-1},H=function(t){return yF(t)&&!qs(t)},wF=function(t){return re(t)},pt=function(t){return H(t)||qa(t)},SF=0,Qi=function(t){var r=++SF;return"".concat(t||"").concat(r)},zt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!H(t)&&!qa(t))return n;var a;if(ya(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return qs(a)&&(a=n),i&&a>r&&(a=r),a},di=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},jF=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sy(e){"@babel/helpers - typeof";return sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sy(e)}var n1={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Fn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},i1=null,dm=null,ib=function e(t){if(t===i1&&Array.isArray(dm))return dm;var r=[];return k.Children.forEach(t,function(n){re(n)||(dF.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),dm=r,i1=t,r};function Wt(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Fn(i)}):n=[Fn(t)],ib(e).forEach(function(i){var a=mr(i,"type.displayName")||mr(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function fr(e,t){var r=Wt(e,t);return r&&r[0]}var a1=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!H(n)||n<=0||!H(i)||i<=0)},$F=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],CF=function(t){return t&&t.type&&qa(t.type)&&$F.indexOf(t.type)>=0},DA=function(t){return t&&sy(t)==="object"&&"clipDot"in t},MF=function(t,r,n,i){var a,o=(a=fm==null?void 0:fm[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!te(t)&&(i&&o.includes(r)||kF.includes(r))||n&&nb.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(k.isValidElement(t)&&(i=t.props),!Fs(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;MF((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},ly=function e(t,r){if(t===r)return!0;var n=k.Children.count(t);if(n!==k.Children.count(r))return!1;if(n===0)return!0;if(n===1)return o1(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function cy(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=LF(e,IF),f=i||{width:r,height:n,x:0,y:0},d=oe("recharts-surface",a);return _.createElement("svg",uy({},X(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),_.createElement("title",null,s),_.createElement("desc",null,l),t)}var BF=["children","className"];function fy(){return fy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function UF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var se=_.forwardRef(function(e,t){var r=e.children,n=e.className,i=zF(e,BF),a=oe("recharts-layer",n);return _.createElement("g",fy({className:a},X(i,!0),{ref:t}),r)}),en=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:HF(e,t,r)}var VF=KF,GF="\\ud800-\\udfff",QF="\\u0300-\\u036f",YF="\\ufe20-\\ufe2f",XF="\\u20d0-\\u20ff",ZF=QF+YF+XF,JF="\\ufe0e\\ufe0f",eB="\\u200d",tB=RegExp("["+eB+GF+ZF+JF+"]");function rB(e){return tB.test(e)}var IA=rB;function nB(e){return e.split("")}var iB=nB,LA="\\ud800-\\udfff",aB="\\u0300-\\u036f",oB="\\ufe20-\\ufe2f",sB="\\u20d0-\\u20ff",lB=aB+oB+sB,uB="\\ufe0e\\ufe0f",cB="["+LA+"]",dy="["+lB+"]",hy="\\ud83c[\\udffb-\\udfff]",fB="(?:"+dy+"|"+hy+")",FA="[^"+LA+"]",BA="(?:\\ud83c[\\udde6-\\uddff]){2}",zA="[\\ud800-\\udbff][\\udc00-\\udfff]",dB="\\u200d",UA=fB+"?",qA="["+uB+"]?",hB="(?:"+dB+"(?:"+[FA,BA,zA].join("|")+")"+qA+UA+")*",pB=qA+UA+hB,mB="(?:"+[FA+dy+"?",dy,BA,zA,cB].join("|")+")",vB=RegExp(hy+"(?="+hy+")|"+mB+pB,"g");function yB(e){return e.match(vB)||[]}var gB=yB,xB=iB,bB=IA,wB=gB;function SB(e){return bB(e)?wB(e):xB(e)}var jB=SB,OB=VF,PB=IA,_B=jB,kB=NA;function AB(e){return function(t){t=kB(t);var r=PB(t)?_B(t):void 0,n=r?r[0]:t.charAt(0),i=r?OB(r,1).join(""):t.slice(1);return n[e]()+i}}var EB=AB,NB=EB,TB=NB("toUpperCase"),$B=TB;const Yh=Se($B);function Te(e){return function(){return e}}const WA=Math.cos,ed=Math.sin,nn=Math.sqrt,td=Math.PI,Xh=2*td,py=Math.PI,my=2*py,sa=1e-6,CB=my-sa;function HA(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return HA;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;isa)if(!(Math.abs(d*l-u*f)>sa)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,v=i-s,m=l*l+u*u,y=p*p+v*v,b=Math.sqrt(m),g=Math.sqrt(h),x=a*Math.tan((py-Math.acos((m+h-y)/(2*b*g)))/2),S=x/g,w=x/b;Math.abs(S-1)>sa&&this._append`L${t+S*f},${r+S*d}`,this._append`A${a},${a},0,0,${+(d*p>f*v)},${this._x1=t+w*l},${this._y1=r+w*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,f=r+l,d=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>sa||Math.abs(this._y1-f)>sa)&&this._append`L${u},${f}`,n&&(h<0&&(h=h%my+my),h>CB?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:h>sa&&this._append`A${n},${n},0,${+(h>=py)},${d},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ab(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new RB(t)}function ob(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function KA(e){this._context=e}KA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Zh(e){return new KA(e)}function VA(e){return e[0]}function GA(e){return e[1]}function QA(e,t){var r=Te(!0),n=null,i=Zh,a=null,o=ab(s);e=typeof e=="function"?e:e===void 0?VA:Te(e),t=typeof t=="function"?t:t===void 0?GA:Te(t);function s(l){var u,f=(l=ob(l)).length,d,h=!1,p;for(n==null&&(a=i(p=o())),u=0;u<=f;++u)!(u=p;--v)s.point(x[v],S[v]);s.lineEnd(),s.areaEnd()}b&&(x[h]=+e(y,h,d),S[h]=+t(y,h,d),s.point(n?+n(y,h,d):x[h],r?+r(y,h,d):S[h]))}if(g)return s=null,g+""||null}function f(){return QA().defined(i).curve(o).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Te(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Te(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Te(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Te(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Te(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Te(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Te(!!d),u):i},u.curve=function(d){return arguments.length?(o=d,a!=null&&(s=o(a)),u):o},u.context=function(d){return arguments.length?(d==null?a=s=null:s=o(a=d),u):a},u}class YA{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function DB(e){return new YA(e,!0)}function IB(e){return new YA(e,!1)}const sb={draw(e,t){const r=nn(t/td);e.moveTo(r,0),e.arc(0,0,r,0,Xh)}},LB={draw(e,t){const r=nn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},XA=nn(1/3),FB=XA*2,BB={draw(e,t){const r=nn(t/FB),n=r*XA;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},zB={draw(e,t){const r=nn(t),n=-r/2;e.rect(n,n,r,r)}},UB=.8908130915292852,ZA=ed(td/10)/ed(7*td/10),qB=ed(Xh/10)*ZA,WB=-WA(Xh/10)*ZA,HB={draw(e,t){const r=nn(t*UB),n=qB*r,i=WB*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Xh*a/5,s=WA(o),l=ed(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},hm=nn(3),KB={draw(e,t){const r=-nn(t/(hm*3));e.moveTo(0,r*2),e.lineTo(-hm*r,-r),e.lineTo(hm*r,-r),e.closePath()}},Sr=-.5,jr=nn(3)/2,vy=1/nn(12),VB=(vy/2+1)*3,GB={draw(e,t){const r=nn(t/VB),n=r/2,i=r*vy,a=n,o=r*vy+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Sr*n-jr*i,jr*n+Sr*i),e.lineTo(Sr*a-jr*o,jr*a+Sr*o),e.lineTo(Sr*s-jr*l,jr*s+Sr*l),e.lineTo(Sr*n+jr*i,Sr*i-jr*n),e.lineTo(Sr*a+jr*o,Sr*o-jr*a),e.lineTo(Sr*s+jr*l,Sr*l-jr*s),e.closePath()}};function QB(e,t){let r=null,n=ab(i);e=typeof e=="function"?e:Te(e||sb),t=typeof t=="function"?t:Te(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Te(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Te(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function rd(){}function nd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function JA(e){this._context=e}JA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YB(e){return new JA(e)}function eE(e){this._context=e}eE.prototype={areaStart:rd,areaEnd:rd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XB(e){return new eE(e)}function tE(e){this._context=e}tE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZB(e){return new tE(e)}function rE(e){this._context=e}rE.prototype={areaStart:rd,areaEnd:rd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function JB(e){return new rE(e)}function l1(e){return e<0?-1:1}function u1(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(l1(a)+l1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function c1(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function pm(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function id(e){this._context=e}id.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:pm(this,this._t0,c1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,pm(this,c1(this,r=u1(this,e,t)),r);break;default:pm(this,this._t0,r=u1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function nE(e){this._context=new iE(e)}(nE.prototype=Object.create(id.prototype)).point=function(e,t){id.prototype.point.call(this,t,e)};function iE(e){this._context=e}iE.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function e8(e){return new id(e)}function t8(e){return new nE(e)}function aE(e){this._context=e}aE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=f1(e),i=f1(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function n8(e){return new Jh(e,.5)}function i8(e){return new Jh(e,0)}function a8(e){return new Jh(e,1)}function ts(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function o8(e,t){return e[t]}function s8(e){const t=[];return t.key=e,t}function l8(){var e=Te([]),t=yy,r=ts,n=o8;function i(a){var o=Array.from(e.apply(this,arguments),s8),s,l=o.length,u=-1,f;for(const d of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function y8(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var oE={symbolCircle:sb,symbolCross:LB,symbolDiamond:BB,symbolSquare:zB,symbolStar:HB,symbolTriangle:KB,symbolWye:GB},g8=Math.PI/180,x8=function(t){var r="symbol".concat(Yh(t));return oE[r]||sb},b8=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*g8;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},w8=function(t,r){oE["symbol".concat(Yh(t))]=r},ep=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=v8(t,d8),u=h1(h1({},l),{},{type:n,size:a,sizeType:s}),f=function(){var y=x8(n),b=QB().type(y).size(b8(a,s,n));return b()},d=u.className,h=u.cx,p=u.cy,v=X(u,!0);return h===+h&&p===+p&&a===+a?_.createElement("path",gy({},v,{className:oe("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};ep.registerSymbol=w8;function rs(e){"@babel/helpers - typeof";return rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(e)}function xy(){return xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?1:-1},ya=function(t){return qa(t)&&t.indexOf("%")===t.length-1},H=function(t){return gF(t)&&!qs(t)},SF=function(t){return re(t)},pt=function(t){return H(t)||qa(t)},jF=0,Qi=function(t){var r=++jF;return"".concat(t||"").concat(r)},zt=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!H(t)&&!qa(t))return n;var a;if(ya(t)){var o=t.indexOf("%");a=r*parseFloat(t.slice(0,o))/100}else a=+t;return qs(a)&&(a=n),i&&a>r&&(a=r),a},di=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},OF=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $F(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ly(e){"@babel/helpers - typeof";return ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ly(e)}var i1={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Fn=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},a1=null,dm=null,ab=function e(t){if(t===a1&&Array.isArray(dm))return dm;var r=[];return k.Children.forEach(t,function(n){re(n)||(hF.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),dm=r,a1=t,r};function Wt(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Fn(i)}):n=[Fn(t)],ab(e).forEach(function(i){var a=mr(i,"type.displayName")||mr(i,"type.name");n.indexOf(a)!==-1&&r.push(i)}),r}function fr(e,t){var r=Wt(e,t);return r&&r[0]}var o1=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!H(n)||n<=0||!H(i)||i<=0)},CF=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],MF=function(t){return t&&t.type&&qa(t.type)&&CF.indexOf(t.type)>=0},IA=function(t){return t&&ly(t)==="object"&&"clipDot"in t},RF=function(t,r,n,i){var a,o=(a=fm==null?void 0:fm[i])!==null&&a!==void 0?a:[];return r.startsWith("data-")||!te(t)&&(i&&o.includes(r)||AF.includes(r))||n&&ib.includes(r)},X=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(k.isValidElement(t)&&(i=t.props),!Fs(i))return null;var a={};return Object.keys(i).forEach(function(o){var s;RF((s=i)===null||s===void 0?void 0:s[o],o,r,n)&&(a[o]=i[o])}),a},uy=function e(t,r){if(t===r)return!0;var n=k.Children.count(t);if(n!==k.Children.count(r))return!1;if(n===0)return!0;if(n===1)return s1(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function fy(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,l=e.desc,u=FF(e,LF),f=i||{width:r,height:n,x:0,y:0},d=oe("recharts-surface",a);return _.createElement("svg",cy({},X(u,!0,"svg"),{className:d,width:r,height:n,style:o,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height)}),_.createElement("title",null,s),_.createElement("desc",null,l),t)}var zF=["children","className"];function dy(){return dy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function qF(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var se=_.forwardRef(function(e,t){var r=e.children,n=e.className,i=UF(e,zF),a=oe("recharts-layer",n);return _.createElement("g",dy({className:a},X(i,!0),{ref:t}),r)}),en=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;ai?0:i+t),r=r>i?i:r,r<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var a=Array(i);++n=n?e:KF(e,t,r)}var GF=VF,QF="\\ud800-\\udfff",YF="\\u0300-\\u036f",XF="\\ufe20-\\ufe2f",ZF="\\u20d0-\\u20ff",JF=YF+XF+ZF,eB="\\ufe0e\\ufe0f",tB="\\u200d",rB=RegExp("["+tB+QF+JF+eB+"]");function nB(e){return rB.test(e)}var LA=nB;function iB(e){return e.split("")}var aB=iB,FA="\\ud800-\\udfff",oB="\\u0300-\\u036f",sB="\\ufe20-\\ufe2f",lB="\\u20d0-\\u20ff",uB=oB+sB+lB,cB="\\ufe0e\\ufe0f",fB="["+FA+"]",hy="["+uB+"]",py="\\ud83c[\\udffb-\\udfff]",dB="(?:"+hy+"|"+py+")",BA="[^"+FA+"]",zA="(?:\\ud83c[\\udde6-\\uddff]){2}",UA="[\\ud800-\\udbff][\\udc00-\\udfff]",hB="\\u200d",qA=dB+"?",WA="["+cB+"]?",pB="(?:"+hB+"(?:"+[BA,zA,UA].join("|")+")"+WA+qA+")*",mB=WA+qA+pB,vB="(?:"+[BA+hy+"?",hy,zA,UA,fB].join("|")+")",yB=RegExp(py+"(?="+py+")|"+vB+mB,"g");function gB(e){return e.match(yB)||[]}var xB=gB,bB=aB,wB=LA,SB=xB;function jB(e){return wB(e)?SB(e):bB(e)}var OB=jB,PB=GF,_B=LA,kB=OB,AB=TA;function EB(e){return function(t){t=AB(t);var r=_B(t)?kB(t):void 0,n=r?r[0]:t.charAt(0),i=r?PB(r,1).join(""):t.slice(1);return n[e]()+i}}var NB=EB,TB=NB,$B=TB("toUpperCase"),CB=$B;const Yh=Se(CB);function Te(e){return function(){return e}}const HA=Math.cos,ed=Math.sin,nn=Math.sqrt,td=Math.PI,Xh=2*td,my=Math.PI,vy=2*my,sa=1e-6,MB=vy-sa;function KA(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return KA;const r=10**t;return function(n){this._+=n[0];for(let i=1,a=n.length;isa)if(!(Math.abs(d*l-u*f)>sa)||!a)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-o,v=i-s,m=l*l+u*u,y=p*p+v*v,b=Math.sqrt(m),g=Math.sqrt(h),x=a*Math.tan((my-Math.acos((m+h-y)/(2*b*g)))/2),S=x/g,w=x/b;Math.abs(S-1)>sa&&this._append`L${t+S*f},${r+S*d}`,this._append`A${a},${a},0,0,${+(d*p>f*v)},${this._x1=t+w*l},${this._y1=r+w*u}`}}arc(t,r,n,i,a,o){if(t=+t,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(i),l=n*Math.sin(i),u=t+s,f=r+l,d=1^o,h=o?i-a:a-i;this._x1===null?this._append`M${u},${f}`:(Math.abs(this._x1-u)>sa||Math.abs(this._y1-f)>sa)&&this._append`L${u},${f}`,n&&(h<0&&(h=h%vy+vy),h>MB?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=f}`:h>sa&&this._append`A${n},${n},0,${+(h>=my)},${d},${this._x1=t+n*Math.cos(a)},${this._y1=r+n*Math.sin(a)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function ob(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new DB(t)}function sb(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function VA(e){this._context=e}VA.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Zh(e){return new VA(e)}function GA(e){return e[0]}function QA(e){return e[1]}function YA(e,t){var r=Te(!0),n=null,i=Zh,a=null,o=ob(s);e=typeof e=="function"?e:e===void 0?GA:Te(e),t=typeof t=="function"?t:t===void 0?QA:Te(t);function s(l){var u,f=(l=sb(l)).length,d,h=!1,p;for(n==null&&(a=i(p=o())),u=0;u<=f;++u)!(u=p;--v)s.point(x[v],S[v]);s.lineEnd(),s.areaEnd()}b&&(x[h]=+e(y,h,d),S[h]=+t(y,h,d),s.point(n?+n(y,h,d):x[h],r?+r(y,h,d):S[h]))}if(g)return s=null,g+""||null}function f(){return YA().defined(i).curve(o).context(a)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:Te(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:Te(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:Te(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:Te(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:Te(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:Te(+d),u):r},u.lineX0=u.lineY0=function(){return f().x(e).y(t)},u.lineY1=function(){return f().x(e).y(r)},u.lineX1=function(){return f().x(n).y(t)},u.defined=function(d){return arguments.length?(i=typeof d=="function"?d:Te(!!d),u):i},u.curve=function(d){return arguments.length?(o=d,a!=null&&(s=o(a)),u):o},u.context=function(d){return arguments.length?(d==null?a=s=null:s=o(a=d),u):a},u}class XA{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function IB(e){return new XA(e,!0)}function LB(e){return new XA(e,!1)}const lb={draw(e,t){const r=nn(t/td);e.moveTo(r,0),e.arc(0,0,r,0,Xh)}},FB={draw(e,t){const r=nn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},ZA=nn(1/3),BB=ZA*2,zB={draw(e,t){const r=nn(t/BB),n=r*ZA;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},UB={draw(e,t){const r=nn(t),n=-r/2;e.rect(n,n,r,r)}},qB=.8908130915292852,JA=ed(td/10)/ed(7*td/10),WB=ed(Xh/10)*JA,HB=-HA(Xh/10)*JA,KB={draw(e,t){const r=nn(t*qB),n=WB*r,i=HB*r;e.moveTo(0,-r),e.lineTo(n,i);for(let a=1;a<5;++a){const o=Xh*a/5,s=HA(o),l=ed(o);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*i,l*n+s*i)}e.closePath()}},hm=nn(3),VB={draw(e,t){const r=-nn(t/(hm*3));e.moveTo(0,r*2),e.lineTo(-hm*r,-r),e.lineTo(hm*r,-r),e.closePath()}},Sr=-.5,jr=nn(3)/2,yy=1/nn(12),GB=(yy/2+1)*3,QB={draw(e,t){const r=nn(t/GB),n=r/2,i=r*yy,a=n,o=r*yy+r,s=-a,l=o;e.moveTo(n,i),e.lineTo(a,o),e.lineTo(s,l),e.lineTo(Sr*n-jr*i,jr*n+Sr*i),e.lineTo(Sr*a-jr*o,jr*a+Sr*o),e.lineTo(Sr*s-jr*l,jr*s+Sr*l),e.lineTo(Sr*n+jr*i,Sr*i-jr*n),e.lineTo(Sr*a+jr*o,Sr*o-jr*a),e.lineTo(Sr*s+jr*l,Sr*l-jr*s),e.closePath()}};function YB(e,t){let r=null,n=ob(i);e=typeof e=="function"?e:Te(e||lb),t=typeof t=="function"?t:Te(t===void 0?64:+t);function i(){let a;if(r||(r=a=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),a)return r=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Te(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Te(+a),i):t},i.context=function(a){return arguments.length?(r=a??null,i):r},i}function rd(){}function nd(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function eE(e){this._context=e}eE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nd(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XB(e){return new eE(e)}function tE(e){this._context=e}tE.prototype={areaStart:rd,areaEnd:rd,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function ZB(e){return new tE(e)}function rE(e){this._context=e}rE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:nd(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function JB(e){return new rE(e)}function nE(e){this._context=e}nE.prototype={areaStart:rd,areaEnd:rd,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function e8(e){return new nE(e)}function u1(e){return e<0?-1:1}function c1(e,t,r){var n=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(n||i<0&&-0),o=(r-e._y1)/(i||n<0&&-0),s=(a*i+o*n)/(n+i);return(u1(a)+u1(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function f1(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function pm(e,t,r){var n=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-n)/3;e._context.bezierCurveTo(n+s,i+s*t,a-s,o-s*r,a,o)}function id(e){this._context=e}id.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:pm(this,this._t0,f1(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,pm(this,f1(this,r=c1(this,e,t)),r);break;default:pm(this,this._t0,r=c1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function iE(e){this._context=new aE(e)}(iE.prototype=Object.create(id.prototype)).point=function(e,t){id.prototype.point.call(this,t,e)};function aE(e){this._context=e}aE.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,a){this._context.bezierCurveTo(t,e,n,r,a,i)}};function t8(e){return new id(e)}function r8(e){return new iE(e)}function oE(e){this._context=e}oE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=d1(e),i=d1(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function i8(e){return new Jh(e,.5)}function a8(e){return new Jh(e,0)}function o8(e){return new Jh(e,1)}function ts(e,t){if((o=e.length)>1)for(var r=1,n,i,a=e[t[0]],o,s=a.length;r=0;)r[t]=t;return r}function s8(e,t){return e[t]}function l8(e){const t=[];return t.key=e,t}function u8(){var e=Te([]),t=gy,r=ts,n=s8;function i(a){var o=Array.from(e.apply(this,arguments),l8),s,l=o.length,u=-1,f;for(const d of a)for(s=0,++u;s0){for(var r,n,i=0,a=e[0].length,o;i0){for(var r=0,n=e[t[0]],i,a=n.length;r0)||!((a=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,a,o;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function g8(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var sE={symbolCircle:lb,symbolCross:FB,symbolDiamond:zB,symbolSquare:UB,symbolStar:KB,symbolTriangle:VB,symbolWye:QB},x8=Math.PI/180,b8=function(t){var r="symbol".concat(Yh(t));return sE[r]||lb},w8=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*x8;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},S8=function(t,r){sE["symbol".concat(Yh(t))]=r},ep=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,a=i===void 0?64:i,o=t.sizeType,s=o===void 0?"area":o,l=y8(t,h8),u=p1(p1({},l),{},{type:n,size:a,sizeType:s}),f=function(){var y=b8(n),b=YB().type(y).size(w8(a,s,n));return b()},d=u.className,h=u.cx,p=u.cy,v=X(u,!0);return h===+h&&p===+p&&a===+a?_.createElement("path",xy({},v,{className:oe("recharts-symbols",d),transform:"translate(".concat(h,", ").concat(p,")"),d:f()})):null};ep.registerSymbol=S8;function rs(e){"@babel/helpers - typeof";return rs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rs(e)}function by(){return by=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var g=p.inactive?u:p.color;return _.createElement("li",xy({className:y,style:d,key:"legend-item-".concat(v)},zi(n.props,p,v)),_.createElement(cy,{width:o,height:o,viewBox:f,style:h},n.renderIcon(p)),_.createElement("span",{className:"recharts-legend-item-text",style:{color:g}},m?m(b,p,v):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return _.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(k.PureComponent);gu(lb,"displayName","Legend");gu(lb,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var T8=Ih;function $8(){this.__data__=new T8,this.size=0}var C8=$8;function M8(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var R8=M8;function D8(e){return this.__data__.get(e)}var I8=D8;function L8(e){return this.__data__.has(e)}var F8=L8,B8=Ih,z8=Yx,U8=Xx,q8=200;function W8(e,t){var r=this.__data__;if(r instanceof B8){var n=r.__data__;if(!z8||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&dz?new lz:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=v5}var db=y5,g5=Zn,x5=db,b5=Jn,w5="[object Arguments]",S5="[object Array]",j5="[object Boolean]",O5="[object Date]",P5="[object Error]",_5="[object Function]",k5="[object Map]",A5="[object Number]",E5="[object Object]",N5="[object RegExp]",T5="[object Set]",$5="[object String]",C5="[object WeakMap]",M5="[object ArrayBuffer]",R5="[object DataView]",D5="[object Float32Array]",I5="[object Float64Array]",L5="[object Int8Array]",F5="[object Int16Array]",B5="[object Int32Array]",z5="[object Uint8Array]",U5="[object Uint8ClampedArray]",q5="[object Uint16Array]",W5="[object Uint32Array]",Re={};Re[D5]=Re[I5]=Re[L5]=Re[F5]=Re[B5]=Re[z5]=Re[U5]=Re[q5]=Re[W5]=!0;Re[w5]=Re[S5]=Re[M5]=Re[j5]=Re[R5]=Re[O5]=Re[P5]=Re[_5]=Re[k5]=Re[A5]=Re[E5]=Re[N5]=Re[T5]=Re[$5]=Re[C5]=!1;function H5(e){return b5(e)&&x5(e.length)&&!!Re[g5(e)]}var K5=H5;function V5(e){return function(t){return e(t)}}var yE=V5,ld={exports:{}};ld.exports;(function(e,t){var r=OA,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(ld,ld.exports);var G5=ld.exports,Q5=K5,Y5=yE,b1=G5,w1=b1&&b1.isTypedArray,X5=w1?Y5(w1):Q5,gE=X5,Z5=t5,J5=cb,eU=sr,tU=vE,rU=fb,nU=gE,iU=Object.prototype,aU=iU.hasOwnProperty;function oU(e,t){var r=eU(e),n=!r&&J5(e),i=!r&&!n&&tU(e),a=!r&&!n&&!i&&nU(e),o=r||n||i||a,s=o?Z5(e.length,String):[],l=s.length;for(var u in e)(t||aU.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||rU(u,l)))&&s.push(u);return s}var sU=oU,lU=Object.prototype;function uU(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||lU;return e===r}var cU=uU;function fU(e,t){return function(r){return e(t(r))}}var xE=fU,dU=xE,hU=dU(Object.keys,Object),pU=hU,mU=cU,vU=pU,yU=Object.prototype,gU=yU.hasOwnProperty;function xU(e){if(!mU(e))return vU(e);var t=[];for(var r in Object(e))gU.call(e,r)&&r!="constructor"&&t.push(r);return t}var bU=xU,wU=Gx,SU=db;function jU(e){return e!=null&&SU(e.length)&&!wU(e)}var gc=jU,OU=sU,PU=bU,_U=gc;function kU(e){return _U(e)?OU(e):PU(e)}var tp=kU,AU=qz,EU=Jz,NU=tp;function TU(e){return AU(e,NU,EU)}var $U=TU,S1=$U,CU=1,MU=Object.prototype,RU=MU.hasOwnProperty;function DU(e,t,r,n,i,a){var o=r&CU,s=S1(e),l=s.length,u=S1(t),f=u.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var h=s[d];if(!(o?h in t:RU.call(t,h)))return!1}var p=a.get(e),v=a.get(t);if(p&&v)return p==t&&v==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=o;++d-1}var Mq=Cq;function Rq(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=Yq){var u=t?null:Gq(e);if(u)return Qq(u);o=!1,i=Vq,l=new Wq}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hW(e){return e.value}function pW(e,t){if(_.isValidElement(e))return _.cloneElement(e,t);if(typeof e=="function")return _.createElement(e,t);t.ref;var r=fW(t,nW);return _.createElement(lb,r)}var L1=1,ar=function(e){function t(){var r;iW(this,t);for(var n=arguments.length,i=new Array(n),a=0;aL1||Math.abs(i.height-this.lastBoundingBox.height)>L1)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Pn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,d,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();d={left:((u||0)-p.width)/2}}else d=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var v=this.getBBoxSnapshot();h={top:((f||0)-v.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Pn(Pn({},d),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,d=Pn(Pn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return _.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},pW(a,Pn(Pn({},this.props),{},{payload:_E(f,u,hW)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Pn(Pn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&H(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(k.PureComponent);rp(ar,"displayName","Legend");rp(ar,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var F1=yc,mW=cb,vW=sr,B1=F1?F1.isConcatSpreadable:void 0;function yW(e){return vW(e)||mW(e)||!!(B1&&e&&e[B1])}var gW=yW,xW=pE,bW=gW;function EE(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=bW),i||(i=[]);++a0&&r(s)?t>1?EE(s,t-1,r,n,i):xW(i,s):n||(i[i.length]=s)}return i}var NE=EE;function wW(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var SW=wW,jW=SW,OW=jW(),PW=OW,_W=PW,kW=tp;function AW(e,t){return e&&_W(e,t,kW)}var TE=AW,EW=gc;function NW(e,t){return function(r,n){if(r==null)return r;if(!EW(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var WW=qW,gm=Jx,HW=eb,KW=jn,VW=$E,GW=FW,QW=yE,YW=WW,XW=Ks,ZW=sr;function JW(e,t,r){t.length?t=gm(t,function(a){return ZW(a)?function(o){return HW(o,a.length===1?a[0]:a)}:a}):t=[XW];var n=-1;t=gm(t,QW(KW));var i=VW(e,function(a,o,s){var l=gm(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return GW(i,function(a,o){return YW(a,o,r)})}var e9=JW;function t9(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var r9=t9,n9=r9,U1=Math.max;function i9(e,t,r){return t=U1(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=U1(n.length-t,0),o=Array(a);++i0){if(++t>=p9)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var g9=y9,x9=h9,b9=g9,w9=b9(x9),S9=w9,j9=Ks,O9=a9,P9=S9;function _9(e,t){return P9(O9(e,t,j9),e+"")}var k9=_9,A9=Qx,E9=gc,N9=fb,T9=Gi;function $9(e,t,r){if(!T9(r))return!1;var n=typeof t;return(n=="number"?E9(r)&&N9(t,r.length):n=="string"&&t in r)?A9(r[t],e):!1}var np=$9,C9=NE,M9=e9,R9=k9,W1=np,D9=R9(function(e,t){if(e==null)return[];var r=t.length;return r>1&&W1(e,t[0],t[1])?t=[]:r>2&&W1(t[0],t[1],t[2])&&(t=[t[0]]),M9(e,C9(t,1),[])}),I9=D9;const mb=Se(I9);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function ky(){return ky=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(hl,"-left"),H(r)&&t&&H(t.x)&&r=t.y),"".concat(hl,"-top"),H(n)&&t&&H(t.y)&&nm?Math.max(f,l[n]):Math.max(d,l[n])}function Z9(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function J9(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=V1({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),d=V1({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=Z9({translateX:f,translateY:d,useTranslate3d:s})):u=Y9,{cssProperties:u,cssClasses:X9({translateX:f,translateY:d,coordinate:r})}}function is(e){"@babel/helpers - typeof";return is=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},is(e)}function G1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Q1(e){for(var t=1;tY1||Math.abs(n.height-this.state.lastBoundingBox.height)>Y1)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,f=i.coordinate,d=i.hasPayload,h=i.isAnimationActive,p=i.offset,v=i.position,m=i.reverseDirection,y=i.useTranslate3d,b=i.viewBox,g=i.wrapperStyle,x=J9({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:v,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:b}),S=x.cssClasses,w=x.cssProperties,j=Q1(Q1({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},g);return _.createElement("div",{tabIndex:-1,className:S,style:j,ref:function(P){n.wrapperNode=P}},u)}}])}(k.PureComponent),uH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},On={isSsr:uH()};function as(e){"@babel/helpers - typeof";return as=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},as(e)}function X1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Z1(e){for(var t=1;t0;return _.createElement(lH,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:f,hasPayload:j,offset:p,position:y,reverseDirection:b,useTranslate3d:g,viewBox:x,wrapperStyle:S},xH(u,Z1(Z1({},this.props),{},{payload:w})))}}])}(k.PureComponent);vb($e,"displayName","Tooltip");vb($e,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!On.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var bH=Sn,wH=function(){return bH.Date.now()},SH=wH,jH=/\s/;function OH(e){for(var t=e.length;t--&&jH.test(e.charAt(t)););return t}var PH=OH,_H=PH,kH=/^\s+/;function AH(e){return e&&e.slice(0,_H(e)+1).replace(kH,"")}var EH=AH,NH=EH,J1=Gi,TH=Ls,eS=NaN,$H=/^[-+]0x[0-9a-f]+$/i,CH=/^0b[01]+$/i,MH=/^0o[0-7]+$/i,RH=parseInt;function DH(e){if(typeof e=="number")return e;if(TH(e))return eS;if(J1(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=J1(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=NH(e);var r=CH.test(e);return r||MH.test(e)?RH(e.slice(2),r?2:8):$H.test(e)?eS:+e}var LE=DH,IH=Gi,bm=SH,tS=LE,LH="Expected a function",FH=Math.max,BH=Math.min;function zH(e,t,r){var n,i,a,o,s,l,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(LH);t=tS(t)||0,IH(r)&&(f=!!r.leading,d="maxWait"in r,a=d?FH(tS(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function p(j){var O=n,P=i;return n=i=void 0,u=j,o=e.apply(P,O),o}function v(j){return u=j,s=setTimeout(b,t),f?p(j):o}function m(j){var O=j-l,P=j-u,A=t-O;return d?BH(A,a-P):A}function y(j){var O=j-l,P=j-u;return l===void 0||O>=t||O<0||d&&P>=a}function b(){var j=bm();if(y(j))return g(j);s=setTimeout(b,m(j))}function g(j){return s=void 0,h&&n?p(j):(n=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:g(bm())}function w(){var j=bm(),O=y(j);if(n=arguments,i=this,l=j,O){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(b,t),p(l)}return s===void 0&&(s=setTimeout(b,t)),o}return w.cancel=x,w.flush=S,w}var UH=zH,qH=UH,WH=Gi,HH="Expected a function";function KH(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(HH);return WH(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),qH(e,t,{leading:n,maxWait:t,trailing:i})}var VH=KH;const FE=Se(VH);function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function rS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=FE(M,m,{trailing:!0,leading:!1}));var R=new ResizeObserver(M),D=w.current.getBoundingClientRect(),L=D.width,z=D.height;return N(L,z),R.observe(w.current),function(){R.disconnect()}},[N,m]);var T=k.useMemo(function(){var M=A.containerWidth,R=A.containerHeight;if(M<0||R<0)return null;en(ya(o)||ya(l),`The width(%s) and height(%s) are both fixed numbers, + A`).concat(o,",").concat(o,",0,1,1,").concat(s,",").concat(a),className:"recharts-legend-icon"});if(n.type==="rect")return _.createElement("path",{stroke:"none",fill:l,d:"M0,".concat(Or/8,"h").concat(Or,"v").concat(Or*3/4,"h").concat(-Or,"z"),className:"recharts-legend-icon"});if(_.isValidElement(n.legendIcon)){var u=j8({},n);return delete u.legendIcon,_.cloneElement(n.legendIcon,u)}return _.createElement(ep,{fill:l,cx:a,cy:a,size:Or,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,i=this.props,a=i.payload,o=i.iconSize,s=i.layout,l=i.formatter,u=i.inactiveColor,f={x:0,y:0,width:Or,height:Or},d={display:s==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(p,v){var m=p.formatter||l,y=oe(gu(gu({"recharts-legend-item":!0},"legend-item-".concat(v),!0),"inactive",p.inactive));if(p.type==="none")return null;var b=te(p.value)?null:p.value;en(!te(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var g=p.inactive?u:p.color;return _.createElement("li",by({className:y,style:d,key:"legend-item-".concat(v)},zi(n.props,p,v)),_.createElement(fy,{width:o,height:o,viewBox:f,style:h},n.renderIcon(p)),_.createElement("span",{className:"recharts-legend-item-text",style:{color:g}},m?m(b,p,v):b))})}},{key:"render",value:function(){var n=this.props,i=n.payload,a=n.layout,o=n.align;if(!i||!i.length)return null;var s={padding:0,margin:0,textAlign:a==="horizontal"?o:"left"};return _.createElement("ul",{className:"recharts-default-legend",style:s},this.renderItems())}}])}(k.PureComponent);gu(ub,"displayName","Legend");gu(ub,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var $8=Ih;function C8(){this.__data__=new $8,this.size=0}var M8=C8;function R8(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var D8=R8;function I8(e){return this.__data__.get(e)}var L8=I8;function F8(e){return this.__data__.has(e)}var B8=F8,z8=Ih,U8=Xx,q8=Zx,W8=200;function H8(e,t){var r=this.__data__;if(r instanceof z8){var n=r.__data__;if(!U8||n.lengths))return!1;var u=a.get(e),f=a.get(t);if(u&&f)return u==t&&f==e;var d=-1,h=!0,p=r&hz?new uz:void 0;for(a.set(e,t),a.set(t,e);++d-1&&e%1==0&&e-1&&e%1==0&&e<=y5}var hb=g5,x5=Zn,b5=hb,w5=Jn,S5="[object Arguments]",j5="[object Array]",O5="[object Boolean]",P5="[object Date]",_5="[object Error]",k5="[object Function]",A5="[object Map]",E5="[object Number]",N5="[object Object]",T5="[object RegExp]",$5="[object Set]",C5="[object String]",M5="[object WeakMap]",R5="[object ArrayBuffer]",D5="[object DataView]",I5="[object Float32Array]",L5="[object Float64Array]",F5="[object Int8Array]",B5="[object Int16Array]",z5="[object Int32Array]",U5="[object Uint8Array]",q5="[object Uint8ClampedArray]",W5="[object Uint16Array]",H5="[object Uint32Array]",Re={};Re[I5]=Re[L5]=Re[F5]=Re[B5]=Re[z5]=Re[U5]=Re[q5]=Re[W5]=Re[H5]=!0;Re[S5]=Re[j5]=Re[R5]=Re[O5]=Re[D5]=Re[P5]=Re[_5]=Re[k5]=Re[A5]=Re[E5]=Re[N5]=Re[T5]=Re[$5]=Re[C5]=Re[M5]=!1;function K5(e){return w5(e)&&b5(e.length)&&!!Re[x5(e)]}var V5=K5;function G5(e){return function(t){return e(t)}}var gE=G5,ld={exports:{}};ld.exports;(function(e,t){var r=PA,n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,a=i&&i.exports===n,o=a&&r.process,s=function(){try{var l=i&&i.require&&i.require("util").types;return l||o&&o.binding&&o.binding("util")}catch{}}();e.exports=s})(ld,ld.exports);var Q5=ld.exports,Y5=V5,X5=gE,w1=Q5,S1=w1&&w1.isTypedArray,Z5=S1?X5(S1):Y5,xE=Z5,J5=r5,eU=fb,tU=sr,rU=yE,nU=db,iU=xE,aU=Object.prototype,oU=aU.hasOwnProperty;function sU(e,t){var r=tU(e),n=!r&&eU(e),i=!r&&!n&&rU(e),a=!r&&!n&&!i&&iU(e),o=r||n||i||a,s=o?J5(e.length,String):[],l=s.length;for(var u in e)(t||oU.call(e,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||a&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||nU(u,l)))&&s.push(u);return s}var lU=sU,uU=Object.prototype;function cU(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||uU;return e===r}var fU=cU;function dU(e,t){return function(r){return e(t(r))}}var bE=dU,hU=bE,pU=hU(Object.keys,Object),mU=pU,vU=fU,yU=mU,gU=Object.prototype,xU=gU.hasOwnProperty;function bU(e){if(!vU(e))return yU(e);var t=[];for(var r in Object(e))xU.call(e,r)&&r!="constructor"&&t.push(r);return t}var wU=bU,SU=Qx,jU=hb;function OU(e){return e!=null&&jU(e.length)&&!SU(e)}var gc=OU,PU=lU,_U=wU,kU=gc;function AU(e){return kU(e)?PU(e):_U(e)}var tp=AU,EU=Wz,NU=e5,TU=tp;function $U(e){return EU(e,TU,NU)}var CU=$U,j1=CU,MU=1,RU=Object.prototype,DU=RU.hasOwnProperty;function IU(e,t,r,n,i,a){var o=r&MU,s=j1(e),l=s.length,u=j1(t),f=u.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var h=s[d];if(!(o?h in t:DU.call(t,h)))return!1}var p=a.get(e),v=a.get(t);if(p&&v)return p==t&&v==e;var m=!0;a.set(e,t),a.set(t,e);for(var y=o;++d-1}var Rq=Mq;function Dq(e,t,r){for(var n=-1,i=e==null?0:e.length;++n=Xq){var u=t?null:Qq(e);if(u)return Yq(u);o=!1,i=Gq,l=new Hq}else l=t?[]:s;e:for(;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function hW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function pW(e){return e.value}function mW(e,t){if(_.isValidElement(e))return _.cloneElement(e,t);if(typeof e=="function")return _.createElement(e,t);t.ref;var r=dW(t,iW);return _.createElement(ub,r)}var F1=1,ar=function(e){function t(){var r;aW(this,t);for(var n=arguments.length,i=new Array(n),a=0;aF1||Math.abs(i.height-this.lastBoundingBox.height)>F1)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Pn({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,a=i.layout,o=i.align,s=i.verticalAlign,l=i.margin,u=i.chartWidth,f=i.chartHeight,d,h;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&a==="vertical"){var p=this.getBBoxSnapshot();d={left:((u||0)-p.width)/2}}else d=o==="right"?{right:l&&l.right||0}:{left:l&&l.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(s==="middle"){var v=this.getBBoxSnapshot();h={top:((f||0)-v.height)/2}}else h=s==="bottom"?{bottom:l&&l.bottom||0}:{top:l&&l.top||0};return Pn(Pn({},d),h)}},{key:"render",value:function(){var n=this,i=this.props,a=i.content,o=i.width,s=i.height,l=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,d=Pn(Pn({position:"absolute",width:o||"auto",height:s||"auto"},this.getDefaultPosition(l)),l);return _.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(p){n.wrapperNode=p}},mW(a,Pn(Pn({},this.props),{},{payload:kE(f,u,pW)})))}}],[{key:"getWithHeight",value:function(n,i){var a=Pn(Pn({},this.defaultProps),n.props),o=a.layout;return o==="vertical"&&H(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||i}:null}}])}(k.PureComponent);rp(ar,"displayName","Legend");rp(ar,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var B1=yc,vW=fb,yW=sr,z1=B1?B1.isConcatSpreadable:void 0;function gW(e){return yW(e)||vW(e)||!!(z1&&e&&e[z1])}var xW=gW,bW=mE,wW=xW;function NE(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=wW),i||(i=[]);++a0&&r(s)?t>1?NE(s,t-1,r,n,i):bW(i,s):n||(i[i.length]=s)}return i}var TE=NE;function SW(e){return function(t,r,n){for(var i=-1,a=Object(t),o=n(t),s=o.length;s--;){var l=o[e?s:++i];if(r(a[l],l,a)===!1)break}return t}}var jW=SW,OW=jW,PW=OW(),_W=PW,kW=_W,AW=tp;function EW(e,t){return e&&kW(e,t,AW)}var $E=EW,NW=gc;function TW(e,t){return function(r,n){if(r==null)return r;if(!NW(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Object(r);(t?a--:++at||a&&o&&l&&!s&&!u||n&&o&&l||!r&&l||!i)return 1;if(!n&&!a&&!u&&e=s)return l;var u=r[n];return l*(u=="desc"?-1:1)}}return e.index-t.index}var HW=WW,gm=eb,KW=tb,VW=jn,GW=CE,QW=BW,YW=gE,XW=HW,ZW=Ks,JW=sr;function e9(e,t,r){t.length?t=gm(t,function(a){return JW(a)?function(o){return KW(o,a.length===1?a[0]:a)}:a}):t=[ZW];var n=-1;t=gm(t,YW(VW));var i=GW(e,function(a,o,s){var l=gm(t,function(u){return u(a)});return{criteria:l,index:++n,value:a}});return QW(i,function(a,o){return XW(a,o,r)})}var t9=e9;function r9(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var n9=r9,i9=n9,q1=Math.max;function a9(e,t,r){return t=q1(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,a=q1(n.length-t,0),o=Array(a);++i0){if(++t>=m9)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var x9=g9,b9=p9,w9=x9,S9=w9(b9),j9=S9,O9=Ks,P9=o9,_9=j9;function k9(e,t){return _9(P9(e,t,O9),e+"")}var A9=k9,E9=Yx,N9=gc,T9=db,$9=Gi;function C9(e,t,r){if(!$9(r))return!1;var n=typeof t;return(n=="number"?N9(r)&&T9(t,r.length):n=="string"&&t in r)?E9(r[t],e):!1}var np=C9,M9=TE,R9=t9,D9=A9,H1=np,I9=D9(function(e,t){if(e==null)return[];var r=t.length;return r>1&&H1(e,t[0],t[1])?t=[]:r>2&&H1(t[0],t[1],t[2])&&(t=[t[0]]),R9(e,M9(t,1),[])}),L9=I9;const vb=Se(L9);function xu(e){"@babel/helpers - typeof";return xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xu(e)}function Ay(){return Ay=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(hl,"-left"),H(r)&&t&&H(t.x)&&r=t.y),"".concat(hl,"-top"),H(n)&&t&&H(t.y)&&nm?Math.max(f,l[n]):Math.max(d,l[n])}function J9(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function eH(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,u,f,d;return o.height>0&&o.width>0&&r?(f=G1({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:l,viewBoxDimension:l.width}),d=G1({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:l,viewBoxDimension:l.height}),u=J9({translateX:f,translateY:d,useTranslate3d:s})):u=X9,{cssProperties:u,cssClasses:Z9({translateX:f,translateY:d,coordinate:r})}}function is(e){"@babel/helpers - typeof";return is=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},is(e)}function Q1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Y1(e){for(var t=1;tX1||Math.abs(n.height-this.state.lastBoundingBox.height)>X1)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,a=i.active,o=i.allowEscapeViewBox,s=i.animationDuration,l=i.animationEasing,u=i.children,f=i.coordinate,d=i.hasPayload,h=i.isAnimationActive,p=i.offset,v=i.position,m=i.reverseDirection,y=i.useTranslate3d,b=i.viewBox,g=i.wrapperStyle,x=eH({allowEscapeViewBox:o,coordinate:f,offsetTopLeft:p,position:v,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:b}),S=x.cssClasses,w=x.cssProperties,j=Y1(Y1({transition:h&&a?"transform ".concat(s,"ms ").concat(l):void 0},w),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},g);return _.createElement("div",{tabIndex:-1,className:S,style:j,ref:function(P){n.wrapperNode=P}},u)}}])}(k.PureComponent),cH=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},On={isSsr:cH()};function as(e){"@babel/helpers - typeof";return as=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},as(e)}function Z1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function J1(e){for(var t=1;t0;return _.createElement(uH,{allowEscapeViewBox:o,animationDuration:s,animationEasing:l,isAnimationActive:h,active:a,coordinate:f,hasPayload:j,offset:p,position:y,reverseDirection:b,useTranslate3d:g,viewBox:x,wrapperStyle:S},bH(u,J1(J1({},this.props),{},{payload:w})))}}])}(k.PureComponent);yb($e,"displayName","Tooltip");yb($e,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!On.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var wH=Sn,SH=function(){return wH.Date.now()},jH=SH,OH=/\s/;function PH(e){for(var t=e.length;t--&&OH.test(e.charAt(t)););return t}var _H=PH,kH=_H,AH=/^\s+/;function EH(e){return e&&e.slice(0,kH(e)+1).replace(AH,"")}var NH=EH,TH=NH,eS=Gi,$H=Ls,tS=NaN,CH=/^[-+]0x[0-9a-f]+$/i,MH=/^0b[01]+$/i,RH=/^0o[0-7]+$/i,DH=parseInt;function IH(e){if(typeof e=="number")return e;if($H(e))return tS;if(eS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=eS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=TH(e);var r=MH.test(e);return r||RH.test(e)?DH(e.slice(2),r?2:8):CH.test(e)?tS:+e}var FE=IH,LH=Gi,bm=jH,rS=FE,FH="Expected a function",BH=Math.max,zH=Math.min;function UH(e,t,r){var n,i,a,o,s,l,u=0,f=!1,d=!1,h=!0;if(typeof e!="function")throw new TypeError(FH);t=rS(t)||0,LH(r)&&(f=!!r.leading,d="maxWait"in r,a=d?BH(rS(r.maxWait)||0,t):a,h="trailing"in r?!!r.trailing:h);function p(j){var O=n,P=i;return n=i=void 0,u=j,o=e.apply(P,O),o}function v(j){return u=j,s=setTimeout(b,t),f?p(j):o}function m(j){var O=j-l,P=j-u,A=t-O;return d?zH(A,a-P):A}function y(j){var O=j-l,P=j-u;return l===void 0||O>=t||O<0||d&&P>=a}function b(){var j=bm();if(y(j))return g(j);s=setTimeout(b,m(j))}function g(j){return s=void 0,h&&n?p(j):(n=i=void 0,o)}function x(){s!==void 0&&clearTimeout(s),u=0,n=l=i=s=void 0}function S(){return s===void 0?o:g(bm())}function w(){var j=bm(),O=y(j);if(n=arguments,i=this,l=j,O){if(s===void 0)return v(l);if(d)return clearTimeout(s),s=setTimeout(b,t),p(l)}return s===void 0&&(s=setTimeout(b,t)),o}return w.cancel=x,w.flush=S,w}var qH=UH,WH=qH,HH=Gi,KH="Expected a function";function VH(e,t,r){var n=!0,i=!0;if(typeof e!="function")throw new TypeError(KH);return HH(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),WH(e,t,{leading:n,maxWait:t,trailing:i})}var GH=VH;const BE=Se(GH);function wu(e){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wu(e)}function nS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qc(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(M=BE(M,m,{trailing:!0,leading:!1}));var R=new ResizeObserver(M),D=w.current.getBoundingClientRect(),L=D.width,U=D.height;return N(L,U),R.observe(w.current),function(){R.disconnect()}},[N,m]);var T=k.useMemo(function(){var M=A.containerWidth,R=A.containerHeight;if(M<0||R<0)return null;en(ya(o)||ya(l),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,o,l),en(!r||r>0,"The aspect(%s) must be greater than zero.",r);var D=ya(o)?M:o,L=ya(l)?R:l;r&&r>0&&(D?L=D/r:L&&(D=L*r),h&&L>h&&(L=h)),en(D>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,D,L,o,l,f,d,r);var z=!Array.isArray(p)&&Fn(p.type).endsWith("Chart");return _.Children.map(p,function(C){return _.isValidElement(C)?k.cloneElement(C,Qc({width:D,height:L},z?{style:Qc({height:"100%",width:"100%",maxHeight:L,maxWidth:D},C.props.style)}:{})):C})},[r,p,l,h,d,f,A,o]);return _.createElement("div",{id:y?"".concat(y):void 0,className:oe("recharts-responsive-container",b),style:Qc(Qc({},S),{},{width:o,height:l,minWidth:f,minHeight:d,maxHeight:h}),ref:w},T)}),vr=function(t){return null};vr.displayName="Cell";function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function iS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ty(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||On.isSsr)return{width:0,height:0};var n=sK(r),i=JSON.stringify({text:t,copyStyle:n});if(no.widthCache[i])return no.widthCache[i];try{var a=document.getElementById(aS);a||(a=document.createElement("span"),a.setAttribute("id",aS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=Ty(Ty({},oK),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return no.widthCache[i]=l,++no.cacheCount>aK&&(no.cacheCount=0,no.widthCache={}),l}catch{return{width:0,height:0}}},lK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function dd(e,t){return dK(e)||fK(e,t)||cK(e,t)||uK()}function uK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cK(e,t){if(e){if(typeof e=="string")return oS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oS(e,t)}}function oS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _K(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function dS(e,t){return NK(e)||EK(e,t)||AK(e,t)||kK()}function kK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AK(e,t){if(e){if(typeof e=="string")return hS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hS(e,t)}}function hS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function(L,z){var C=z.word,B=z.width,U=L[L.length-1];if(U&&(i==null||a||U.width+B+nz.width?L:z})};if(!f)return p;for(var m="…",y=function(D){var L=d.slice(0,D),z=qE({breakAll:u,style:l,children:L+m}).wordsWithComputedWidth,C=h(z),B=C.length>o||v(C).width>Number(i);return[B,C]},b=0,g=d.length-1,x=0,S;b<=g&&x<=d.length-1;){var w=Math.floor((b+g)/2),j=w-1,O=y(j),P=dS(O,2),A=P[0],E=P[1],N=y(w),T=dS(N,1),M=T[0];if(!A&&!M&&(b=w+1),A&&M&&(g=w-1),!A&&M){S=E;break}x++}return S||p},pS=function(t){var r=re(t)?[]:t.toString().split(UE);return[{words:r}]},$K=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!On.isSsr){var l,u,f=qE({breakAll:o,children:i,style:a});if(f){var d=f.wordsWithComputedWidth,h=f.spaceWidth;l=d,u=h}else return pS(i);return TK({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return pS(i)},mS="#808080",Wa=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,d=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,v=t.verticalAnchor,m=v===void 0?"end":v,y=t.fill,b=y===void 0?mS:y,g=fS(t,OK),x=k.useMemo(function(){return $K({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:d,style:g.style,width:g.width})},[g.breakAll,g.children,g.maxLines,d,g.style,g.width]),S=g.dx,w=g.dy,j=g.angle,O=g.className,P=g.breakAll,A=fS(g,PK);if(!pt(n)||!pt(a))return null;var E=n+(H(S)?S:0),N=a+(H(w)?w:0),T;switch(m){case"start":T=wm("calc(".concat(u,")"));break;case"middle":T=wm("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:T=wm("calc(".concat(x.length-1," * -").concat(s,")"));break}var M=[];if(d){var R=x[0].width,D=g.width;M.push("scale(".concat((H(D)?D/R:1)/R,")"))}return j&&M.push("rotate(".concat(j,", ").concat(E,", ").concat(N,")")),M.length&&(A.transform=M.join(" ")),_.createElement("text",$y({},X(A,!0),{x:E,y:N,className:oe("recharts-text",O),textAnchor:p,fill:b.includes("url")?mS:b}),x.map(function(L,z){var C=L.words.join(P?"":" ");return _.createElement("tspan",{x:E,dy:z===0?T:s,key:"".concat(C,"-").concat(z)},C)}))};function Ii(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function CK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function yb(e){let t,r,n;e.length!==2?(t=Ii,r=(s,l)=>Ii(e(s),l),n=(s,l)=>e(s)-l):(t=e===Ii||e===CK?e:MK,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[d],l)<0?u=d+1:f=d}while(u>>1;r(s[d],l)<=0?u=d+1:f=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:i,center:o,right:a}}function MK(){return 0}function WE(e){return e===null?NaN:+e}function*RK(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const DK=yb(Ii),xc=DK.right;yb(WE).center;class vS extends Map{constructor(t,r=FK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(yS(this,t))}has(t){return super.has(yS(this,t))}set(t,r){return super.set(IK(this,t),r)}delete(t){return super.delete(LK(this,t))}}function yS({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function IK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function LK({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function FK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function BK(e=Ii){if(e===Ii)return HE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function HE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const zK=Math.sqrt(50),UK=Math.sqrt(10),qK=Math.sqrt(2);function hd(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=zK?10:a>=UK?5:a>=qK?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function xS(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function KE(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?HE:BK(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/l+h)),v=Math.min(n,Math.floor(t+(l-u)*d/l+h));KE(e,t,p,v,i)}const a=e[t];let o=r,s=n;for(pl(e,r,t),i(e[n],a)>0&&pl(e,r,n);o0;)--s}i(e[r],a)===0?pl(e,r,s):(++s,pl(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function pl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function WK(e,t,r){if(e=Float64Array.from(RK(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return xS(e);if(t>=1)return gS(e);var n,i=(n-1)*t,a=Math.floor(i),o=gS(KE(e,a).subarray(0,a+1)),s=xS(e.subarray(a+1));return o+(s-o)*(i-a)}}function HK(e,t,r=WE){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function KK(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Xc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Xc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=GK.exec(e))?new Jt(t[1],t[2],t[3],1):(t=QK.exec(e))?new Jt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=YK.exec(e))?Xc(t[1],t[2],t[3],t[4]):(t=XK.exec(e))?Xc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=ZK.exec(e))?_S(t[1],t[2]/100,t[3]/100,1):(t=JK.exec(e))?_S(t[1],t[2]/100,t[3]/100,t[4]):bS.hasOwnProperty(e)?jS(bS[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function jS(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function Xc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Jt(e,t,r,n)}function r7(e){return e instanceof bc||(e=ku(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function Iy(e,t,r,n){return arguments.length===1?r7(e):new Jt(e,t,r,n??1)}function Jt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}xb(Jt,Iy,GE(bc,{brighter(e){return e=e==null?pd:Math.pow(pd,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(Ma(this.r),Ma(this.g),Ma(this.b),md(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:OS,formatHex:OS,formatHex8:n7,formatRgb:PS,toString:PS}));function OS(){return`#${ga(this.r)}${ga(this.g)}${ga(this.b)}`}function n7(){return`#${ga(this.r)}${ga(this.g)}${ga(this.b)}${ga((isNaN(this.opacity)?1:this.opacity)*255)}`}function PS(){const e=md(this.opacity);return`${e===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${e===1?")":`, ${e})`}`}function md(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ma(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ga(e){return e=Ma(e),(e<16?"0":"")+e.toString(16)}function _S(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xr(e,t,r,n)}function QE(e){if(e instanceof Xr)return new Xr(e.h,e.s,e.l,e.opacity);if(e instanceof bc||(e=ku(e)),!e)return new Xr;if(e instanceof Xr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new Xr(o,s,l,e.opacity)}function i7(e,t,r,n){return arguments.length===1?QE(e):new Xr(e,t,r,n??1)}function Xr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}xb(Xr,i7,GE(bc,{brighter(e){return e=e==null?pd:Math.pow(pd,e),new Xr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new Xr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Jt(Sm(e>=240?e-240:e+120,i,n),Sm(e,i,n),Sm(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Xr(kS(this.h),Zc(this.s),Zc(this.l),md(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=md(this.opacity);return`${e===1?"hsl(":"hsla("}${kS(this.h)}, ${Zc(this.s)*100}%, ${Zc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function kS(e){return e=(e||0)%360,e<0?e+360:e}function Zc(e){return Math.max(0,Math.min(1,e||0))}function Sm(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const bb=e=>()=>e;function a7(e,t){return function(r){return e+r*t}}function o7(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function s7(e){return(e=+e)==1?YE:function(t,r){return r-t?o7(t,r,e):bb(isNaN(t)?r:t)}}function YE(e,t){var r=t-e;return r?a7(e,r):bb(isNaN(e)?t:e)}const AS=function e(t){var r=s7(t);function n(i,a){var o=r((i=Iy(i)).r,(a=Iy(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=YE(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function l7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:vd(n,i)})),r=jm.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function x7(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?b7:x7,l=u=null,d}function d(h){return h==null||isNaN(h=+h)?a:(l||(l=s(e.map(n),t,r)))(n(o(h)))}return d.invert=function(h){return o(i((u||(u=s(t,e.map(n),vd)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,yd),f()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),r=wb,f()},d.clamp=function(h){return arguments.length?(o=h?!0:Ut,f()):o!==Ut},d.interpolate=function(h){return arguments.length?(r=h,f()):r},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,p){return n=h,i=p,f()}}function Sb(){return ip()(Ut,Ut)}function w7(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function gd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function os(e){return e=gd(Math.abs(e)),e?e[1]:NaN}function S7(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function j7(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var O7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=O7.exec(e)))throw new Error("invalid format: "+e);var t;return new jb({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Au.prototype=jb.prototype;function jb(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}jb.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function P7(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var xd;function _7(e,t){var r=gd(e,t);if(!r)return xd=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(xd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+gd(e,Math.max(0,t+a-1))[0]}function NS(e,t){var r=gd(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const TS={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:w7,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>NS(e*100,t),r:NS,s:_7,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function $S(e){return e}var CS=Array.prototype.map,MS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function k7(e){var t=e.grouping===void 0||e.thousands===void 0?$S:S7(CS.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?$S:j7(CS.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=Au(d);var p=d.fill,v=d.align,m=d.sign,y=d.symbol,b=d.zero,g=d.width,x=d.comma,S=d.precision,w=d.trim,j=d.type;j==="n"?(x=!0,j="g"):TS[j]||(S===void 0&&(S=12),w=!0,j="g"),(b||p==="0"&&v==="=")&&(b=!0,p="0",v="=");var O=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),P=(y==="$"?n:/[%p]/.test(j)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),A=TS[j],E=/[defgprs%]/.test(j);S=S===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function N(T){var M=O,R=P,D,L,z;if(j==="c")R=A(T)+R,T="";else{T=+T;var C=T<0||1/T<0;if(T=isNaN(T)?l:A(Math.abs(T),S),w&&(T=P7(T)),C&&+T==0&&m!=="+"&&(C=!1),M=(C?m==="("?m:s:m==="-"||m==="("?"":m)+M,R=(j==="s"&&!isNaN(T)&&xd!==void 0?MS[8+xd/3]:"")+R+(C&&m==="("?")":""),E){for(D=-1,L=T.length;++Dz||z>57){R=(z===46?i+T.slice(D+1):T.slice(D))+R,T=T.slice(0,D);break}}}x&&!b&&(T=t(T,1/0));var B=M.length+T.length+R.length,U=B>1)+M+T+R+U.slice(B);break;default:T=U+M+T+R;break}return a(T)}return N.toString=function(){return d+""},N}function f(d,h){var p=Math.max(-8,Math.min(8,Math.floor(os(h)/3)))*3,v=Math.pow(10,-p),m=u((d=Au(d),d.type="f",d),{suffix:MS[8+p/3]});return function(y){return m(v*y)}}return{format:u,formatPrefix:f}}var Jc,Ob,XE;A7({thousands:",",grouping:[3],currency:["$",""]});function A7(e){return Jc=k7(e),Ob=Jc.format,XE=Jc.formatPrefix,Jc}function E7(e){return Math.max(0,-os(Math.abs(e)))}function N7(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(os(t)/3)))*3-os(Math.abs(e)))}function T7(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,os(t)-os(e))+1}function ZE(e,t,r,n){var i=Ry(e,t,r),a;switch(n=Au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=N7(i,o))&&(n.precision=a),XE(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=T7(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=E7(i))&&(n.precision=a-(n.type==="%")*2);break}}return Ob(n)}function Yi(e){var t=e.domain;return e.ticks=function(r){var n=t();return Cy(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return ZE(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,f=10;for(s0;){if(u=My(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function bd(){var e=Sb();return e.copy=function(){return wc(e,bd())},Fr.apply(e,arguments),Yi(e)}function JE(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,yd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return JE(e).unknown(t)},e=arguments.length?Array.from(e,yd):[0,1],Yi(r)}function eN(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function D7(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function IS(e){return(t,r)=>-e(-t,r)}function Pb(e){const t=e(RS,DS),r=t.domain;let n=10,i,a;function o(){return i=D7(n),a=R7(n),r()[0]<0?(i=IS(i),a=IS(a),e($7,C7)):e(RS,DS),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const d=f0){for(;h<=p;++h)for(v=1;vf)break;b.push(m)}}else for(;h<=p;++h)for(v=n-1;v>=1;--v)if(m=h>0?v/a(-h):v*a(h),!(mf)break;b.push(m)}b.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Au(l)).precision==null&&(l.trim=!0),l=Ob(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let d=f/a(Math.round(i(f)));return d*nr(eN(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function tN(){const e=Pb(ip()).domain([1,10]);return e.copy=()=>wc(e,tN()).base(e.base()),Fr.apply(e,arguments),e}function LS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function FS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function _b(e){var t=1,r=e(LS(t),FS(t));return r.constant=function(n){return arguments.length?e(LS(t=+n),FS(t)):t},Yi(r)}function rN(){var e=_b(ip());return e.copy=function(){return wc(e,rN()).constant(e.constant())},Fr.apply(e,arguments)}function BS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function I7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function L7(e){return e<0?-e*e:e*e}function kb(e){var t=e(Ut,Ut),r=1;function n(){return r===1?e(Ut,Ut):r===.5?e(I7,L7):e(BS(r),BS(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Yi(t)}function Ab(){var e=kb(ip());return e.copy=function(){return wc(e,Ab()).exponent(e.exponent())},Fr.apply(e,arguments),e}function F7(){return Ab.apply(null,arguments).exponent(.5)}function zS(e){return Math.sign(e)*e*e}function B7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function nN(){var e=Sb(),t=[0,1],r=!1,n;function i(a){var o=B7(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(zS(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,yd)).map(zS)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return nN(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Fr.apply(i,arguments),Yi(i)}function iN(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return aN().domain([e,t]).range(i).unknown(a)},Fr.apply(Yi(o),arguments)}function oN(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[xc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return oN().domain(e).range(t).unknown(r)},Fr.apply(i,arguments)}const Om=new Date,Pm=new Date;function vt(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uvt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Om.setTime(+a),Pm.setTime(+o),e(Om),e(Pm),Math.floor(r(Om,Pm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const wd=vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);wd.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):wd);wd.range;const Rn=1e3,$r=Rn*60,Dn=$r*60,Hn=Dn*24,Eb=Hn*7,US=Hn*30,_m=Hn*365,xa=vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rn)},(e,t)=>(t-e)/Rn,e=>e.getUTCSeconds());xa.range;const Nb=vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getMinutes());Nb.range;const Tb=vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getUTCMinutes());Tb.range;const $b=vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn-e.getMinutes()*$r)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getHours());$b.range;const Cb=vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getUTCHours());Cb.range;const Sc=vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$r)/Hn,e=>e.getDate()-1);Sc.range;const ap=vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hn,e=>e.getUTCDate()-1);ap.range;const sN=vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hn,e=>Math.floor(e/Hn));sN.range;function Za(e){return vt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*$r)/Eb)}const op=Za(0),Sd=Za(1),z7=Za(2),U7=Za(3),ss=Za(4),q7=Za(5),W7=Za(6);op.range;Sd.range;z7.range;U7.range;ss.range;q7.range;W7.range;function Ja(e){return vt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Eb)}const sp=Ja(0),jd=Ja(1),H7=Ja(2),K7=Ja(3),ls=Ja(4),V7=Ja(5),G7=Ja(6);sp.range;jd.range;H7.range;K7.range;ls.range;V7.range;G7.range;const Mb=vt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Mb.range;const Rb=vt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Rb.range;const Kn=vt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Kn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Kn.range;const Vn=vt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Vn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Vn.range;function lN(e,t,r,n,i,a){const o=[[xa,1,Rn],[xa,5,5*Rn],[xa,15,15*Rn],[xa,30,30*Rn],[a,1,$r],[a,5,5*$r],[a,15,15*$r],[a,30,30*$r],[i,1,Dn],[i,3,3*Dn],[i,6,6*Dn],[i,12,12*Dn],[n,1,Hn],[n,2,2*Hn],[r,1,Eb],[t,1,US],[t,3,3*US],[e,1,_m]];function s(u,f,d){const h=fy).right(o,h);if(p===o.length)return e.every(Ry(u/_m,f/_m,d));if(p===0)return wd.every(Math.max(Ry(u,f,d),1));const[v,m]=o[h/o[p-1][2]53)return null;"w"in W||(W.w=1),"Z"in W?(me=Am(ml(W.y,0,1)),st=me.getUTCDay(),me=st>4||st===0?jd.ceil(me):jd(me),me=ap.offset(me,(W.V-1)*7),W.y=me.getUTCFullYear(),W.m=me.getUTCMonth(),W.d=me.getUTCDate()+(W.w+6)%7):(me=km(ml(W.y,0,1)),st=me.getDay(),me=st>4||st===0?Sd.ceil(me):Sd(me),me=Sc.offset(me,(W.V-1)*7),W.y=me.getFullYear(),W.m=me.getMonth(),W.d=me.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),st="Z"in W?Am(ml(W.y,0,1)).getUTCDay():km(ml(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(st+5)%7:W.w+W.U*7-(st+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,Am(W)):km(W)}}function P(Q,le,fe,W){for(var We=0,me=le.length,st=fe.length,lt,Gt;We=st)return-1;if(lt=le.charCodeAt(We++),lt===37){if(lt=le.charAt(We++),Gt=w[lt in qS?le.charAt(We++):lt],!Gt||(W=Gt(Q,fe,W))<0)return-1}else if(lt!=fe.charCodeAt(W++))return-1}return W}function A(Q,le,fe){var W=u.exec(le.slice(fe));return W?(Q.p=f.get(W[0].toLowerCase()),fe+W[0].length):-1}function E(Q,le,fe){var W=p.exec(le.slice(fe));return W?(Q.w=v.get(W[0].toLowerCase()),fe+W[0].length):-1}function N(Q,le,fe){var W=d.exec(le.slice(fe));return W?(Q.w=h.get(W[0].toLowerCase()),fe+W[0].length):-1}function T(Q,le,fe){var W=b.exec(le.slice(fe));return W?(Q.m=g.get(W[0].toLowerCase()),fe+W[0].length):-1}function M(Q,le,fe){var W=m.exec(le.slice(fe));return W?(Q.m=y.get(W[0].toLowerCase()),fe+W[0].length):-1}function R(Q,le,fe){return P(Q,t,le,fe)}function D(Q,le,fe){return P(Q,r,le,fe)}function L(Q,le,fe){return P(Q,n,le,fe)}function z(Q){return o[Q.getDay()]}function C(Q){return a[Q.getDay()]}function B(Q){return l[Q.getMonth()]}function U(Q){return s[Q.getMonth()]}function G(Q){return i[+(Q.getHours()>=12)]}function q(Q){return 1+~~(Q.getMonth()/3)}function ee(Q){return o[Q.getUTCDay()]}function ce(Q){return a[Q.getUTCDay()]}function V(Q){return l[Q.getUTCMonth()]}function ie(Q){return s[Q.getUTCMonth()]}function Le(Q){return i[+(Q.getUTCHours()>=12)]}function ot(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var le=j(Q+="",x);return le.toString=function(){return Q},le},parse:function(Q){var le=O(Q+="",!1);return le.toString=function(){return Q},le},utcFormat:function(Q){var le=j(Q+="",S);return le.toString=function(){return Q},le},utcParse:function(Q){var le=O(Q+="",!0);return le.toString=function(){return Q},le}}}var qS={"-":"",_:" ",0:"0"},St=/^\s*\d+/,eV=/^%/,tV=/[\\^$*+?|[\]().{}]/g;function ye(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function nV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function iV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function aV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function oV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function sV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function WS(e,t,r){var n=St.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function HS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function lV(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function uV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function cV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function KS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function fV(e,t,r){var n=St.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function VS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function dV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function hV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function pV(e,t,r){var n=St.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function mV(e,t,r){var n=St.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function vV(e,t,r){var n=eV.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function yV(e,t,r){var n=St.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function gV(e,t,r){var n=St.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function GS(e,t){return ye(e.getDate(),t,2)}function xV(e,t){return ye(e.getHours(),t,2)}function bV(e,t){return ye(e.getHours()%12||12,t,2)}function wV(e,t){return ye(1+Sc.count(Kn(e),e),t,3)}function uN(e,t){return ye(e.getMilliseconds(),t,3)}function SV(e,t){return uN(e,t)+"000"}function jV(e,t){return ye(e.getMonth()+1,t,2)}function OV(e,t){return ye(e.getMinutes(),t,2)}function PV(e,t){return ye(e.getSeconds(),t,2)}function _V(e){var t=e.getDay();return t===0?7:t}function kV(e,t){return ye(op.count(Kn(e)-1,e),t,2)}function cN(e){var t=e.getDay();return t>=4||t===0?ss(e):ss.ceil(e)}function AV(e,t){return e=cN(e),ye(ss.count(Kn(e),e)+(Kn(e).getDay()===4),t,2)}function EV(e){return e.getDay()}function NV(e,t){return ye(Sd.count(Kn(e)-1,e),t,2)}function TV(e,t){return ye(e.getFullYear()%100,t,2)}function $V(e,t){return e=cN(e),ye(e.getFullYear()%100,t,2)}function CV(e,t){return ye(e.getFullYear()%1e4,t,4)}function MV(e,t){var r=e.getDay();return e=r>=4||r===0?ss(e):ss.ceil(e),ye(e.getFullYear()%1e4,t,4)}function RV(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ye(t/60|0,"0",2)+ye(t%60,"0",2)}function QS(e,t){return ye(e.getUTCDate(),t,2)}function DV(e,t){return ye(e.getUTCHours(),t,2)}function IV(e,t){return ye(e.getUTCHours()%12||12,t,2)}function LV(e,t){return ye(1+ap.count(Vn(e),e),t,3)}function fN(e,t){return ye(e.getUTCMilliseconds(),t,3)}function FV(e,t){return fN(e,t)+"000"}function BV(e,t){return ye(e.getUTCMonth()+1,t,2)}function zV(e,t){return ye(e.getUTCMinutes(),t,2)}function UV(e,t){return ye(e.getUTCSeconds(),t,2)}function qV(e){var t=e.getUTCDay();return t===0?7:t}function WV(e,t){return ye(sp.count(Vn(e)-1,e),t,2)}function dN(e){var t=e.getUTCDay();return t>=4||t===0?ls(e):ls.ceil(e)}function HV(e,t){return e=dN(e),ye(ls.count(Vn(e),e)+(Vn(e).getUTCDay()===4),t,2)}function KV(e){return e.getUTCDay()}function VV(e,t){return ye(jd.count(Vn(e)-1,e),t,2)}function GV(e,t){return ye(e.getUTCFullYear()%100,t,2)}function QV(e,t){return e=dN(e),ye(e.getUTCFullYear()%100,t,2)}function YV(e,t){return ye(e.getUTCFullYear()%1e4,t,4)}function XV(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ls(e):ls.ceil(e),ye(e.getUTCFullYear()%1e4,t,4)}function ZV(){return"+0000"}function YS(){return"%"}function XS(e){return+e}function ZS(e){return Math.floor(+e/1e3)}var io,hN,pN;JV({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function JV(e){return io=J7(e),hN=io.format,io.parse,pN=io.utcFormat,io.utcParse,io}function eG(e){return new Date(e)}function tG(e){return e instanceof Date?+e:+new Date(+e)}function Db(e,t,r,n,i,a,o,s,l,u){var f=Sb(),d=f.invert,h=f.domain,p=u(".%L"),v=u(":%S"),m=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),g=u("%b %d"),x=u("%B"),S=u("%Y");function w(j){return(l(j)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>WK(e,a/n))},r.copy=function(){return gN(t).domain(e)},ei.apply(r,arguments)}function up(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Ut,f,d=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+f(m))-a)*(n*mt}var SN=lG,uG=cp,cG=SN,fG=Ks;function dG(e){return e&&e.length?uG(e,fG,cG):void 0}var hG=dG;const Oi=Se(hG);function pG(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};J.decimalPlaces=J.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*De;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};J.dividedBy=J.div=function(e){return Bn(this,new this.constructor(e))};J.dividedToIntegerBy=J.idiv=function(e){var t=this,r=t.constructor;return Ee(Bn(t,new r(e),0,1),r.precision)};J.equals=J.eq=function(e){return!this.cmp(e)};J.exponent=function(){return nt(this)};J.greaterThan=J.gt=function(e){return this.cmp(e)>0};J.greaterThanOrEqualTo=J.gte=function(e){return this.cmp(e)>=0};J.isInteger=J.isint=function(){return this.e>this.d.length-2};J.isNegative=J.isneg=function(){return this.s<0};J.isPositive=J.ispos=function(){return this.s>0};J.isZero=function(){return this.s===0};J.lessThan=J.lt=function(e){return this.cmp(e)<0};J.lessThanOrEqualTo=J.lte=function(e){return this.cmp(e)<1};J.logarithm=J.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(dr))throw Error(Ir+"NaN");if(r.s<1)throw Error(Ir+(r.s?"NaN":"-Infinity"));return r.eq(dr)?new n(0):(Be=!1,t=Bn(Eu(r,a),Eu(e,a),a),Be=!0,Ee(t,i))};J.minus=J.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kN(t,e):PN(t,(e.s=-e.s,e))};J.modulo=J.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Ir+"NaN");return r.s?(Be=!1,t=Bn(r,e,0,1).times(e),Be=!0,r.minus(t)):Ee(new n(r),i)};J.naturalExponential=J.exp=function(){return _N(this)};J.naturalLogarithm=J.ln=function(){return Eu(this)};J.negated=J.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};J.plus=J.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?PN(t,e):kN(t,(e.s=-e.s,e))};J.precision=J.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ra+e);if(t=nt(i)+1,n=i.d.length-1,r=n*De+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};J.squareRoot=J.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Ir+"NaN")}for(e=nt(s),Be=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=hn(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Qs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Bn(s,a,o+2)).times(.5),hn(a.d).slice(0,o)===(t=hn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Ee(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return Be=!0,Ee(n,r)};J.times=J.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,d=f.constructor,h=f.d,p=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,l=h.length,u=p.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+p[n]*h[i-n-1]+t,a[i--]=s%gt|0,t=s/gt|0;a[i]=(a[i]+t)%gt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,Be?Ee(e,d.precision):e};J.toDecimalPlaces=J.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(bn(e,0,Gs),t===void 0?t=n.rounding:bn(t,0,8),Ee(r,e+nt(r)+1,t))};J.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ha(n,!0):(bn(e,0,Gs),t===void 0?t=i.rounding:bn(t,0,8),n=Ee(new i(n),e+1,t),r=Ha(n,!0,e+1)),r};J.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Ha(i):(bn(e,0,Gs),t===void 0?t=a.rounding:bn(t,0,8),n=Ee(new a(i),e+nt(i)+1,t),r=Ha(n.abs(),!1,e+nt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};J.toInteger=J.toint=function(){var e=this,t=e.constructor;return Ee(new t(e),nt(e)+1,t.rounding)};J.toNumber=function(){return+this};J.toPower=J.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(dr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Ir+"Infinity");return s}if(s.eq(dr))return s;if(n=l.precision,e.eq(dr))return Ee(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=ON){for(i=new l(dr),t=Math.ceil(n/De+4),Be=!1;r%2&&(i=i.times(s),tj(i.d,t)),r=Qs(r/2),r!==0;)s=s.times(s),tj(s.d,t);return Be=!0,e.s<0?new l(dr).div(i):Ee(i,n)}}else if(a<0)throw Error(Ir+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,Be=!1,i=e.times(Eu(s,n+u)),Be=!0,i=_N(i),i.s=a,i};J.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=nt(i),n=Ha(i,r<=a.toExpNeg||r>=a.toExpPos)):(bn(e,1,Gs),t===void 0?t=a.rounding:bn(t,0,8),i=Ee(new a(i),e,t),r=nt(i),n=Ha(i,e<=r||r<=a.toExpNeg,e)),n};J.toSignificantDigits=J.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(bn(e,1,Gs),t===void 0?t=n.rounding:bn(t,0,8)),Ee(new n(r),e,t)};J.toString=J.valueOf=J.val=J.toJSON=J[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=nt(e),r=e.constructor;return Ha(e,t<=r.toExpNeg||t>=r.toExpPos)};function PN(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Be?Ee(t,d):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(d/De),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/gt|0,l[a]%=gt;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,Be?Ee(t,d):t}function bn(e,t,r){if(e!==~~e||er)throw Error(Ra+e)}function hn(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,f,d,h,p,v,m,y,b,g,x,S,w,j,O,P,A=n.constructor,E=n.s==i.s?1:-1,N=n.d,T=i.d;if(!n.s)return new A(n);if(!i.s)throw Error(Ir+"Division by zero");for(l=n.e-i.e,O=T.length,w=N.length,p=new A(E),v=p.d=[],u=0;T[u]==(N[u]||0);)++u;if(T[u]>(N[u]||0)&&--l,a==null?g=a=A.precision:o?g=a+(nt(n)-nt(i))+1:g=a,g<0)return new A(0);if(g=g/De+2|0,u=0,O==1)for(f=0,T=T[0],g++;(u1&&(T=e(T,f),N=e(N,f),O=T.length,w=N.length),S=O,m=N.slice(0,O),y=m.length;y=gt/2&&++j;do f=0,s=t(T,m,O,y),s<0?(b=m[0],O!=y&&(b=b*gt+(m[1]||0)),f=b/j|0,f>1?(f>=gt&&(f=gt-1),d=e(T,f),h=d.length,y=m.length,s=t(d,m,h,y),s==1&&(f--,r(d,O16)throw Error(Fb+nt(e));if(!e.s)return new f(dr);for(Be=!1,s=d,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(ua(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(dr),f.precision=s;;){if(i=Ee(i.times(e),s),r=r.times(++l),o=a.plus(Bn(i,r,s)),hn(o.d).slice(0,s)===hn(a.d).slice(0,s)){for(;u--;)a=Ee(a.times(a),s);return f.precision=d,t==null?(Be=!0,Ee(a,d)):a}a=o}}function nt(e){for(var t=e.e*De,r=e.d[0];r>=10;r/=10)t++;return t}function Em(e,t,r){if(t>e.LN10.sd())throw Be=!0,r&&(e.precision=r),Error(Ir+"LN10 precision limit exceeded");return Ee(new e(e.LN10),t)}function ui(e){for(var t="";e--;)t+="0";return t}function Eu(e,t){var r,n,i,a,o,s,l,u,f,d=1,h=10,p=e,v=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(Ir+(p.s?"NaN":"-Infinity"));if(p.eq(dr))return new m(0);if(t==null?(Be=!1,u=y):u=t,p.eq(10))return t==null&&(Be=!0),Em(m,u);if(u+=h,m.precision=u,r=hn(v),n=r.charAt(0),a=nt(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=hn(p.d),n=r.charAt(0),d++;a=nt(p),n>1?(p=new m("0."+r),a++):p=new m(n+"."+r.slice(1))}else return l=Em(m,u+2,y).times(a+""),p=Eu(new m(n+"."+r.slice(1)),u-h).plus(l),m.precision=y,t==null?(Be=!0,Ee(p,y)):p;for(s=o=p=Bn(p.minus(dr),p.plus(dr),u),f=Ee(p.times(p),u),i=3;;){if(o=Ee(o.times(f),u),l=s.plus(Bn(o,new m(i),u)),hn(l.d).slice(0,u)===hn(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(Em(m,u+2,y).times(a+""))),s=Bn(s,new m(d),u),m.precision=y,t==null?(Be=!0,Ee(s,y)):s;s=l,i+=2}}function ej(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Qs(r/De),e.d=[],n=(r+1)%De,r<0&&(n+=De),nOd||e.e<-Od))throw Error(Fb+r)}else e.s=0,e.e=0,e.d=[0];return e}function Ee(e,t,r){var n,i,a,o,s,l,u,f,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=De,i=t,u=d[f=0];else{if(f=Math.ceil((n+1)/De),a=d.length,f>=a)return e;for(u=a=d[f],o=1;a>=10;a/=10)o++;n%=De,i=n-De+o}if(r!==void 0&&(a=ua(10,o-i-1),s=u/a%10|0,l=t<0||d[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/ua(10,o-i):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(a=nt(e),d.length=1,t=t-a-1,d[0]=ua(10,(De-t%De)%De),e.e=Qs(-t/De)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,a=1,f--):(d.length=f+1,a=ua(10,De-n),d[f]=i>0?(u/ua(10,o-i)%ua(10,i)|0)*a:0),l)for(;;)if(f==0){(d[0]+=a)==gt&&(d[0]=1,++e.e);break}else{if(d[f]+=a,d[f]!=gt)break;d[f--]=0,a=1}for(n=d.length;d[--n]===0;)d.pop();if(Be&&(e.e>Od||e.e<-Od))throw Error(Fb+nt(e));return e}function kN(e,t){var r,n,i,a,o,s,l,u,f,d,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Be?Ee(t,p):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=d.length):(r=d,n=u,s=l.length),i=Math.max(Math.ceil(p/De),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=d.length,f=i0;--i)l[s++]=0;for(i=d.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+ui(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ui(-i-1)+a,r&&(n=r-o)>0&&(a+=ui(n))):i>=o?(a+=ui(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+ui(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=ui(n))),e.s<0?"-"+a:a}function tj(e,t){if(e.length>t)return e.length=t,!0}function AN(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ra+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return ej(o,a.toString())}else if(typeof a!="string")throw Error(Ra+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,RG.test(a))ej(o,a);else throw Error(Ra+a)}if(i.prototype=J,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=AN,i.config=i.set=DG,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Ra+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ra+r+": "+n);return this}var Bb=AN(MG);dr=new Bb(1);const _e=Bb;function IG(e){return zG(e)||BG(e)||FG(e)||LG()}function LG(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FG(e,t){if(e){if(typeof e=="string")return By(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return By(e,t)}}function BG(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function zG(e){if(Array.isArray(e))return By(e)}function By(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,rj(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function rQ(e){if(Array.isArray(e))return e}function CN(e){var t=Nu(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function MN(e,t,r){if(e.lte(0))return new _e(0);var n=hp.getDigitCount(e.toNumber()),i=new _e(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new _e(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new _e(Math.ceil(l))}function nQ(e,t,r){var n=1,i=new _e(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new _e(10).pow(hp.getDigitCount(e)-1),i=new _e(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new _e(Math.floor(e)))}else e===0?i=new _e(Math.floor((t-1)/2)):r||(i=new _e(Math.floor(e)));var o=Math.floor((t-1)/2),s=HG(WG(function(l){return i.add(new _e(l-o).mul(n)).toNumber()}),zy);return s(0,t)}function RN(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new _e(0),tickMin:new _e(0),tickMax:new _e(0)};var a=MN(new _e(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new _e(0):(o=new _e(e).add(t).div(2),o=o.sub(new _e(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new _e(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?RN(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new _e(s).mul(a)),tickMax:o.add(new _e(l).mul(a))})}function iQ(e){var t=Nu(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=CN([r,n]),l=Nu(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(qy(zy(0,i-1).map(function(){return 1/0}))):[].concat(qy(zy(0,i-1).map(function(){return-1/0})),[f]);return r>n?Uy(d):d}if(u===f)return nQ(u,i,a);var h=RN(u,f,o,a),p=h.step,v=h.tickMin,m=h.tickMax,y=hp.rangeStep(v,m.add(new _e(.1).mul(p)),p);return r>n?Uy(y):y}function aQ(e,t){var r=Nu(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=CN([n,i]),s=Nu(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),d=MN(new _e(u).sub(l).div(f-1),a,0),h=[].concat(qy(hp.rangeStep(new _e(l),new _e(u).sub(new _e(.99).mul(d)),d)),[u]);return n>i?Uy(h):h}var oQ=TN(iQ),sQ=TN(aQ),lQ="Invariant failed";function Ka(e,t){throw new Error(lQ)}var uQ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function yQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gQ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,d=i[u].coordinate,h=u>=s-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(Bt(d-f)!==Bt(h-d)){var v=[];if(Bt(h-d)===Bt(l[1]-l[0])){p=h;var m=d+l[1]-l[0];v[0]=Math.min(m,(m+f)/2),v[1]=Math.max(m,(m+f)/2)}else{p=f;var y=h+l[1]-l[0];v[0]=Math.min(d,(y+d)/2),v[1]=Math.max(d,(y+d)/2)}var b=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>b[0]&&t<=b[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var g=Math.min(f,h),x=Math.max(f,h);if(t>(g+d)/2&&t<=(x+d)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},zb=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ve(Ve({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},RQ=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(b&&b.length){var g=b[0].type.defaultProps,x=g!==void 0?Ve(Ve({},g),b[0].props):b[0].props,S=x.barSize,w=x[y];o[w]||(o[w]=[]);var j=re(S)?r:S;o[w].push({item:b[0],stackList:b.slice(1),barSize:re(j)?void 0:zt(j,n,0)})}}return o},DQ=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=zt(r,i,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/l,v=o.reduce(function(S,w){return S+w.barSize||0},0);v+=(l-1)*u,v>=i&&(v-=(l-1)*u,u=0),v>=i&&p>0&&(h=!0,p*=.9,v=l*p);var m=(i-v)/2>>0,y={offset:m-u,size:0};f=o.reduce(function(S,w){var j={item:w.item,position:{offset:y.offset+y.size+u,size:h?p:w.barSize}},O=[].concat(aj(S),[j]);return y=O[O.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(P){O.push({item:P,position:y})}),O},d)}else{var b=zt(n,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var g=(i-2*b-(l-1)*u)/l;g>1&&(g>>=0);var x=s===+s?Math.min(g,s):g;f=o.reduce(function(S,w,j){var O=[].concat(aj(S),[{item:w.item,position:{offset:b+(g+u)*j+(g-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(P){O.push({item:P,position:O[O.length-1].position})}),O},d)}return f},IQ=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=FN({children:a,legendWidth:l});if(u){var f=i||{},d=f.width,h=f.height,p=u.align,v=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&v==="middle")&&p!=="center"&&H(t[p]))return Ve(Ve({},t),{},Mo({},p,t[p]+(d||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&v!=="middle"&&H(t[v]))return Ve(Ve({},t),{},Mo({},v,t[v]+(h||0)))}return t},LQ=function(t,r,n){return re(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},BN=function(t,r,n,i,a){var o=r.props.children,s=Wt(o,Ys).filter(function(u){return LQ(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Ae(f,n);if(re(d))return u;var h=Array.isArray(d)?[fp(d),Oi(d)]:[d,d],p=l.reduce(function(v,m){var y=Ae(f,m,0),b=h[0]-Math.abs(Array.isArray(y)?y[0]:y),g=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(b,v[0]),Math.max(g,v[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},FQ=function(t,r,n,i,a){var o=r.map(function(s){return BN(t,s,n,a,i)}).filter(function(s){return!re(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},zN=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&BN(t,l,u,i)||Ul(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,d=u.length;f=2?Bt(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var h=a?a.indexOf(d):d;return{coordinate:i(h)+u,value:d,offset:u}});return f.filter(function(d){return!qs(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,h){return{coordinate:i(d)+u,value:d,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(d){return{coordinate:i(d)+u,value:d,offset:u}}):i.domain().map(function(d,h){return{coordinate:i(d)+u,value:a?a[d]:d,index:h,offset:u}})},Nm=new WeakMap,ef=function(t,r){if(typeof r!="function")return t;Nm.has(t)||Nm.set(t,new WeakMap);var n=Nm.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},WN=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Ou(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:bd(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:zl(),realScaleType:"point"}:a==="category"?{scale:Ou(),realScaleType:"band"}:{scale:bd(),realScaleType:"linear"};if(qa(i)){var l="scale".concat(Yh(i));return{scale:(JS[l]||zl)(),realScaleType:JS[l]?l:"point"}}return te(i)?{scale:i}:{scale:zl(),realScaleType:"point"}},sj=1e-4,HN=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-sj,o=Math.max(i[0],i[1])+sj,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},BQ=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},qQ=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},WQ={sign:UQ,expand:u8,none:ts,silhouette:c8,wiggle:f8,positive:qQ},HQ=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=WQ[n],o=l8().keys(i).value(function(s,l){return+Ae(s,l,0)}).order(yy).offset(a);return o(t)},KQ=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(d,h){var p,v=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Ve(Ve({},h.type.defaultProps),h.props):h.props,m=v.stackId,y=v.hide;if(y)return d;var b=v[n],g=d[b]||{hasStack:!1,stackGroups:{}};if(pt(m)){var x=g.stackGroups[m]||{numericAxisId:n,cateAxisId:i,items:[]};x.items.push(h),g.hasStack=!0,g.stackGroups[m]=x}else g.stackGroups[Qi("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return Ve(Ve({},d),{},Mo({},b,g))},l),f={};return Object.keys(u).reduce(function(d,h){var p=u[h];if(p.hasStack){var v={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var b=p.stackGroups[y];return Ve(Ve({},m),{},Mo({},y,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:HQ(t,b.items,a)}))},v)}return Ve(Ve({},d),{},Mo({},h,p))},f)},KN=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=oQ(u,a,s);return t.domain([fp(f),Oi(f)]),{niceTicks:f}}if(a&&i==="number"){var d=t.domain(),h=sQ(d,a,s);return{niceTicks:h}}return null};function cs(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!re(i[t.dataKey])){var s=Zf(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Ae(i,re(o)?t.dataKey:o);return re(l)?null:t.scale(l)}var lj=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Ae(o,r.dataKey,r.domain[s]);return re(l)?null:r.scale(l)-a/2+i},VQ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},GQ=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ve(Ve({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(pt(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},QQ=function(t){return t.reduce(function(r,n){return[fp(n.concat([r[0]]).filter(H)),Oi(n.concat([r[1]]).filter(H))]},[1/0,-1/0])},VN=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var d=QQ(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},uj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,cj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Vy=function(t,r,n){if(te(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(H(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(uj.test(t[0])){var a=+uj.exec(t[0])[1];i[0]=r[0]-a}else te(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(H(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(cj.test(t[1])){var o=+cj.exec(t[1])[1];i[1]=r[1]+o}else te(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},kd=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=mb(r,function(d){return d.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},XN=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=zt(t.cx,o,o/2),d=zt(t.cy,s,s/2),h=YN(o,s,n),p=zt(t.innerRadius,h,0),v=zt(t.outerRadius,h,h*.8),m=Object.keys(r);return m.reduce(function(y,b){var g=r[b],x=g.domain,S=g.reversed,w;if(re(g.range))i==="angleAxis"?w=[l,u]:i==="radiusAxis"&&(w=[p,v]),S&&(w=[w[1],w[0]]);else{w=g.range;var j=w,O=ZQ(j,2);l=O[0],u=O[1]}var P=WN(g,a),A=P.realScaleType,E=P.scale;E.domain(x).range(w),HN(E);var N=KN(E,An(An({},g),{},{realScaleType:A})),T=An(An(An({},g),N),{},{range:w,radius:v,realScaleType:A,scale:E,cx:f,cy:d,innerRadius:p,outerRadius:v,startAngle:l,endAngle:u});return An(An({},y),{},QN({},b,T))},{})},iY=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},aY=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=iY({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:nY(u),angleInRadian:u}},oY=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},sY=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},pj=function(t,r){var n=t.x,i=t.y,a=aY({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=oY(r),d=f.startAngle,h=f.endAngle,p=s,v;if(d<=h){for(;p>h;)p-=360;for(;p=d&&p<=h}else{for(;p>d;)p-=360;for(;p=h&&p<=d}return v?An(An({},r),{},{radius:o,angle:sY(p,r)}):null},ZN=function(t){return!k.isValidElement(t)&&!te(t)&&typeof t!="boolean"?t.className:""};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}var lY=["offset"];function uY(e){return hY(e)||dY(e)||fY(e)||cY()}function cY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fY(e,t){if(e){if(typeof e=="string")return Gy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gy(e,t)}}function dY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hY(e){if(Array.isArray(e))return Gy(e)}function Gy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function mj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t=0?1:-1,x,S;i==="insideStart"?(x=p+g*o,S=m):i==="insideEnd"?(x=v-g*o,S=!m):i==="end"&&(x=v+g*o,S=m),S=b<=0?S:!S;var w=ge(u,f,y,x),j=ge(u,f,y,x+(S?1:-1)*359),O="M".concat(w.x,",").concat(w.y,` + height and width.`,D,L,o,l,f,d,r);var U=!Array.isArray(p)&&Fn(p.type).endsWith("Chart");return _.Children.map(p,function(C){return _.isValidElement(C)?k.cloneElement(C,Qc({width:D,height:L},U?{style:Qc({height:"100%",width:"100%",maxHeight:L,maxWidth:D},C.props.style)}:{})):C})},[r,p,l,h,d,f,A,o]);return _.createElement("div",{id:y?"".concat(y):void 0,className:oe("recharts-responsive-container",b),style:Qc(Qc({},S),{},{width:o,height:l,minWidth:f,minHeight:d,maxHeight:h}),ref:w},T)}),vr=function(t){return null};vr.displayName="Cell";function Su(e){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Su(e)}function aS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $y(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||On.isSsr)return{width:0,height:0};var n=lK(r),i=JSON.stringify({text:t,copyStyle:n});if(no.widthCache[i])return no.widthCache[i];try{var a=document.getElementById(oS);a||(a=document.createElement("span"),a.setAttribute("id",oS),a.setAttribute("aria-hidden","true"),document.body.appendChild(a));var o=$y($y({},sK),n);Object.assign(a.style,o),a.textContent="".concat(t);var s=a.getBoundingClientRect(),l={width:s.width,height:s.height};return no.widthCache[i]=l,++no.cacheCount>oK&&(no.cacheCount=0,no.widthCache={}),l}catch{return{width:0,height:0}}},uK=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}function dd(e,t){return hK(e)||dK(e,t)||fK(e,t)||cK()}function cK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fK(e,t){if(e){if(typeof e=="string")return sS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sS(e,t)}}function sS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function hS(e,t){return TK(e)||NK(e,t)||EK(e,t)||AK()}function AK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EK(e,t){if(e){if(typeof e=="string")return pS(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pS(e,t)}}function pS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return D.reduce(function(L,U){var C=U.word,F=U.width,z=L[L.length-1];if(z&&(i==null||a||z.width+F+nU.width?L:U})};if(!f)return p;for(var m="…",y=function(D){var L=d.slice(0,D),U=WE({breakAll:u,style:l,children:L+m}).wordsWithComputedWidth,C=h(U),F=C.length>o||v(C).width>Number(i);return[F,C]},b=0,g=d.length-1,x=0,S;b<=g&&x<=d.length-1;){var w=Math.floor((b+g)/2),j=w-1,O=y(j),P=hS(O,2),A=P[0],E=P[1],N=y(w),T=hS(N,1),M=T[0];if(!A&&!M&&(b=w+1),A&&M&&(g=w-1),!A&&M){S=E;break}x++}return S||p},mS=function(t){var r=re(t)?[]:t.toString().split(qE);return[{words:r}]},CK=function(t){var r=t.width,n=t.scaleToFit,i=t.children,a=t.style,o=t.breakAll,s=t.maxLines;if((r||n)&&!On.isSsr){var l,u,f=WE({breakAll:o,children:i,style:a});if(f){var d=f.wordsWithComputedWidth,h=f.spaceWidth;l=d,u=h}else return mS(i);return $K({breakAll:o,children:i,maxLines:s,style:a},l,u,r,n)}return mS(i)},vS="#808080",Wa=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.lineHeight,s=o===void 0?"1em":o,l=t.capHeight,u=l===void 0?"0.71em":l,f=t.scaleToFit,d=f===void 0?!1:f,h=t.textAnchor,p=h===void 0?"start":h,v=t.verticalAnchor,m=v===void 0?"end":v,y=t.fill,b=y===void 0?vS:y,g=dS(t,PK),x=k.useMemo(function(){return CK({breakAll:g.breakAll,children:g.children,maxLines:g.maxLines,scaleToFit:d,style:g.style,width:g.width})},[g.breakAll,g.children,g.maxLines,d,g.style,g.width]),S=g.dx,w=g.dy,j=g.angle,O=g.className,P=g.breakAll,A=dS(g,_K);if(!pt(n)||!pt(a))return null;var E=n+(H(S)?S:0),N=a+(H(w)?w:0),T;switch(m){case"start":T=wm("calc(".concat(u,")"));break;case"middle":T=wm("calc(".concat((x.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:T=wm("calc(".concat(x.length-1," * -").concat(s,")"));break}var M=[];if(d){var R=x[0].width,D=g.width;M.push("scale(".concat((H(D)?D/R:1)/R,")"))}return j&&M.push("rotate(".concat(j,", ").concat(E,", ").concat(N,")")),M.length&&(A.transform=M.join(" ")),_.createElement("text",Cy({},X(A,!0),{x:E,y:N,className:oe("recharts-text",O),textAnchor:p,fill:b.includes("url")?vS:b}),x.map(function(L,U){var C=L.words.join(P?"":" ");return _.createElement("tspan",{x:E,dy:U===0?T:s,key:"".concat(C,"-").concat(U)},C)}))};function Ii(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function MK(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function gb(e){let t,r,n;e.length!==2?(t=Ii,r=(s,l)=>Ii(e(s),l),n=(s,l)=>e(s)-l):(t=e===Ii||e===MK?e:RK,r=e,n=e);function i(s,l,u=0,f=s.length){if(u>>1;r(s[d],l)<0?u=d+1:f=d}while(u>>1;r(s[d],l)<=0?u=d+1:f=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:i,center:o,right:a}}function RK(){return 0}function HE(e){return e===null?NaN:+e}function*DK(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const IK=gb(Ii),xc=IK.right;gb(HE).center;class yS extends Map{constructor(t,r=BK){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(gS(this,t))}has(t){return super.has(gS(this,t))}set(t,r){return super.set(LK(this,t),r)}delete(t){return super.delete(FK(this,t))}}function gS({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function LK({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function FK({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function BK(e){return e!==null&&typeof e=="object"?e.valueOf():e}function zK(e=Ii){if(e===Ii)return KE;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function KE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const UK=Math.sqrt(50),qK=Math.sqrt(10),WK=Math.sqrt(2);function hd(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),a=n/Math.pow(10,i),o=a>=UK?10:a>=qK?5:a>=WK?2:1;let s,l,u;return i<0?(u=Math.pow(10,-i)/o,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,i)*o,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=i))return[];const s=a-i+1,l=new Array(s);if(n)if(o<0)for(let u=0;u=n)&&(r=n);return r}function bS(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function VE(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?KE:zK(i);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,f=Math.log(l),d=.5*Math.exp(2*f/3),h=.5*Math.sqrt(f*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/l+h)),v=Math.min(n,Math.floor(t+(l-u)*d/l+h));VE(e,t,p,v,i)}const a=e[t];let o=r,s=n;for(pl(e,r,t),i(e[n],a)>0&&pl(e,r,n);o0;)--s}i(e[r],a)===0?pl(e,r,s):(++s,pl(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function pl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function HK(e,t,r){if(e=Float64Array.from(DK(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return bS(e);if(t>=1)return xS(e);var n,i=(n-1)*t,a=Math.floor(i),o=xS(VE(e,a).subarray(0,a+1)),s=bS(e.subarray(a+1));return o+(s-o)*(i-a)}}function KK(e,t,r=HE){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,a=Math.floor(i),o=+r(e[a],a,e),s=+r(e[a+1],a+1,e);return o+(s-o)*(i-a)}}function VK(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,a=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Xc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Xc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=QK.exec(e))?new Jt(t[1],t[2],t[3],1):(t=YK.exec(e))?new Jt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=XK.exec(e))?Xc(t[1],t[2],t[3],t[4]):(t=ZK.exec(e))?Xc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=JK.exec(e))?kS(t[1],t[2]/100,t[3]/100,1):(t=e7.exec(e))?kS(t[1],t[2]/100,t[3]/100,t[4]):wS.hasOwnProperty(e)?OS(wS[e]):e==="transparent"?new Jt(NaN,NaN,NaN,0):null}function OS(e){return new Jt(e>>16&255,e>>8&255,e&255,1)}function Xc(e,t,r,n){return n<=0&&(e=t=r=NaN),new Jt(e,t,r,n)}function n7(e){return e instanceof bc||(e=ku(e)),e?(e=e.rgb(),new Jt(e.r,e.g,e.b,e.opacity)):new Jt}function Ly(e,t,r,n){return arguments.length===1?n7(e):new Jt(e,t,r,n??1)}function Jt(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}bb(Jt,Ly,QE(bc,{brighter(e){return e=e==null?pd:Math.pow(pd,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new Jt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Jt(Ma(this.r),Ma(this.g),Ma(this.b),md(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PS,formatHex:PS,formatHex8:i7,formatRgb:_S,toString:_S}));function PS(){return`#${ga(this.r)}${ga(this.g)}${ga(this.b)}`}function i7(){return`#${ga(this.r)}${ga(this.g)}${ga(this.b)}${ga((isNaN(this.opacity)?1:this.opacity)*255)}`}function _S(){const e=md(this.opacity);return`${e===1?"rgb(":"rgba("}${Ma(this.r)}, ${Ma(this.g)}, ${Ma(this.b)}${e===1?")":`, ${e})`}`}function md(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ma(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ga(e){return e=Ma(e),(e<16?"0":"")+e.toString(16)}function kS(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Xr(e,t,r,n)}function YE(e){if(e instanceof Xr)return new Xr(e.h,e.s,e.l,e.opacity);if(e instanceof bc||(e=ku(e)),!e)return new Xr;if(e instanceof Xr)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=NaN,s=a-i,l=(a+i)/2;return s?(t===a?o=(r-n)/s+(r0&&l<1?0:o,new Xr(o,s,l,e.opacity)}function a7(e,t,r,n){return arguments.length===1?YE(e):new Xr(e,t,r,n??1)}function Xr(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}bb(Xr,a7,QE(bc,{brighter(e){return e=e==null?pd:Math.pow(pd,e),new Xr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Pu:Math.pow(Pu,e),new Xr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new Jt(Sm(e>=240?e-240:e+120,i,n),Sm(e,i,n),Sm(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Xr(AS(this.h),Zc(this.s),Zc(this.l),md(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=md(this.opacity);return`${e===1?"hsl(":"hsla("}${AS(this.h)}, ${Zc(this.s)*100}%, ${Zc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function AS(e){return e=(e||0)%360,e<0?e+360:e}function Zc(e){return Math.max(0,Math.min(1,e||0))}function Sm(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const wb=e=>()=>e;function o7(e,t){return function(r){return e+r*t}}function s7(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function l7(e){return(e=+e)==1?XE:function(t,r){return r-t?s7(t,r,e):wb(isNaN(t)?r:t)}}function XE(e,t){var r=t-e;return r?o7(e,r):wb(isNaN(e)?t:e)}const ES=function e(t){var r=l7(t);function n(i,a){var o=r((i=Ly(i)).r,(a=Ly(a)).r),s=r(i.g,a.g),l=r(i.b,a.b),u=XE(i.opacity,a.opacity);return function(f){return i.r=o(f),i.g=s(f),i.b=l(f),i.opacity=u(f),i+""}}return n.gamma=e,n}(1);function u7(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(a){for(i=0;ir&&(a=t.slice(r,a),s[o]?s[o]+=a:s[++o]=a),(n=n[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,l.push({i:o,x:vd(n,i)})),r=jm.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function b7(e,t,r){var n=e[0],i=e[1],a=t[0],o=t[1];return i2?w7:b7,l=u=null,d}function d(h){return h==null||isNaN(h=+h)?a:(l||(l=s(e.map(n),t,r)))(n(o(h)))}return d.invert=function(h){return o(i((u||(u=s(t,e.map(n),vd)))(h)))},d.domain=function(h){return arguments.length?(e=Array.from(h,yd),f()):e.slice()},d.range=function(h){return arguments.length?(t=Array.from(h),f()):t.slice()},d.rangeRound=function(h){return t=Array.from(h),r=Sb,f()},d.clamp=function(h){return arguments.length?(o=h?!0:Ut,f()):o!==Ut},d.interpolate=function(h){return arguments.length?(r=h,f()):r},d.unknown=function(h){return arguments.length?(a=h,d):a},function(h,p){return n=h,i=p,f()}}function jb(){return ip()(Ut,Ut)}function S7(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function gd(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function os(e){return e=gd(Math.abs(e)),e?e[1]:NaN}function j7(e,t){return function(r,n){for(var i=r.length,a=[],o=0,s=e[0],l=0;i>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),a.push(r.substring(i-=s,i+s)),!((l+=s+1)>n));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function O7(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var P7=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Au(e){if(!(t=P7.exec(e)))throw new Error("invalid format: "+e);var t;return new Ob({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Au.prototype=Ob.prototype;function Ob(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Ob.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function _7(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var xd;function k7(e,t){var r=gd(e,t);if(!r)return xd=void 0,e.toPrecision(t);var n=r[0],i=r[1],a=i-(xd=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=n.length;return a===o?n:a>o?n+new Array(a-o+1).join("0"):a>0?n.slice(0,a)+"."+n.slice(a):"0."+new Array(1-a).join("0")+gd(e,Math.max(0,t+a-1))[0]}function TS(e,t){var r=gd(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const $S={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:S7,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>TS(e*100,t),r:TS,s:k7,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function CS(e){return e}var MS=Array.prototype.map,RS=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function A7(e){var t=e.grouping===void 0||e.thousands===void 0?CS:j7(MS.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",a=e.numerals===void 0?CS:O7(MS.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d,h){d=Au(d);var p=d.fill,v=d.align,m=d.sign,y=d.symbol,b=d.zero,g=d.width,x=d.comma,S=d.precision,w=d.trim,j=d.type;j==="n"?(x=!0,j="g"):$S[j]||(S===void 0&&(S=12),w=!0,j="g"),(b||p==="0"&&v==="=")&&(b=!0,p="0",v="=");var O=(h&&h.prefix!==void 0?h.prefix:"")+(y==="$"?r:y==="#"&&/[boxX]/.test(j)?"0"+j.toLowerCase():""),P=(y==="$"?n:/[%p]/.test(j)?o:"")+(h&&h.suffix!==void 0?h.suffix:""),A=$S[j],E=/[defgprs%]/.test(j);S=S===void 0?6:/[gprs]/.test(j)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function N(T){var M=O,R=P,D,L,U;if(j==="c")R=A(T)+R,T="";else{T=+T;var C=T<0||1/T<0;if(T=isNaN(T)?l:A(Math.abs(T),S),w&&(T=_7(T)),C&&+T==0&&m!=="+"&&(C=!1),M=(C?m==="("?m:s:m==="-"||m==="("?"":m)+M,R=(j==="s"&&!isNaN(T)&&xd!==void 0?RS[8+xd/3]:"")+R+(C&&m==="("?")":""),E){for(D=-1,L=T.length;++DU||U>57){R=(U===46?i+T.slice(D+1):T.slice(D))+R,T=T.slice(0,D);break}}}x&&!b&&(T=t(T,1/0));var F=M.length+T.length+R.length,z=F>1)+M+T+R+z.slice(F);break;default:T=z+M+T+R;break}return a(T)}return N.toString=function(){return d+""},N}function f(d,h){var p=Math.max(-8,Math.min(8,Math.floor(os(h)/3)))*3,v=Math.pow(10,-p),m=u((d=Au(d),d.type="f",d),{suffix:RS[8+p/3]});return function(y){return m(v*y)}}return{format:u,formatPrefix:f}}var Jc,Pb,ZE;E7({thousands:",",grouping:[3],currency:["$",""]});function E7(e){return Jc=A7(e),Pb=Jc.format,ZE=Jc.formatPrefix,Jc}function N7(e){return Math.max(0,-os(Math.abs(e)))}function T7(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(os(t)/3)))*3-os(Math.abs(e)))}function $7(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,os(t)-os(e))+1}function JE(e,t,r,n){var i=Dy(e,t,r),a;switch(n=Au(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(a=T7(i,o))&&(n.precision=a),ZE(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(a=$7(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=a-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(a=N7(i))&&(n.precision=a-(n.type==="%")*2);break}}return Pb(n)}function Yi(e){var t=e.domain;return e.ticks=function(r){var n=t();return My(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return JE(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,a=n.length-1,o=n[i],s=n[a],l,u,f=10;for(s0;){if(u=Ry(o,s,r),u===l)return n[i]=o,n[a]=s,t(n);if(u>0)o=Math.floor(o/u)*u,s=Math.ceil(s/u)*u;else if(u<0)o=Math.ceil(o*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function bd(){var e=jb();return e.copy=function(){return wc(e,bd())},Fr.apply(e,arguments),Yi(e)}function eN(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,yd),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return eN(e).unknown(t)},e=arguments.length?Array.from(e,yd):[0,1],Yi(r)}function tN(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],a=e[n],o;return aMath.pow(e,t)}function I7(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function LS(e){return(t,r)=>-e(-t,r)}function _b(e){const t=e(DS,IS),r=t.domain;let n=10,i,a;function o(){return i=I7(n),a=D7(n),r()[0]<0?(i=LS(i),a=LS(a),e(C7,M7)):e(DS,IS),t}return t.base=function(s){return arguments.length?(n=+s,o()):n},t.domain=function(s){return arguments.length?(r(s),o()):r()},t.ticks=s=>{const l=r();let u=l[0],f=l[l.length-1];const d=f0){for(;h<=p;++h)for(v=1;vf)break;b.push(m)}}else for(;h<=p;++h)for(v=n-1;v>=1;--v)if(m=h>0?v/a(-h):v*a(h),!(mf)break;b.push(m)}b.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Au(l)).precision==null&&(l.trim=!0),l=Pb(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return f=>{let d=f/a(Math.round(i(f)));return d*nr(tN(r(),{floor:s=>a(Math.floor(i(s))),ceil:s=>a(Math.ceil(i(s)))})),t}function rN(){const e=_b(ip()).domain([1,10]);return e.copy=()=>wc(e,rN()).base(e.base()),Fr.apply(e,arguments),e}function FS(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function BS(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function kb(e){var t=1,r=e(FS(t),BS(t));return r.constant=function(n){return arguments.length?e(FS(t=+n),BS(t)):t},Yi(r)}function nN(){var e=kb(ip());return e.copy=function(){return wc(e,nN()).constant(e.constant())},Fr.apply(e,arguments)}function zS(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function L7(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function F7(e){return e<0?-e*e:e*e}function Ab(e){var t=e(Ut,Ut),r=1;function n(){return r===1?e(Ut,Ut):r===.5?e(L7,F7):e(zS(r),zS(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},Yi(t)}function Eb(){var e=Ab(ip());return e.copy=function(){return wc(e,Eb()).exponent(e.exponent())},Fr.apply(e,arguments),e}function B7(){return Eb.apply(null,arguments).exponent(.5)}function US(e){return Math.sign(e)*e*e}function z7(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function iN(){var e=jb(),t=[0,1],r=!1,n;function i(a){var o=z7(e(a));return isNaN(o)?n:r?Math.round(o):o}return i.invert=function(a){return e.invert(US(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,yd)).map(US)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(r=!!a,i):r},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return iN(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Fr.apply(i,arguments),Yi(i)}function aN(){var e=[],t=[],r=[],n;function i(){var o=0,s=Math.max(1,t.length);for(r=new Array(s-1);++o0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},o.unknown=function(l){return arguments.length&&(a=l),o},o.thresholds=function(){return n.slice()},o.copy=function(){return oN().domain([e,t]).range(i).unknown(a)},Fr.apply(Yi(o),arguments)}function sN(){var e=[.5],t=[0,1],r,n=1;function i(a){return a!=null&&a<=a?t[xc(e,a,0,n)]:r}return i.domain=function(a){return arguments.length?(e=Array.from(a),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return sN().domain(e).range(t).unknown(r)},Fr.apply(i,arguments)}const Om=new Date,Pm=new Date;function vt(e,t,r,n){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),s=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,s)=>{const l=[];if(a=i.ceil(a),s=s==null?1:Math.floor(s),!(a0))return l;let u;do l.push(u=new Date(+a)),t(a,s),e(a);while(uvt(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,s)=>{if(o>=o)if(s<0)for(;++s<=0;)for(;t(o,-1),!a(o););else for(;--s>=0;)for(;t(o,1),!a(o););}),r&&(i.count=(a,o)=>(Om.setTime(+a),Pm.setTime(+o),e(Om),e(Pm),Math.floor(r(Om,Pm))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(n?o=>n(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const wd=vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);wd.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):wd);wd.range;const Rn=1e3,$r=Rn*60,Dn=$r*60,Hn=Dn*24,Nb=Hn*7,qS=Hn*30,_m=Hn*365,xa=vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rn)},(e,t)=>(t-e)/Rn,e=>e.getUTCSeconds());xa.range;const Tb=vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getMinutes());Tb.range;const $b=vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*$r)},(e,t)=>(t-e)/$r,e=>e.getUTCMinutes());$b.range;const Cb=vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rn-e.getMinutes()*$r)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getHours());Cb.range;const Mb=vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dn)},(e,t)=>(t-e)/Dn,e=>e.getUTCHours());Mb.range;const Sc=vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*$r)/Hn,e=>e.getDate()-1);Sc.range;const ap=vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hn,e=>e.getUTCDate()-1);ap.range;const lN=vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Hn,e=>Math.floor(e/Hn));lN.range;function Za(e){return vt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*$r)/Nb)}const op=Za(0),Sd=Za(1),U7=Za(2),q7=Za(3),ss=Za(4),W7=Za(5),H7=Za(6);op.range;Sd.range;U7.range;q7.range;ss.range;W7.range;H7.range;function Ja(e){return vt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/Nb)}const sp=Ja(0),jd=Ja(1),K7=Ja(2),V7=Ja(3),ls=Ja(4),G7=Ja(5),Q7=Ja(6);sp.range;jd.range;K7.range;V7.range;ls.range;G7.range;Q7.range;const Rb=vt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());Rb.range;const Db=vt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());Db.range;const Kn=vt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Kn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Kn.range;const Vn=vt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Vn.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:vt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Vn.range;function uN(e,t,r,n,i,a){const o=[[xa,1,Rn],[xa,5,5*Rn],[xa,15,15*Rn],[xa,30,30*Rn],[a,1,$r],[a,5,5*$r],[a,15,15*$r],[a,30,30*$r],[i,1,Dn],[i,3,3*Dn],[i,6,6*Dn],[i,12,12*Dn],[n,1,Hn],[n,2,2*Hn],[r,1,Nb],[t,1,qS],[t,3,3*qS],[e,1,_m]];function s(u,f,d){const h=fy).right(o,h);if(p===o.length)return e.every(Dy(u/_m,f/_m,d));if(p===0)return wd.every(Math.max(Dy(u,f,d),1));const[v,m]=o[h/o[p-1][2]53)return null;"w"in W||(W.w=1),"Z"in W?(me=Am(ml(W.y,0,1)),st=me.getUTCDay(),me=st>4||st===0?jd.ceil(me):jd(me),me=ap.offset(me,(W.V-1)*7),W.y=me.getUTCFullYear(),W.m=me.getUTCMonth(),W.d=me.getUTCDate()+(W.w+6)%7):(me=km(ml(W.y,0,1)),st=me.getDay(),me=st>4||st===0?Sd.ceil(me):Sd(me),me=Sc.offset(me,(W.V-1)*7),W.y=me.getFullYear(),W.m=me.getMonth(),W.d=me.getDate()+(W.w+6)%7)}else("W"in W||"U"in W)&&("w"in W||(W.w="u"in W?W.u%7:"W"in W?1:0),st="Z"in W?Am(ml(W.y,0,1)).getUTCDay():km(ml(W.y,0,1)).getDay(),W.m=0,W.d="W"in W?(W.w+6)%7+W.W*7-(st+5)%7:W.w+W.U*7-(st+6)%7);return"Z"in W?(W.H+=W.Z/100|0,W.M+=W.Z%100,Am(W)):km(W)}}function P(Q,le,fe,W){for(var We=0,me=le.length,st=fe.length,lt,Gt;We=st)return-1;if(lt=le.charCodeAt(We++),lt===37){if(lt=le.charAt(We++),Gt=w[lt in WS?le.charAt(We++):lt],!Gt||(W=Gt(Q,fe,W))<0)return-1}else if(lt!=fe.charCodeAt(W++))return-1}return W}function A(Q,le,fe){var W=u.exec(le.slice(fe));return W?(Q.p=f.get(W[0].toLowerCase()),fe+W[0].length):-1}function E(Q,le,fe){var W=p.exec(le.slice(fe));return W?(Q.w=v.get(W[0].toLowerCase()),fe+W[0].length):-1}function N(Q,le,fe){var W=d.exec(le.slice(fe));return W?(Q.w=h.get(W[0].toLowerCase()),fe+W[0].length):-1}function T(Q,le,fe){var W=b.exec(le.slice(fe));return W?(Q.m=g.get(W[0].toLowerCase()),fe+W[0].length):-1}function M(Q,le,fe){var W=m.exec(le.slice(fe));return W?(Q.m=y.get(W[0].toLowerCase()),fe+W[0].length):-1}function R(Q,le,fe){return P(Q,t,le,fe)}function D(Q,le,fe){return P(Q,r,le,fe)}function L(Q,le,fe){return P(Q,n,le,fe)}function U(Q){return o[Q.getDay()]}function C(Q){return a[Q.getDay()]}function F(Q){return l[Q.getMonth()]}function z(Q){return s[Q.getMonth()]}function G(Q){return i[+(Q.getHours()>=12)]}function q(Q){return 1+~~(Q.getMonth()/3)}function ee(Q){return o[Q.getUTCDay()]}function ce(Q){return a[Q.getUTCDay()]}function V(Q){return l[Q.getUTCMonth()]}function ie(Q){return s[Q.getUTCMonth()]}function Le(Q){return i[+(Q.getUTCHours()>=12)]}function ot(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var le=j(Q+="",x);return le.toString=function(){return Q},le},parse:function(Q){var le=O(Q+="",!1);return le.toString=function(){return Q},le},utcFormat:function(Q){var le=j(Q+="",S);return le.toString=function(){return Q},le},utcParse:function(Q){var le=O(Q+="",!0);return le.toString=function(){return Q},le}}}var WS={"-":"",_:" ",0:"0"},St=/^\s*\d+/,tV=/^%/,rV=/[\\^$*+?|[\]().{}]/g;function ye(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",a=i.length;return n+(a[t.toLowerCase(),r]))}function iV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function aV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function oV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function sV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function lV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function HS(e,t,r){var n=St.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function KS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function uV(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function cV(e,t,r){var n=St.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function fV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function VS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function dV(e,t,r){var n=St.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function GS(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function hV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function pV(e,t,r){var n=St.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function mV(e,t,r){var n=St.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function vV(e,t,r){var n=St.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function yV(e,t,r){var n=tV.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function gV(e,t,r){var n=St.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function xV(e,t,r){var n=St.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function QS(e,t){return ye(e.getDate(),t,2)}function bV(e,t){return ye(e.getHours(),t,2)}function wV(e,t){return ye(e.getHours()%12||12,t,2)}function SV(e,t){return ye(1+Sc.count(Kn(e),e),t,3)}function cN(e,t){return ye(e.getMilliseconds(),t,3)}function jV(e,t){return cN(e,t)+"000"}function OV(e,t){return ye(e.getMonth()+1,t,2)}function PV(e,t){return ye(e.getMinutes(),t,2)}function _V(e,t){return ye(e.getSeconds(),t,2)}function kV(e){var t=e.getDay();return t===0?7:t}function AV(e,t){return ye(op.count(Kn(e)-1,e),t,2)}function fN(e){var t=e.getDay();return t>=4||t===0?ss(e):ss.ceil(e)}function EV(e,t){return e=fN(e),ye(ss.count(Kn(e),e)+(Kn(e).getDay()===4),t,2)}function NV(e){return e.getDay()}function TV(e,t){return ye(Sd.count(Kn(e)-1,e),t,2)}function $V(e,t){return ye(e.getFullYear()%100,t,2)}function CV(e,t){return e=fN(e),ye(e.getFullYear()%100,t,2)}function MV(e,t){return ye(e.getFullYear()%1e4,t,4)}function RV(e,t){var r=e.getDay();return e=r>=4||r===0?ss(e):ss.ceil(e),ye(e.getFullYear()%1e4,t,4)}function DV(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+ye(t/60|0,"0",2)+ye(t%60,"0",2)}function YS(e,t){return ye(e.getUTCDate(),t,2)}function IV(e,t){return ye(e.getUTCHours(),t,2)}function LV(e,t){return ye(e.getUTCHours()%12||12,t,2)}function FV(e,t){return ye(1+ap.count(Vn(e),e),t,3)}function dN(e,t){return ye(e.getUTCMilliseconds(),t,3)}function BV(e,t){return dN(e,t)+"000"}function zV(e,t){return ye(e.getUTCMonth()+1,t,2)}function UV(e,t){return ye(e.getUTCMinutes(),t,2)}function qV(e,t){return ye(e.getUTCSeconds(),t,2)}function WV(e){var t=e.getUTCDay();return t===0?7:t}function HV(e,t){return ye(sp.count(Vn(e)-1,e),t,2)}function hN(e){var t=e.getUTCDay();return t>=4||t===0?ls(e):ls.ceil(e)}function KV(e,t){return e=hN(e),ye(ls.count(Vn(e),e)+(Vn(e).getUTCDay()===4),t,2)}function VV(e){return e.getUTCDay()}function GV(e,t){return ye(jd.count(Vn(e)-1,e),t,2)}function QV(e,t){return ye(e.getUTCFullYear()%100,t,2)}function YV(e,t){return e=hN(e),ye(e.getUTCFullYear()%100,t,2)}function XV(e,t){return ye(e.getUTCFullYear()%1e4,t,4)}function ZV(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ls(e):ls.ceil(e),ye(e.getUTCFullYear()%1e4,t,4)}function JV(){return"+0000"}function XS(){return"%"}function ZS(e){return+e}function JS(e){return Math.floor(+e/1e3)}var io,pN,mN;eG({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function eG(e){return io=eV(e),pN=io.format,io.parse,mN=io.utcFormat,io.utcParse,io}function tG(e){return new Date(e)}function rG(e){return e instanceof Date?+e:+new Date(+e)}function Ib(e,t,r,n,i,a,o,s,l,u){var f=jb(),d=f.invert,h=f.domain,p=u(".%L"),v=u(":%S"),m=u("%I:%M"),y=u("%I %p"),b=u("%a %d"),g=u("%b %d"),x=u("%B"),S=u("%Y");function w(j){return(l(j)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,a)=>HK(e,a/n))},r.copy=function(){return xN(t).domain(e)},ei.apply(r,arguments)}function up(){var e=0,t=.5,r=1,n=1,i,a,o,s,l,u=Ut,f,d=!1,h;function p(m){return isNaN(m=+m)?h:(m=.5+((m=+f(m))-a)*(n*mt}var jN=uG,cG=cp,fG=jN,dG=Ks;function hG(e){return e&&e.length?cG(e,dG,fG):void 0}var pG=hG;const Oi=Se(pG);function mG(e,t){return ee.e^a.s<0?1:-1;for(n=a.d.length,i=e.d.length,t=0,r=ne.d[t]^a.s<0?1:-1;return n===i?0:n>i^a.s<0?1:-1};J.decimalPlaces=J.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*De;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};J.dividedBy=J.div=function(e){return Bn(this,new this.constructor(e))};J.dividedToIntegerBy=J.idiv=function(e){var t=this,r=t.constructor;return Ee(Bn(t,new r(e),0,1),r.precision)};J.equals=J.eq=function(e){return!this.cmp(e)};J.exponent=function(){return nt(this)};J.greaterThan=J.gt=function(e){return this.cmp(e)>0};J.greaterThanOrEqualTo=J.gte=function(e){return this.cmp(e)>=0};J.isInteger=J.isint=function(){return this.e>this.d.length-2};J.isNegative=J.isneg=function(){return this.s<0};J.isPositive=J.ispos=function(){return this.s>0};J.isZero=function(){return this.s===0};J.lessThan=J.lt=function(e){return this.cmp(e)<0};J.lessThanOrEqualTo=J.lte=function(e){return this.cmp(e)<1};J.logarithm=J.log=function(e){var t,r=this,n=r.constructor,i=n.precision,a=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(dr))throw Error(Ir+"NaN");if(r.s<1)throw Error(Ir+(r.s?"NaN":"-Infinity"));return r.eq(dr)?new n(0):(Be=!1,t=Bn(Eu(r,a),Eu(e,a),a),Be=!0,Ee(t,i))};J.minus=J.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?AN(t,e):_N(t,(e.s=-e.s,e))};J.modulo=J.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(Ir+"NaN");return r.s?(Be=!1,t=Bn(r,e,0,1).times(e),Be=!0,r.minus(t)):Ee(new n(r),i)};J.naturalExponential=J.exp=function(){return kN(this)};J.naturalLogarithm=J.ln=function(){return Eu(this)};J.negated=J.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};J.plus=J.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_N(t,e):AN(t,(e.s=-e.s,e))};J.precision=J.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ra+e);if(t=nt(i)+1,n=i.d.length-1,r=n*De+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};J.squareRoot=J.sqrt=function(){var e,t,r,n,i,a,o,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Ir+"NaN")}for(e=nt(s),Be=!1,i=Math.sqrt(+s),i==0||i==1/0?(t=hn(s.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Qs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(i.toString()),r=l.precision,i=o=r+3;;)if(a=n,n=a.plus(Bn(s,a,o+2)).times(.5),hn(a.d).slice(0,o)===(t=hn(n.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Ee(a,r+1,0),a.times(a).eq(s)){n=a;break}}else if(t!="9999")break;o+=4}return Be=!0,Ee(n,r)};J.times=J.mul=function(e){var t,r,n,i,a,o,s,l,u,f=this,d=f.constructor,h=f.d,p=(e=new d(e)).d;if(!f.s||!e.s)return new d(0);for(e.s*=f.s,r=f.e+e.e,l=h.length,u=p.length,l=0;){for(t=0,i=l+n;i>n;)s=a[i]+p[n]*h[i-n-1]+t,a[i--]=s%gt|0,t=s/gt|0;a[i]=(a[i]+t)%gt|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=r,Be?Ee(e,d.precision):e};J.toDecimalPlaces=J.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(bn(e,0,Gs),t===void 0?t=n.rounding:bn(t,0,8),Ee(r,e+nt(r)+1,t))};J.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ha(n,!0):(bn(e,0,Gs),t===void 0?t=i.rounding:bn(t,0,8),n=Ee(new i(n),e+1,t),r=Ha(n,!0,e+1)),r};J.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?Ha(i):(bn(e,0,Gs),t===void 0?t=a.rounding:bn(t,0,8),n=Ee(new a(i),e+nt(i)+1,t),r=Ha(n.abs(),!1,e+nt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};J.toInteger=J.toint=function(){var e=this,t=e.constructor;return Ee(new t(e),nt(e)+1,t.rounding)};J.toNumber=function(){return+this};J.toPower=J.pow=function(e){var t,r,n,i,a,o,s=this,l=s.constructor,u=12,f=+(e=new l(e));if(!e.s)return new l(dr);if(s=new l(s),!s.s){if(e.s<1)throw Error(Ir+"Infinity");return s}if(s.eq(dr))return s;if(n=l.precision,e.eq(dr))return Ee(s,n);if(t=e.e,r=e.d.length-1,o=t>=r,a=s.s,o){if((r=f<0?-f:f)<=PN){for(i=new l(dr),t=Math.ceil(n/De+4),Be=!1;r%2&&(i=i.times(s),rj(i.d,t)),r=Qs(r/2),r!==0;)s=s.times(s),rj(s.d,t);return Be=!0,e.s<0?new l(dr).div(i):Ee(i,n)}}else if(a<0)throw Error(Ir+"NaN");return a=a<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,Be=!1,i=e.times(Eu(s,n+u)),Be=!0,i=kN(i),i.s=a,i};J.toPrecision=function(e,t){var r,n,i=this,a=i.constructor;return e===void 0?(r=nt(i),n=Ha(i,r<=a.toExpNeg||r>=a.toExpPos)):(bn(e,1,Gs),t===void 0?t=a.rounding:bn(t,0,8),i=Ee(new a(i),e,t),r=nt(i),n=Ha(i,e<=r||r<=a.toExpNeg,e)),n};J.toSignificantDigits=J.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(bn(e,1,Gs),t===void 0?t=n.rounding:bn(t,0,8)),Ee(new n(r),e,t)};J.toString=J.valueOf=J.val=J.toJSON=J[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=nt(e),r=e.constructor;return Ha(e,t<=r.toExpNeg||t>=r.toExpPos)};function _N(e,t){var r,n,i,a,o,s,l,u,f=e.constructor,d=f.precision;if(!e.s||!t.s)return t.s||(t=new f(e)),Be?Ee(t,d):t;if(l=e.d,u=t.d,o=e.e,i=t.e,l=l.slice(),a=o-i,a){for(a<0?(n=l,a=-a,s=u.length):(n=u,i=o,s=l.length),o=Math.ceil(d/De),s=o>s?o+1:s+1,a>s&&(a=s,n.length=1),n.reverse();a--;)n.push(0);n.reverse()}for(s=l.length,a=u.length,s-a<0&&(a=s,n=u,u=l,l=n),r=0;a;)r=(l[--a]=l[a]+u[a]+r)/gt|0,l[a]%=gt;for(r&&(l.unshift(r),++i),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=i,Be?Ee(t,d):t}function bn(e,t,r){if(e!==~~e||er)throw Error(Ra+e)}function hn(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(s=l=0;si[s]?1:-1;break}return l}function r(n,i,a){for(var o=0;a--;)n[a]-=o,o=n[a]1;)n.shift()}return function(n,i,a,o){var s,l,u,f,d,h,p,v,m,y,b,g,x,S,w,j,O,P,A=n.constructor,E=n.s==i.s?1:-1,N=n.d,T=i.d;if(!n.s)return new A(n);if(!i.s)throw Error(Ir+"Division by zero");for(l=n.e-i.e,O=T.length,w=N.length,p=new A(E),v=p.d=[],u=0;T[u]==(N[u]||0);)++u;if(T[u]>(N[u]||0)&&--l,a==null?g=a=A.precision:o?g=a+(nt(n)-nt(i))+1:g=a,g<0)return new A(0);if(g=g/De+2|0,u=0,O==1)for(f=0,T=T[0],g++;(u1&&(T=e(T,f),N=e(N,f),O=T.length,w=N.length),S=O,m=N.slice(0,O),y=m.length;y=gt/2&&++j;do f=0,s=t(T,m,O,y),s<0?(b=m[0],O!=y&&(b=b*gt+(m[1]||0)),f=b/j|0,f>1?(f>=gt&&(f=gt-1),d=e(T,f),h=d.length,y=m.length,s=t(d,m,h,y),s==1&&(f--,r(d,O16)throw Error(Bb+nt(e));if(!e.s)return new f(dr);for(Be=!1,s=d,o=new f(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(n=Math.log(ua(2,u))/Math.LN10*2+5|0,s+=n,r=i=a=new f(dr),f.precision=s;;){if(i=Ee(i.times(e),s),r=r.times(++l),o=a.plus(Bn(i,r,s)),hn(o.d).slice(0,s)===hn(a.d).slice(0,s)){for(;u--;)a=Ee(a.times(a),s);return f.precision=d,t==null?(Be=!0,Ee(a,d)):a}a=o}}function nt(e){for(var t=e.e*De,r=e.d[0];r>=10;r/=10)t++;return t}function Em(e,t,r){if(t>e.LN10.sd())throw Be=!0,r&&(e.precision=r),Error(Ir+"LN10 precision limit exceeded");return Ee(new e(e.LN10),t)}function ui(e){for(var t="";e--;)t+="0";return t}function Eu(e,t){var r,n,i,a,o,s,l,u,f,d=1,h=10,p=e,v=p.d,m=p.constructor,y=m.precision;if(p.s<1)throw Error(Ir+(p.s?"NaN":"-Infinity"));if(p.eq(dr))return new m(0);if(t==null?(Be=!1,u=y):u=t,p.eq(10))return t==null&&(Be=!0),Em(m,u);if(u+=h,m.precision=u,r=hn(v),n=r.charAt(0),a=nt(p),Math.abs(a)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=hn(p.d),n=r.charAt(0),d++;a=nt(p),n>1?(p=new m("0."+r),a++):p=new m(n+"."+r.slice(1))}else return l=Em(m,u+2,y).times(a+""),p=Eu(new m(n+"."+r.slice(1)),u-h).plus(l),m.precision=y,t==null?(Be=!0,Ee(p,y)):p;for(s=o=p=Bn(p.minus(dr),p.plus(dr),u),f=Ee(p.times(p),u),i=3;;){if(o=Ee(o.times(f),u),l=s.plus(Bn(o,new m(i),u)),hn(l.d).slice(0,u)===hn(s.d).slice(0,u))return s=s.times(2),a!==0&&(s=s.plus(Em(m,u+2,y).times(a+""))),s=Bn(s,new m(d),u),m.precision=y,t==null?(Be=!0,Ee(s,y)):s;s=l,i+=2}}function tj(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Qs(r/De),e.d=[],n=(r+1)%De,r<0&&(n+=De),nOd||e.e<-Od))throw Error(Bb+r)}else e.s=0,e.e=0,e.d=[0];return e}function Ee(e,t,r){var n,i,a,o,s,l,u,f,d=e.d;for(o=1,a=d[0];a>=10;a/=10)o++;if(n=t-o,n<0)n+=De,i=t,u=d[f=0];else{if(f=Math.ceil((n+1)/De),a=d.length,f>=a)return e;for(u=a=d[f],o=1;a>=10;a/=10)o++;n%=De,i=n-De+o}if(r!==void 0&&(a=ua(10,o-i-1),s=u/a%10|0,l=t<0||d[f+1]!==void 0||u%a,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?i>0?u/ua(10,o-i):0:d[f-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(a=nt(e),d.length=1,t=t-a-1,d[0]=ua(10,(De-t%De)%De),e.e=Qs(-t/De)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=f,a=1,f--):(d.length=f+1,a=ua(10,De-n),d[f]=i>0?(u/ua(10,o-i)%ua(10,i)|0)*a:0),l)for(;;)if(f==0){(d[0]+=a)==gt&&(d[0]=1,++e.e);break}else{if(d[f]+=a,d[f]!=gt)break;d[f--]=0,a=1}for(n=d.length;d[--n]===0;)d.pop();if(Be&&(e.e>Od||e.e<-Od))throw Error(Bb+nt(e));return e}function AN(e,t){var r,n,i,a,o,s,l,u,f,d,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),Be?Ee(t,p):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),o=u-n,o){for(f=o<0,f?(r=l,o=-o,s=d.length):(r=d,n=u,s=l.length),i=Math.max(Math.ceil(p/De),s)+2,o>i&&(o=i,r.length=1),r.reverse(),i=o;i--;)r.push(0);r.reverse()}else{for(i=l.length,s=d.length,f=i0;--i)l[s++]=0;for(i=d.length;i>o;){if(l[--i]0?a=a.charAt(0)+"."+a.slice(1)+ui(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+ui(-i-1)+a,r&&(n=r-o)>0&&(a+=ui(n))):i>=o?(a+=ui(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+ui(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=ui(n))),e.s<0?"-"+a:a}function rj(e,t){if(e.length>t)return e.length=t,!0}function EN(e){var t,r,n;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ra+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return tj(o,a.toString())}else if(typeof a!="string")throw Error(Ra+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,DG.test(a))tj(o,a);else throw Error(Ra+a)}if(i.prototype=J,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=EN,i.config=i.set=IG,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Ra+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ra+r+": "+n);return this}var zb=EN(RG);dr=new zb(1);const _e=zb;function LG(e){return UG(e)||zG(e)||BG(e)||FG()}function FG(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BG(e,t){if(e){if(typeof e=="string")return zy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zy(e,t)}}function zG(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function UG(e){if(Array.isArray(e))return zy(e)}function zy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-o,nj(function(){for(var s=arguments.length,l=new Array(s),u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(n=(s=o.next()).done)&&(r.push(s.value),!(t&&r.length===t));n=!0);}catch(l){i=!0,a=l}finally{try{!n&&o.return!=null&&o.return()}finally{if(i)throw a}}return r}}function nQ(e){if(Array.isArray(e))return e}function MN(e){var t=Nu(e,2),r=t[0],n=t[1],i=r,a=n;return r>n&&(i=n,a=r),[i,a]}function RN(e,t,r){if(e.lte(0))return new _e(0);var n=hp.getDigitCount(e.toNumber()),i=new _e(10).pow(n),a=e.div(i),o=n!==1?.05:.1,s=new _e(Math.ceil(a.div(o).toNumber())).add(r).mul(o),l=s.mul(i);return t?l:new _e(Math.ceil(l))}function iQ(e,t,r){var n=1,i=new _e(e);if(!i.isint()&&r){var a=Math.abs(e);a<1?(n=new _e(10).pow(hp.getDigitCount(e)-1),i=new _e(Math.floor(i.div(n).toNumber())).mul(n)):a>1&&(i=new _e(Math.floor(e)))}else e===0?i=new _e(Math.floor((t-1)/2)):r||(i=new _e(Math.floor(e)));var o=Math.floor((t-1)/2),s=KG(HG(function(l){return i.add(new _e(l-o).mul(n)).toNumber()}),Uy);return s(0,t)}function DN(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new _e(0),tickMin:new _e(0),tickMax:new _e(0)};var a=RN(new _e(t).sub(e).div(r-1),n,i),o;e<=0&&t>=0?o=new _e(0):(o=new _e(e).add(t).div(2),o=o.sub(new _e(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),l=Math.ceil(new _e(t).sub(o).div(a).toNumber()),u=s+l+1;return u>r?DN(e,t,r,n,i+1):(u0?l+(r-u):l,s=t>0?s:s+(r-u)),{step:a,tickMin:o.sub(new _e(s).mul(a)),tickMax:o.add(new _e(l).mul(a))})}function aQ(e){var t=Nu(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=MN([r,n]),l=Nu(s,2),u=l[0],f=l[1];if(u===-1/0||f===1/0){var d=f===1/0?[u].concat(Wy(Uy(0,i-1).map(function(){return 1/0}))):[].concat(Wy(Uy(0,i-1).map(function(){return-1/0})),[f]);return r>n?qy(d):d}if(u===f)return iQ(u,i,a);var h=DN(u,f,o,a),p=h.step,v=h.tickMin,m=h.tickMax,y=hp.rangeStep(v,m.add(new _e(.1).mul(p)),p);return r>n?qy(y):y}function oQ(e,t){var r=Nu(e,2),n=r[0],i=r[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=MN([n,i]),s=Nu(o,2),l=s[0],u=s[1];if(l===-1/0||u===1/0)return[n,i];if(l===u)return[l];var f=Math.max(t,2),d=RN(new _e(u).sub(l).div(f-1),a,0),h=[].concat(Wy(hp.rangeStep(new _e(l),new _e(u).sub(new _e(.99).mul(d)),d)),[u]);return n>i?qy(h):h}var sQ=$N(aQ),lQ=$N(oQ),uQ="Invariant failed";function Ka(e,t){throw new Error(uQ)}var cQ=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function us(e){"@babel/helpers - typeof";return us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},us(e)}function Pd(){return Pd=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gQ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xQ(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,s=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(s<=1)return 0;if(a&&a.axisType==="angleAxis"&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var l=a.range,u=0;u0?i[u-1].coordinate:i[s-1].coordinate,d=i[u].coordinate,h=u>=s-1?i[0].coordinate:i[u+1].coordinate,p=void 0;if(Bt(d-f)!==Bt(h-d)){var v=[];if(Bt(h-d)===Bt(l[1]-l[0])){p=h;var m=d+l[1]-l[0];v[0]=Math.min(m,(m+f)/2),v[1]=Math.max(m,(m+f)/2)}else{p=f;var y=h+l[1]-l[0];v[0]=Math.min(d,(y+d)/2),v[1]=Math.max(d,(y+d)/2)}var b=[Math.min(d,(p+d)/2),Math.max(d,(p+d)/2)];if(t>b[0]&&t<=b[1]||t>=v[0]&&t<=v[1]){o=i[u].index;break}}else{var g=Math.min(f,h),x=Math.max(f,h);if(t>(g+d)/2&&t<=(x+d)/2){o=i[u].index;break}}}else for(var S=0;S0&&S(n[S].coordinate+n[S-1].coordinate)/2&&t<=(n[S].coordinate+n[S+1].coordinate)/2||S===s-1&&t>(n[S].coordinate+n[S-1].coordinate)/2){o=n[S].index;break}return o},Ub=function(t){var r,n=t,i=n.type.displayName,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ve(Ve({},t.type.defaultProps),t.props):t.props,o=a.stroke,s=a.fill,l;switch(i){case"Line":l=o;break;case"Area":case"Radar":l=o&&o!=="none"?o:s;break;default:l=s;break}return l},DQ=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,a=i===void 0?{}:i;if(!a)return{};for(var o={},s=Object.keys(a),l=0,u=s.length;l=0});if(b&&b.length){var g=b[0].type.defaultProps,x=g!==void 0?Ve(Ve({},g),b[0].props):b[0].props,S=x.barSize,w=x[y];o[w]||(o[w]=[]);var j=re(S)?r:S;o[w].push({item:b[0],stackList:b.slice(1),barSize:re(j)?void 0:zt(j,n,0)})}}return o},IQ=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,a=t.sizeList,o=a===void 0?[]:a,s=t.maxBarSize,l=o.length;if(l<1)return null;var u=zt(r,i,0,!0),f,d=[];if(o[0].barSize===+o[0].barSize){var h=!1,p=i/l,v=o.reduce(function(S,w){return S+w.barSize||0},0);v+=(l-1)*u,v>=i&&(v-=(l-1)*u,u=0),v>=i&&p>0&&(h=!0,p*=.9,v=l*p);var m=(i-v)/2>>0,y={offset:m-u,size:0};f=o.reduce(function(S,w){var j={item:w.item,position:{offset:y.offset+y.size+u,size:h?p:w.barSize}},O=[].concat(oj(S),[j]);return y=O[O.length-1].position,w.stackList&&w.stackList.length&&w.stackList.forEach(function(P){O.push({item:P,position:y})}),O},d)}else{var b=zt(n,i,0,!0);i-2*b-(l-1)*u<=0&&(u=0);var g=(i-2*b-(l-1)*u)/l;g>1&&(g>>=0);var x=s===+s?Math.min(g,s):g;f=o.reduce(function(S,w,j){var O=[].concat(oj(S),[{item:w.item,position:{offset:b+(g+u)*j+(g-x)/2,size:x}}]);return w.stackList&&w.stackList.length&&w.stackList.forEach(function(P){O.push({item:P,position:O[O.length-1].position})}),O},d)}return f},LQ=function(t,r,n,i){var a=n.children,o=n.width,s=n.margin,l=o-(s.left||0)-(s.right||0),u=BN({children:a,legendWidth:l});if(u){var f=i||{},d=f.width,h=f.height,p=u.align,v=u.verticalAlign,m=u.layout;if((m==="vertical"||m==="horizontal"&&v==="middle")&&p!=="center"&&H(t[p]))return Ve(Ve({},t),{},Mo({},p,t[p]+(d||0)));if((m==="horizontal"||m==="vertical"&&p==="center")&&v!=="middle"&&H(t[v]))return Ve(Ve({},t),{},Mo({},v,t[v]+(h||0)))}return t},FQ=function(t,r,n){return re(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},zN=function(t,r,n,i,a){var o=r.props.children,s=Wt(o,Ys).filter(function(u){return FQ(i,a,u.props.direction)});if(s&&s.length){var l=s.map(function(u){return u.props.dataKey});return t.reduce(function(u,f){var d=Ae(f,n);if(re(d))return u;var h=Array.isArray(d)?[fp(d),Oi(d)]:[d,d],p=l.reduce(function(v,m){var y=Ae(f,m,0),b=h[0]-Math.abs(Array.isArray(y)?y[0]:y),g=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(b,v[0]),Math.max(g,v[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},BQ=function(t,r,n,i,a){var o=r.map(function(s){return zN(t,s,n,a,i)}).filter(function(s){return!re(s)});return o&&o.length?o.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},UN=function(t,r,n,i,a){var o=r.map(function(l){var u=l.props.dataKey;return n==="number"&&u&&zN(t,l,u,i)||Ul(t,u,n,a)});if(n==="number")return o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]);var s={};return o.reduce(function(l,u){for(var f=0,d=u.length;f=2?Bt(s[0]-s[1])*2*u:u,r&&(t.ticks||t.niceTicks)){var f=(t.ticks||t.niceTicks).map(function(d){var h=a?a.indexOf(d):d;return{coordinate:i(h)+u,value:d,offset:u}});return f.filter(function(d){return!qs(d.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(d,h){return{coordinate:i(d)+u,value:d,index:h,offset:u}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(d){return{coordinate:i(d)+u,value:d,offset:u}}):i.domain().map(function(d,h){return{coordinate:i(d)+u,value:a?a[d]:d,index:h,offset:u}})},Nm=new WeakMap,ef=function(t,r){if(typeof r!="function")return t;Nm.has(t)||Nm.set(t,new WeakMap);var n=Nm.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},HN=function(t,r,n){var i=t.scale,a=t.type,o=t.layout,s=t.axisType;if(i==="auto")return o==="radial"&&s==="radiusAxis"?{scale:Ou(),realScaleType:"band"}:o==="radial"&&s==="angleAxis"?{scale:bd(),realScaleType:"linear"}:a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:zl(),realScaleType:"point"}:a==="category"?{scale:Ou(),realScaleType:"band"}:{scale:bd(),realScaleType:"linear"};if(qa(i)){var l="scale".concat(Yh(i));return{scale:(ej[l]||zl)(),realScaleType:ej[l]?l:"point"}}return te(i)?{scale:i}:{scale:zl(),realScaleType:"point"}},lj=1e-4,KN=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),a=Math.min(i[0],i[1])-lj,o=Math.max(i[0],i[1])+lj,s=t(r[0]),l=t(r[n-1]);(so||lo)&&t.domain([r[0],r[n-1]])}},zQ=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(a[1]=i),a[0]>i&&(a[0]=i),a[1]=0?(t[s][n][0]=a,t[s][n][1]=a+l,a=t[s][n][1]):(t[s][n][0]=o,t[s][n][1]=o+l,o=t[s][n][1])}},WQ=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[o][n][0]=a,t[o][n][1]=a+s,a=t[o][n][1]):(t[o][n][0]=0,t[o][n][1]=0)}},HQ={sign:qQ,expand:c8,none:ts,silhouette:f8,wiggle:d8,positive:WQ},KQ=function(t,r,n){var i=r.map(function(s){return s.props.dataKey}),a=HQ[n],o=u8().keys(i).value(function(s,l){return+Ae(s,l,0)}).order(gy).offset(a);return o(t)},VQ=function(t,r,n,i,a,o){if(!t)return null;var s=o?r.reverse():r,l={},u=s.reduce(function(d,h){var p,v=(p=h.type)!==null&&p!==void 0&&p.defaultProps?Ve(Ve({},h.type.defaultProps),h.props):h.props,m=v.stackId,y=v.hide;if(y)return d;var b=v[n],g=d[b]||{hasStack:!1,stackGroups:{}};if(pt(m)){var x=g.stackGroups[m]||{numericAxisId:n,cateAxisId:i,items:[]};x.items.push(h),g.hasStack=!0,g.stackGroups[m]=x}else g.stackGroups[Qi("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[h]};return Ve(Ve({},d),{},Mo({},b,g))},l),f={};return Object.keys(u).reduce(function(d,h){var p=u[h];if(p.hasStack){var v={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(m,y){var b=p.stackGroups[y];return Ve(Ve({},m),{},Mo({},y,{numericAxisId:n,cateAxisId:i,items:b.items,stackedData:KQ(t,b.items,a)}))},v)}return Ve(Ve({},d),{},Mo({},h,p))},f)},VN=function(t,r){var n=r.realScaleType,i=r.type,a=r.tickCount,o=r.originalDomain,s=r.allowDecimals,l=n||r.scale;if(l!=="auto"&&l!=="linear")return null;if(a&&i==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var f=sQ(u,a,s);return t.domain([fp(f),Oi(f)]),{niceTicks:f}}if(a&&i==="number"){var d=t.domain(),h=lQ(d,a,s);return{niceTicks:h}}return null};function cs(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!re(i[t.dataKey])){var s=Zf(r,"value",i[t.dataKey]);if(s)return s.coordinate+n/2}return r[a]?r[a].coordinate+n/2:null}var l=Ae(i,re(o)?t.dataKey:o);return re(l)?null:t.scale(l)}var uj=function(t){var r=t.axis,n=t.ticks,i=t.offset,a=t.bandSize,o=t.entry,s=t.index;if(r.type==="category")return n[s]?n[s].coordinate+i:null;var l=Ae(o,r.dataKey,r.domain[s]);return re(l)?null:r.scale(l)-a/2+i},GQ=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return i<=0&&a>=0?0:a<0?a:i}return n[0]},QQ=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ve(Ve({},t.type.defaultProps),t.props):t.props,a=i.stackId;if(pt(a)){var o=r[a];if(o){var s=o.items.indexOf(t);return s>=0?o.stackedData[s]:null}}return null},YQ=function(t){return t.reduce(function(r,n){return[fp(n.concat([r[0]]).filter(H)),Oi(n.concat([r[1]]).filter(H))]},[1/0,-1/0])},GN=function(t,r,n){return Object.keys(t).reduce(function(i,a){var o=t[a],s=o.stackedData,l=s.reduce(function(u,f){var d=YQ(f.slice(r,n+1));return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);return[Math.min(l[0],i[0]),Math.max(l[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},cj=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fj=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Gy=function(t,r,n){if(te(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(H(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(cj.test(t[0])){var a=+cj.exec(t[0])[1];i[0]=r[0]-a}else te(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(H(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(fj.test(t[1])){var o=+fj.exec(t[1])[1];i[1]=r[1]+o}else te(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},kd=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var a=vb(r,function(d){return d.coordinate}),o=1/0,s=1,l=a.length;se.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},ZN=function(t,r,n,i,a){var o=t.width,s=t.height,l=t.startAngle,u=t.endAngle,f=zt(t.cx,o,o/2),d=zt(t.cy,s,s/2),h=XN(o,s,n),p=zt(t.innerRadius,h,0),v=zt(t.outerRadius,h,h*.8),m=Object.keys(r);return m.reduce(function(y,b){var g=r[b],x=g.domain,S=g.reversed,w;if(re(g.range))i==="angleAxis"?w=[l,u]:i==="radiusAxis"&&(w=[p,v]),S&&(w=[w[1],w[0]]);else{w=g.range;var j=w,O=JQ(j,2);l=O[0],u=O[1]}var P=HN(g,a),A=P.realScaleType,E=P.scale;E.domain(x).range(w),KN(E);var N=VN(E,An(An({},g),{},{realScaleType:A})),T=An(An(An({},g),N),{},{range:w,radius:v,realScaleType:A,scale:E,cx:f,cy:d,innerRadius:p,outerRadius:v,startAngle:l,endAngle:u});return An(An({},y),{},YN({},b,T))},{})},aY=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(i-o,2))},oY=function(t,r){var n=t.x,i=t.y,a=r.cx,o=r.cy,s=aY({x:n,y:i},{x:a,y:o});if(s<=0)return{radius:s};var l=(n-a)/s,u=Math.acos(l);return i>o&&(u=2*Math.PI-u),{radius:s,angle:iY(u),angleInRadian:u}},sY=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),a=Math.floor(n/360),o=Math.min(i,a);return{startAngle:r-o*360,endAngle:n-o*360}},lY=function(t,r){var n=r.startAngle,i=r.endAngle,a=Math.floor(n/360),o=Math.floor(i/360),s=Math.min(a,o);return t+s*360},mj=function(t,r){var n=t.x,i=t.y,a=oY({x:n,y:i},r),o=a.radius,s=a.angle,l=r.innerRadius,u=r.outerRadius;if(ou)return!1;if(o===0)return!0;var f=sY(r),d=f.startAngle,h=f.endAngle,p=s,v;if(d<=h){for(;p>h;)p-=360;for(;p=d&&p<=h}else{for(;p>d;)p-=360;for(;p=h&&p<=d}return v?An(An({},r),{},{radius:o,angle:lY(p,r)}):null},JN=function(t){return!k.isValidElement(t)&&!te(t)&&typeof t!="boolean"?t.className:""};function Mu(e){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mu(e)}var uY=["offset"];function cY(e){return pY(e)||hY(e)||dY(e)||fY()}function fY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dY(e,t){if(e){if(typeof e=="string")return Qy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qy(e,t)}}function hY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function pY(e){if(Array.isArray(e))return Qy(e)}function Qy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t=0?1:-1,x,S;i==="insideStart"?(x=p+g*o,S=m):i==="insideEnd"?(x=v-g*o,S=!m):i==="end"&&(x=v+g*o,S=m),S=b<=0?S:!S;var w=ge(u,f,y,x),j=ge(u,f,y,x+(S?1:-1)*359),O="M".concat(w.x,",").concat(w.y,` A`).concat(y,",").concat(y,",0,1,").concat(S?0:1,`, - `).concat(j.x,",").concat(j.y),P=re(t.id)?Qi("recharts-radial-line-"):t.id;return _.createElement("text",Ru({},n,{dominantBaseline:"central",className:oe("recharts-radial-bar-label",s)}),_.createElement("defs",null,_.createElement("path",{id:P,d:O})),_.createElement("textPath",{xlinkHref:"#".concat(P)},r))},SY=function(t){var r=t.viewBox,n=t.offset,i=t.position,a=r,o=a.cx,s=a.cy,l=a.innerRadius,u=a.outerRadius,f=a.startAngle,d=a.endAngle,h=(f+d)/2;if(i==="outside"){var p=ge(o,s,u+n,h),v=p.x,m=p.y;return{x:v,y:m,textAnchor:v>=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,b=ge(o,s,y,h),g=b.x,x=b.y;return{x:g,y:x,textAnchor:"middle",verticalAnchor:"middle"}},jY=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,d=f>=0?1:-1,h=d*i,p=d>0?"end":"start",v=d>0?"start":"end",m=u>=0?1:-1,y=m*i,b=m>0?"end":"start",g=m>0?"start":"end";if(a==="top"){var x={x:s+u/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return ft(ft({},x),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+f+h,textAnchor:"middle",verticalAnchor:v};return ft(ft({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var w={x:s-y,y:l+f/2,textAnchor:b,verticalAnchor:"middle"};return ft(ft({},w),n?{width:Math.max(w.x-n.x,0),height:f}:{})}if(a==="right"){var j={x:s+u+y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"};return ft(ft({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return a==="insideLeft"?ft({x:s+y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"},O):a==="insideRight"?ft({x:s+u-y,y:l+f/2,textAnchor:b,verticalAnchor:"middle"},O):a==="insideTop"?ft({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},O):a==="insideBottom"?ft({x:s+u/2,y:l+f-h,textAnchor:"middle",verticalAnchor:p},O):a==="insideTopLeft"?ft({x:s+y,y:l+h,textAnchor:g,verticalAnchor:v},O):a==="insideTopRight"?ft({x:s+u-y,y:l+h,textAnchor:b,verticalAnchor:v},O):a==="insideBottomLeft"?ft({x:s+y,y:l+f-h,textAnchor:g,verticalAnchor:p},O):a==="insideBottomRight"?ft({x:s+u-y,y:l+f-h,textAnchor:b,verticalAnchor:p},O):Fs(a)&&(H(a.x)||ya(a.x))&&(H(a.y)||ya(a.y))?ft({x:s+zt(a.x,u),y:l+zt(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):ft({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},OY=function(t){return"cx"in t&&H(t.cx)};function bt(e){var t=e.offset,r=t===void 0?5:t,n=pY(e,lY),i=ft({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,d=f===void 0?"":f,h=i.textBreakAll;if(!a||re(s)&&re(l)&&!k.isValidElement(u)&&!te(u))return null;if(k.isValidElement(u))return k.cloneElement(u,i);var p;if(te(u)){if(p=k.createElement(u,i),k.isValidElement(p))return p}else p=xY(i);var v=OY(a),m=X(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return wY(i,p,m);var y=v?SY(i):jY(i);return _.createElement(Wa,Ru({className:oe("recharts-label",d)},m,y,{breakAll:h}),p)}bt.displayName="Label";var JN=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,h=t.y,p=t.top,v=t.left,m=t.width,y=t.height,b=t.clockWise,g=t.labelViewBox;if(g)return g;if(H(m)&&H(y)){if(H(d)&&H(h))return{x:d,y:h,width:m,height:y};if(H(p)&&H(v))return{x:p,y:v,width:m,height:y}}return H(d)&&H(h)?{x:d,y:h,width:0,height:0}:H(r)&&H(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:b}:t.viewBox?t.viewBox:{}},PY=function(t,r){return t?t===!0?_.createElement(bt,{key:"label-implicit",viewBox:r}):pt(t)?_.createElement(bt,{key:"label-implicit",viewBox:r,value:t}):k.isValidElement(t)?t.type===bt?k.cloneElement(t,{key:"label-implicit",viewBox:r}):_.createElement(bt,{key:"label-implicit",content:t,viewBox:r}):te(t)?_.createElement(bt,{key:"label-implicit",content:t,viewBox:r}):Fs(t)?_.createElement(bt,Ru({viewBox:r},t,{key:"label-implicit"})):null:null},_Y=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=JN(t),o=Wt(i,bt).map(function(l,u){return k.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=PY(t.label,r||a);return[s].concat(uY(o))};bt.parseViewBox=JN;bt.renderCallByParent=_Y;function kY(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var AY=kY;const e2=Se(AY);function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}var EY=["valueAccessor"],NY=["data","dataKey","clockWise","id","textBreakAll"];function TY(e){return RY(e)||MY(e)||CY(e)||$Y()}function $Y(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CY(e,t){if(e){if(typeof e=="string")return Qy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qy(e,t)}}function MY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RY(e){if(Array.isArray(e))return Qy(e)}function Qy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var BY=function(t){return Array.isArray(t.value)?e2(t.value):t.value};function Mr(e){var t=e.valueAccessor,r=t===void 0?BY:t,n=gj(e,EY),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=gj(n,NY);return!i||!i.length?null:_.createElement(se,{className:"recharts-label-list"},i.map(function(f,d){var h=re(a)?r(f,d):Ae(f&&f.payload,a),p=re(s)?{}:{id:"".concat(s,"-").concat(d)};return _.createElement(bt,Ed({},X(f,!0),u,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:l,viewBox:bt.parseViewBox(re(o)?f:yj(yj({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}Mr.displayName="LabelList";function zY(e,t){return e?e===!0?_.createElement(Mr,{key:"labelList-implicit",data:t}):_.isValidElement(e)||te(e)?_.createElement(Mr,{key:"labelList-implicit",data:t,content:e}):Fs(e)?_.createElement(Mr,Ed({data:t},e,{key:"labelList-implicit"})):null:null}function UY(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Wt(n,Mr).map(function(o,s){return k.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=zY(e.label,t);return[a].concat(TY(i))}Mr.renderCallByParent=UY;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function Yy(){return Yy=Object.assign?Object.assign.bind():function(e){for(var t=1;t=o?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:o,y:s,textAnchor:"middle",verticalAnchor:"end"};var y=(l+u)/2,b=ge(o,s,y,h),g=b.x,x=b.y;return{x:g,y:x,textAnchor:"middle",verticalAnchor:"middle"}},OY=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,a=t.position,o=r,s=o.x,l=o.y,u=o.width,f=o.height,d=f>=0?1:-1,h=d*i,p=d>0?"end":"start",v=d>0?"start":"end",m=u>=0?1:-1,y=m*i,b=m>0?"end":"start",g=m>0?"start":"end";if(a==="top"){var x={x:s+u/2,y:l-d*i,textAnchor:"middle",verticalAnchor:p};return ft(ft({},x),n?{height:Math.max(l-n.y,0),width:u}:{})}if(a==="bottom"){var S={x:s+u/2,y:l+f+h,textAnchor:"middle",verticalAnchor:v};return ft(ft({},S),n?{height:Math.max(n.y+n.height-(l+f),0),width:u}:{})}if(a==="left"){var w={x:s-y,y:l+f/2,textAnchor:b,verticalAnchor:"middle"};return ft(ft({},w),n?{width:Math.max(w.x-n.x,0),height:f}:{})}if(a==="right"){var j={x:s+u+y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"};return ft(ft({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:f}:{})}var O=n?{width:u,height:f}:{};return a==="insideLeft"?ft({x:s+y,y:l+f/2,textAnchor:g,verticalAnchor:"middle"},O):a==="insideRight"?ft({x:s+u-y,y:l+f/2,textAnchor:b,verticalAnchor:"middle"},O):a==="insideTop"?ft({x:s+u/2,y:l+h,textAnchor:"middle",verticalAnchor:v},O):a==="insideBottom"?ft({x:s+u/2,y:l+f-h,textAnchor:"middle",verticalAnchor:p},O):a==="insideTopLeft"?ft({x:s+y,y:l+h,textAnchor:g,verticalAnchor:v},O):a==="insideTopRight"?ft({x:s+u-y,y:l+h,textAnchor:b,verticalAnchor:v},O):a==="insideBottomLeft"?ft({x:s+y,y:l+f-h,textAnchor:g,verticalAnchor:p},O):a==="insideBottomRight"?ft({x:s+u-y,y:l+f-h,textAnchor:b,verticalAnchor:p},O):Fs(a)&&(H(a.x)||ya(a.x))&&(H(a.y)||ya(a.y))?ft({x:s+zt(a.x,u),y:l+zt(a.y,f),textAnchor:"end",verticalAnchor:"end"},O):ft({x:s+u/2,y:l+f/2,textAnchor:"middle",verticalAnchor:"middle"},O)},PY=function(t){return"cx"in t&&H(t.cx)};function bt(e){var t=e.offset,r=t===void 0?5:t,n=mY(e,uY),i=ft({offset:r},n),a=i.viewBox,o=i.position,s=i.value,l=i.children,u=i.content,f=i.className,d=f===void 0?"":f,h=i.textBreakAll;if(!a||re(s)&&re(l)&&!k.isValidElement(u)&&!te(u))return null;if(k.isValidElement(u))return k.cloneElement(u,i);var p;if(te(u)){if(p=k.createElement(u,i),k.isValidElement(p))return p}else p=bY(i);var v=PY(a),m=X(i,!0);if(v&&(o==="insideStart"||o==="insideEnd"||o==="end"))return SY(i,p,m);var y=v?jY(i):OY(i);return _.createElement(Wa,Ru({className:oe("recharts-label",d)},m,y,{breakAll:h}),p)}bt.displayName="Label";var e2=function(t){var r=t.cx,n=t.cy,i=t.angle,a=t.startAngle,o=t.endAngle,s=t.r,l=t.radius,u=t.innerRadius,f=t.outerRadius,d=t.x,h=t.y,p=t.top,v=t.left,m=t.width,y=t.height,b=t.clockWise,g=t.labelViewBox;if(g)return g;if(H(m)&&H(y)){if(H(d)&&H(h))return{x:d,y:h,width:m,height:y};if(H(p)&&H(v))return{x:p,y:v,width:m,height:y}}return H(d)&&H(h)?{x:d,y:h,width:0,height:0}:H(r)&&H(n)?{cx:r,cy:n,startAngle:a||i||0,endAngle:o||i||0,innerRadius:u||0,outerRadius:f||l||s||0,clockWise:b}:t.viewBox?t.viewBox:{}},_Y=function(t,r){return t?t===!0?_.createElement(bt,{key:"label-implicit",viewBox:r}):pt(t)?_.createElement(bt,{key:"label-implicit",viewBox:r,value:t}):k.isValidElement(t)?t.type===bt?k.cloneElement(t,{key:"label-implicit",viewBox:r}):_.createElement(bt,{key:"label-implicit",content:t,viewBox:r}):te(t)?_.createElement(bt,{key:"label-implicit",content:t,viewBox:r}):Fs(t)?_.createElement(bt,Ru({viewBox:r},t,{key:"label-implicit"})):null:null},kY=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,a=e2(t),o=Wt(i,bt).map(function(l,u){return k.cloneElement(l,{viewBox:r||a,key:"label-".concat(u)})});if(!n)return o;var s=_Y(t.label,r||a);return[s].concat(cY(o))};bt.parseViewBox=e2;bt.renderCallByParent=kY;function AY(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var EY=AY;const t2=Se(EY);function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}var NY=["valueAccessor"],TY=["data","dataKey","clockWise","id","textBreakAll"];function $Y(e){return DY(e)||RY(e)||MY(e)||CY()}function CY(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MY(e,t){if(e){if(typeof e=="string")return Yy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yy(e,t)}}function RY(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function DY(e){if(Array.isArray(e))return Yy(e)}function Yy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function BY(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var zY=function(t){return Array.isArray(t.value)?t2(t.value):t.value};function Mr(e){var t=e.valueAccessor,r=t===void 0?zY:t,n=xj(e,NY),i=n.data,a=n.dataKey,o=n.clockWise,s=n.id,l=n.textBreakAll,u=xj(n,TY);return!i||!i.length?null:_.createElement(se,{className:"recharts-label-list"},i.map(function(f,d){var h=re(a)?r(f,d):Ae(f&&f.payload,a),p=re(s)?{}:{id:"".concat(s,"-").concat(d)};return _.createElement(bt,Ed({},X(f,!0),u,p,{parentViewBox:f.parentViewBox,value:h,textBreakAll:l,viewBox:bt.parseViewBox(re(o)?f:gj(gj({},f),{},{clockWise:o})),key:"label-".concat(d),index:d}))}))}Mr.displayName="LabelList";function UY(e,t){return e?e===!0?_.createElement(Mr,{key:"labelList-implicit",data:t}):_.isValidElement(e)||te(e)?_.createElement(Mr,{key:"labelList-implicit",data:t,content:e}):Fs(e)?_.createElement(Mr,Ed({data:t},e,{key:"labelList-implicit"})):null:null}function qY(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Wt(n,Mr).map(function(o,s){return k.cloneElement(o,{data:t,key:"labelList-".concat(s)})});if(!r)return i;var a=UY(e.label,t);return[a].concat($Y(i))}Mr.renderCallByParent=qY;function Iu(e){"@babel/helpers - typeof";return Iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iu(e)}function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(o>u),`, `).concat(d.x,",").concat(d.y,` `);if(i>0){var p=ge(r,n,i,o),v=ge(r,n,i,u);h+="L ".concat(v.x,",").concat(v.y,` A `).concat(i,",").concat(i,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(o<=u),`, - `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},VY=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=Bt(f-u),h=tf({cx:r,cy:n,radius:a,angle:u,sign:d,cornerRadius:o,cornerIsExternal:l}),p=h.circleTangency,v=h.lineTangency,m=h.theta,y=tf({cx:r,cy:n,radius:a,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:l}),b=y.circleTangency,g=y.lineTangency,x=y.theta,S=l?Math.abs(u-f):Math.abs(u-f)-m-x;if(S<0)return s?"M ".concat(v.x,",").concat(v.y,` + `).concat(p.x,",").concat(p.y," Z")}else h+="L ".concat(r,",").concat(n," Z");return h},GY=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,u=t.startAngle,f=t.endAngle,d=Bt(f-u),h=tf({cx:r,cy:n,radius:a,angle:u,sign:d,cornerRadius:o,cornerIsExternal:l}),p=h.circleTangency,v=h.lineTangency,m=h.theta,y=tf({cx:r,cy:n,radius:a,angle:f,sign:-d,cornerRadius:o,cornerIsExternal:l}),b=y.circleTangency,g=y.lineTangency,x=y.theta,S=l?Math.abs(u-f):Math.abs(u-f)-m-x;if(S<0)return s?"M ".concat(v.x,",").concat(v.y,` a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 - `):t2({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var w="M ".concat(v.x,",").concat(v.y,` + `):r2({cx:r,cy:n,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f});var w="M ".concat(v.x,",").concat(v.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(p.x,",").concat(p.y,` A`).concat(a,",").concat(a,",0,").concat(+(S>180),",").concat(+(d<0),",").concat(b.x,",").concat(b.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(g.x,",").concat(g.y,` `);if(i>0){var j=tf({cx:r,cy:n,radius:i,angle:u,sign:d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),O=j.circleTangency,P=j.lineTangency,A=j.theta,E=tf({cx:r,cy:n,radius:i,angle:f,sign:-d,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),N=E.circleTangency,T=E.lineTangency,M=E.theta,R=l?Math.abs(u-f):Math.abs(u-f)-A-M;if(R<0&&o===0)return"".concat(w,"L").concat(r,",").concat(n,"Z");w+="L".concat(T.x,",").concat(T.y,` A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(N.x,",").concat(N.y,` A`).concat(i,",").concat(i,",0,").concat(+(R>180),",").concat(+(d>0),",").concat(O.x,",").concat(O.y,` - A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,"Z")}else w+="L".concat(r,",").concat(n,"Z");return w},GY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},r2=function(t){var r=bj(bj({},GY),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,h=r.className;if(o0&&Math.abs(f-d)<360?y=VY({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:d}):y=t2({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:d}),_.createElement("path",Yy({},X(r,!0),{className:p,d:y,role:"img"}))};function Lu(e){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(e)}function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;tsX.call(e,t));function eo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const cX="__v",fX="__o",dX="_owner",{getOwnPropertyDescriptor:Pj,keys:_j}=Object;function hX(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e),new Uint8Array(t))}function pX(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function mX(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function vX(e,t){return eo(e.getTime(),t.getTime())}function yX(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function gX(e,t){return e===t}function kj(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let f=!1,d=0;for(;(s=u.next())&&!s.done;){if(i[d]){d++;continue}const h=o.value,p=s.value;if(r.equals(h[0],p[0],l,d,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=i[d]=!0;break}d++}if(!f)return!1;l++}return!0}const xX=eo;function bX(e,t,r){const n=_j(e);let i=n.length;if(_j(t).length!==i)return!1;for(;i-- >0;)if(!o2(e,t,r,n[i]))return!1;return!0}function bl(e,t,r){const n=Oj(e);let i=n.length;if(Oj(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!o2(e,t,r,a)||(o=Pj(e,a),s=Pj(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function wX(e,t){return eo(e.valueOf(),t.valueOf())}function SX(e,t){return e.source===t.source&&e.flags===t.flags}function Aj(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function Nd(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function jX(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function o2(e,t,r,n){return(n===dX||n===fX||n===cX)&&(e.$$typeof||t.$$typeof)?!0:uX(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const OX="[object ArrayBuffer]",PX="[object Arguments]",_X="[object Boolean]",kX="[object DataView]",AX="[object Date]",EX="[object Error]",NX="[object Map]",TX="[object Number]",$X="[object Object]",CX="[object RegExp]",MX="[object Set]",RX="[object String]",DX={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},IX="[object URL]",LX=Object.prototype.toString;function FX({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:v}){return function(y,b,g){if(y===b)return!0;if(y==null||b==null)return!1;const x=typeof y;if(x!==typeof b)return!1;if(x!=="object")return x==="number"?s(y,b,g):x==="function"?a(y,b,g):!1;const S=y.constructor;if(S!==b.constructor)return!1;if(S===Object)return l(y,b,g);if(Array.isArray(y))return t(y,b,g);if(S===Date)return n(y,b,g);if(S===RegExp)return f(y,b,g);if(S===Map)return o(y,b,g);if(S===Set)return d(y,b,g);const w=LX.call(y);if(w===AX)return n(y,b,g);if(w===CX)return f(y,b,g);if(w===NX)return o(y,b,g);if(w===MX)return d(y,b,g);if(w===$X)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,g);if(w===IX)return p(y,b,g);if(w===EX)return i(y,b,g);if(w===PX)return l(y,b,g);if(DX[w])return h(y,b,g);if(w===OX)return e(y,b,g);if(w===kX)return r(y,b,g);if(w===_X||w===TX||w===RX)return u(y,b,g);if(v){let j=v[w];if(!j){const O=lX(y);O&&(j=v[O])}if(j)return j(y,b,g)}return!1}}function BX({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:hX,areArraysEqual:r?bl:pX,areDataViewsEqual:mX,areDatesEqual:vX,areErrorsEqual:yX,areFunctionsEqual:gX,areMapsEqual:r?Tm(kj,bl):kj,areNumbersEqual:xX,areObjectsEqual:r?bl:bX,arePrimitiveWrappersEqual:wX,areRegExpsEqual:SX,areSetsEqual:r?Tm(Aj,bl):Aj,areTypedArraysEqual:r?Tm(Nd,bl):Nd,areUrlsEqual:jX,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=nf(n.areArraysEqual),a=nf(n.areMapsEqual),o=nf(n.areObjectsEqual),s=nf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function zX(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function UX({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const qX=Zi();Zi({strict:!0});Zi({circular:!0});Zi({circular:!0,strict:!0});Zi({createInternalComparator:()=>eo});Zi({strict:!0,createInternalComparator:()=>eo});Zi({circular:!0,createInternalComparator:()=>eo});Zi({circular:!0,createInternalComparator:()=>eo,strict:!0});function Zi(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=BX(e),o=FX(a),s=r?r(o):zX(o);return UX({circular:t,comparator:o,createState:n,equals:s,strict:i})}function WX(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Ej(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):WX(i)};requestAnimationFrame(n)}function Zy(e){"@babel/helpers - typeof";return Zy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zy(e)}function HX(e){return QX(e)||GX(e)||VX(e)||KX()}function KX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VX(e,t){if(e){if(typeof e=="string")return Nj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nj(e,t)}}function Nj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:b<0?0:b},m=function(b){for(var g=b>1?1:b,x=g,S=0;S<8;++S){var w=d(x)-g,j=p(x);if(Math.abs(w-g)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(f,d,h){var p=-(f-d)*n,v=h*a,m=h+(p-v)*s/1e3,y=h*s/1e3+f;return Math.abs(y-d)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _Z(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function $m(e){return NZ(e)||EZ(e)||AZ(e)||kZ()}function kZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AZ(e,t){if(e){if(typeof e=="string")return ng(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ng(e,t)}}function EZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NZ(e){if(Array.isArray(e))return ng(e)}function ng(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cd(e){return Cd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cd(e)}var xr=function(e){RZ(r,e);var t=DZ(r);function r(n,i){var a;TZ(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,d=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(og(a)),a.changeStyle=a.changeStyle.bind(og(a)),!s||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:f}),ag(a);if(d&&d.length)a.state={style:d[0].style};else if(u){if(typeof h=="function")return a.state={style:u},ag(a);a.state={style:l?Nl({},l,u):u}}else a.state={style:{}};return a}return CZ(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,d=a.from,h=this.state.style;if(s){if(!o){var p={style:l?Nl({},l,f):f};this.state&&h&&(l&&h[l]!==f||!l&&h!==f)&&this.setState(p);return}if(!(qX(i.to,f)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=v||u?d:i.to;if(this.state&&h){var y={style:l?Nl({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(y)}this.runAnimation(zr(zr({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,f=i.begin,d=i.onAnimationEnd,h=i.onAnimationStart,p=jZ(o,s,dZ(u),l,this.changeStyle),v=function(){a.stopJSAnimation=p()};this.manager.start([h,f,v,l,d])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,d=u.duration,h=d===void 0?0:d,p=function(m,y,b){if(b===0)return m;var g=y.duration,x=y.easing,S=x===void 0?"ease":x,w=y.style,j=y.properties,O=y.onAnimationEnd,P=b>0?o[b-1]:y,A=j||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat($m(m),[a.runJSAnimation.bind(a,{from:P.style,to:w,duration:g,easing:S}),g]);var E=Cj(A,g,S),N=zr(zr(zr({},P.style),w),{},{transition:E});return[].concat($m(m),[N,g,O]).filter(eZ)};return this.manager.start([l].concat($m(o.reduce(p,[f,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=YX());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,d=i.onAnimationEnd,h=i.steps,p=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=s?Nl({},s,l):l,y=Cj(Object.keys(m),o,u);v.start([f,a,zr(zr({},m),{},{transition:y}),o,d])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=PZ(i,OZ),u=k.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var d=function(p){var v=p.props,m=v.style,y=m===void 0?{}:m,b=v.className,g=k.cloneElement(p,zr(zr({},l),{},{style:zr(zr({},y),f),className:b}));return g};return u===1?d(k.Children.only(a)):_.createElement("div",null,k.Children.map(a,function(h){return d(h)}))}}]),r}(k.PureComponent);xr.displayName="Animate";xr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};xr.propTypes={from:xe.oneOfType([xe.object,xe.string]),to:xe.oneOfType([xe.object,xe.string]),attributeName:xe.string,duration:xe.number,begin:xe.number,easing:xe.oneOfType([xe.string,xe.func]),steps:xe.arrayOf(xe.shape({duration:xe.number.isRequired,style:xe.object.isRequired,easing:xe.oneOfType([xe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),xe.func]),properties:xe.arrayOf("string"),onAnimationEnd:xe.func})),children:xe.oneOfType([xe.node,xe.func]),isActive:xe.bool,canBegin:xe.bool,onAnimationEnd:xe.func,shouldReAnimate:xe.bool,onAnimationStart:xe.func,onAnimationReStart:xe.func};function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function Md(){return Md=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var d=[0,0,0,0],h=0,p=4;ho?o:a[h];f="M".concat(t,",").concat(r+s*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+l*d[0],",").concat(r)),f+="L ".concat(t+n-l*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, + A`).concat(o,",").concat(o,",0,0,").concat(+(d<0),",").concat(P.x,",").concat(P.y,"Z")}else w+="L".concat(r,",").concat(n,"Z");return w},QY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},n2=function(t){var r=wj(wj({},QY),t),n=r.cx,i=r.cy,a=r.innerRadius,o=r.outerRadius,s=r.cornerRadius,l=r.forceCornerRadius,u=r.cornerIsExternal,f=r.startAngle,d=r.endAngle,h=r.className;if(o0&&Math.abs(f-d)<360?y=GY({cx:n,cy:i,innerRadius:a,outerRadius:o,cornerRadius:Math.min(m,v/2),forceCornerRadius:l,cornerIsExternal:u,startAngle:f,endAngle:d}):y=r2({cx:n,cy:i,innerRadius:a,outerRadius:o,startAngle:f,endAngle:d}),_.createElement("path",Xy({},X(r,!0),{className:p,d:y,role:"img"}))};function Lu(e){"@babel/helpers - typeof";return Lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lu(e)}function Zy(){return Zy=Object.assign?Object.assign.bind():function(e){for(var t=1;tlX.call(e,t));function eo(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const fX="__v",dX="__o",hX="_owner",{getOwnPropertyDescriptor:_j,keys:kj}=Object;function pX(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e),new Uint8Array(t))}function mX(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function vX(e,t){return e.byteLength===t.byteLength&&Nd(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function yX(e,t){return eo(e.getTime(),t.getTime())}function gX(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function xX(e,t){return e===t}function Aj(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.entries();let o,s,l=0;for(;(o=a.next())&&!o.done;){const u=t.entries();let f=!1,d=0;for(;(s=u.next())&&!s.done;){if(i[d]){d++;continue}const h=o.value,p=s.value;if(r.equals(h[0],p[0],l,d,e,t,r)&&r.equals(h[1],p[1],h[0],p[0],e,t,r)){f=i[d]=!0;break}d++}if(!f)return!1;l++}return!0}const bX=eo;function wX(e,t,r){const n=kj(e);let i=n.length;if(kj(t).length!==i)return!1;for(;i-- >0;)if(!s2(e,t,r,n[i]))return!1;return!0}function bl(e,t,r){const n=Pj(e);let i=n.length;if(Pj(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=n[i],!s2(e,t,r,a)||(o=_j(e,a),s=_j(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function SX(e,t){return eo(e.valueOf(),t.valueOf())}function jX(e,t){return e.source===t.source&&e.flags===t.flags}function Ej(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),a=e.values();let o,s;for(;(o=a.next())&&!o.done;){const l=t.values();let u=!1,f=0;for(;(s=l.next())&&!s.done;){if(!i[f]&&r.equals(o.value,s.value,o.value,s.value,e,t,r)){u=i[f]=!0;break}f++}if(!u)return!1}return!0}function Nd(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function OX(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function s2(e,t,r,n){return(n===hX||n===dX||n===fX)&&(e.$$typeof||t.$$typeof)?!0:cX(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const PX="[object ArrayBuffer]",_X="[object Arguments]",kX="[object Boolean]",AX="[object DataView]",EX="[object Date]",NX="[object Error]",TX="[object Map]",$X="[object Number]",CX="[object Object]",MX="[object RegExp]",RX="[object Set]",DX="[object String]",IX={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},LX="[object URL]",FX=Object.prototype.toString;function BX({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:u,areRegExpsEqual:f,areSetsEqual:d,areTypedArraysEqual:h,areUrlsEqual:p,unknownTagComparators:v}){return function(y,b,g){if(y===b)return!0;if(y==null||b==null)return!1;const x=typeof y;if(x!==typeof b)return!1;if(x!=="object")return x==="number"?s(y,b,g):x==="function"?a(y,b,g):!1;const S=y.constructor;if(S!==b.constructor)return!1;if(S===Object)return l(y,b,g);if(Array.isArray(y))return t(y,b,g);if(S===Date)return n(y,b,g);if(S===RegExp)return f(y,b,g);if(S===Map)return o(y,b,g);if(S===Set)return d(y,b,g);const w=FX.call(y);if(w===EX)return n(y,b,g);if(w===MX)return f(y,b,g);if(w===TX)return o(y,b,g);if(w===RX)return d(y,b,g);if(w===CX)return typeof y.then!="function"&&typeof b.then!="function"&&l(y,b,g);if(w===LX)return p(y,b,g);if(w===NX)return i(y,b,g);if(w===_X)return l(y,b,g);if(IX[w])return h(y,b,g);if(w===PX)return e(y,b,g);if(w===AX)return r(y,b,g);if(w===kX||w===$X||w===DX)return u(y,b,g);if(v){let j=v[w];if(!j){const O=uX(y);O&&(j=v[O])}if(j)return j(y,b,g)}return!1}}function zX({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:pX,areArraysEqual:r?bl:mX,areDataViewsEqual:vX,areDatesEqual:yX,areErrorsEqual:gX,areFunctionsEqual:xX,areMapsEqual:r?Tm(Aj,bl):Aj,areNumbersEqual:bX,areObjectsEqual:r?bl:wX,arePrimitiveWrappersEqual:SX,areRegExpsEqual:jX,areSetsEqual:r?Tm(Ej,bl):Ej,areTypedArraysEqual:r?Tm(Nd,bl):Nd,areUrlsEqual:OX,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=nf(n.areArraysEqual),a=nf(n.areMapsEqual),o=nf(n.areObjectsEqual),s=nf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:o,areSetsEqual:s})}return n}function UX(e){return function(t,r,n,i,a,o,s){return e(t,r,s)}}function qX({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(s,l){const{cache:u=e?new WeakMap:void 0,meta:f}=r();return t(s,l,{cache:u,equals:n,meta:f,strict:i})};if(e)return function(s,l){return t(s,l,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const a={cache:void 0,equals:n,meta:void 0,strict:i};return function(s,l){return t(s,l,a)}}const WX=Zi();Zi({strict:!0});Zi({circular:!0});Zi({circular:!0,strict:!0});Zi({createInternalComparator:()=>eo});Zi({strict:!0,createInternalComparator:()=>eo});Zi({circular:!0,createInternalComparator:()=>eo});Zi({circular:!0,createInternalComparator:()=>eo,strict:!0});function Zi(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,a=zX(e),o=BX(a),s=r?r(o):UX(o);return qX({circular:t,comparator:o,createState:n,equals:s,strict:i})}function HX(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function Nj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(a){r<0&&(r=a),a-r>t?(e(a),r=-1):HX(i)};requestAnimationFrame(n)}function Jy(e){"@babel/helpers - typeof";return Jy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jy(e)}function KX(e){return YX(e)||QX(e)||GX(e)||VX()}function VX(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GX(e,t){if(e){if(typeof e=="string")return Tj(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Tj(e,t)}}function Tj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:b<0?0:b},m=function(b){for(var g=b>1?1:b,x=g,S=0;S<8;++S){var w=d(x)-g,j=p(x);if(Math.abs(w-g)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,a=i===void 0?8:i,o=t.dt,s=o===void 0?17:o,l=function(f,d,h){var p=-(f-d)*n,v=h*a,m=h+(p-v)*s/1e3,y=h*s/1e3+f;return Math.abs(y-d)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kZ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a=0)&&(r[i]=e[i]);return r}function $m(e){return TZ(e)||NZ(e)||EZ(e)||AZ()}function AZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function EZ(e,t){if(e){if(typeof e=="string")return ig(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ig(e,t)}}function NZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TZ(e){if(Array.isArray(e))return ig(e)}function ig(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Cd(e){return Cd=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cd(e)}var xr=function(e){DZ(r,e);var t=IZ(r);function r(n,i){var a;$Z(this,r),a=t.call(this,n,i);var o=a.props,s=o.isActive,l=o.attributeName,u=o.from,f=o.to,d=o.steps,h=o.children,p=o.duration;if(a.handleStyleChange=a.handleStyleChange.bind(sg(a)),a.changeStyle=a.changeStyle.bind(sg(a)),!s||p<=0)return a.state={style:{}},typeof h=="function"&&(a.state={style:f}),og(a);if(d&&d.length)a.state={style:d[0].style};else if(u){if(typeof h=="function")return a.state={style:u},og(a);a.state={style:l?Nl({},l,u):u}}else a.state={style:{}};return a}return MZ(r,[{key:"componentDidMount",value:function(){var i=this.props,a=i.isActive,o=i.canBegin;this.mounted=!0,!(!a||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var a=this.props,o=a.isActive,s=a.canBegin,l=a.attributeName,u=a.shouldReAnimate,f=a.to,d=a.from,h=this.state.style;if(s){if(!o){var p={style:l?Nl({},l,f):f};this.state&&h&&(l&&h[l]!==f||!l&&h!==f)&&this.setState(p);return}if(!(WX(i.to,f)&&i.canBegin&&i.isActive)){var v=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var m=v||u?d:i.to;if(this.state&&h){var y={style:l?Nl({},l,m):m};(l&&h[l]!==m||!l&&h!==m)&&this.setState(y)}this.runAnimation(zr(zr({},this.props),{},{from:m,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var a=this,o=i.from,s=i.to,l=i.duration,u=i.easing,f=i.begin,d=i.onAnimationEnd,h=i.onAnimationStart,p=OZ(o,s,hZ(u),l,this.changeStyle),v=function(){a.stopJSAnimation=p()};this.manager.start([h,f,v,l,d])}},{key:"runStepAnimation",value:function(i){var a=this,o=i.steps,s=i.begin,l=i.onAnimationStart,u=o[0],f=u.style,d=u.duration,h=d===void 0?0:d,p=function(m,y,b){if(b===0)return m;var g=y.duration,x=y.easing,S=x===void 0?"ease":x,w=y.style,j=y.properties,O=y.onAnimationEnd,P=b>0?o[b-1]:y,A=j||Object.keys(w);if(typeof S=="function"||S==="spring")return[].concat($m(m),[a.runJSAnimation.bind(a,{from:P.style,to:w,duration:g,easing:S}),g]);var E=Mj(A,g,S),N=zr(zr(zr({},P.style),w),{},{transition:E});return[].concat($m(m),[N,g,O]).filter(tZ)};return this.manager.start([l].concat($m(o.reduce(p,[f,Math.max(h,s)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=XX());var a=i.begin,o=i.duration,s=i.attributeName,l=i.to,u=i.easing,f=i.onAnimationStart,d=i.onAnimationEnd,h=i.steps,p=i.children,v=this.manager;if(this.unSubscribe=v.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(i);return}if(h.length>1){this.runStepAnimation(i);return}var m=s?Nl({},s,l):l,y=Mj(Object.keys(m),o,u);v.start([f,a,zr(zr({},m),{},{transition:y}),o,d])}},{key:"render",value:function(){var i=this.props,a=i.children;i.begin;var o=i.duration;i.attributeName,i.easing;var s=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var l=_Z(i,PZ),u=k.Children.count(a),f=this.state.style;if(typeof a=="function")return a(f);if(!s||u===0||o<=0)return a;var d=function(p){var v=p.props,m=v.style,y=m===void 0?{}:m,b=v.className,g=k.cloneElement(p,zr(zr({},l),{},{style:zr(zr({},y),f),className:b}));return g};return u===1?d(k.Children.only(a)):_.createElement("div",null,k.Children.map(a,function(h){return d(h)}))}}]),r}(k.PureComponent);xr.displayName="Animate";xr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};xr.propTypes={from:xe.oneOfType([xe.object,xe.string]),to:xe.oneOfType([xe.object,xe.string]),attributeName:xe.string,duration:xe.number,begin:xe.number,easing:xe.oneOfType([xe.string,xe.func]),steps:xe.arrayOf(xe.shape({duration:xe.number.isRequired,style:xe.object.isRequired,easing:xe.oneOfType([xe.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),xe.func]),properties:xe.arrayOf("string"),onAnimationEnd:xe.func})),children:xe.oneOfType([xe.node,xe.func]),isActive:xe.bool,canBegin:xe.bool,onAnimationEnd:xe.func,shouldReAnimate:xe.bool,onAnimationStart:xe.func,onAnimationReStart:xe.func};function zu(e){"@babel/helpers - typeof";return zu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zu(e)}function Md(){return Md=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,l=n>=0?1:-1,u=i>=0&&n>=0||i<0&&n<0?1:0,f;if(o>0&&a instanceof Array){for(var d=[0,0,0,0],h=0,p=4;ho?o:a[h];f="M".concat(t,",").concat(r+s*d[0]),d[0]>0&&(f+="A ".concat(d[0],",").concat(d[0],",0,0,").concat(u,",").concat(t+l*d[0],",").concat(r)),f+="L ".concat(t+n-l*d[1],",").concat(r),d[1]>0&&(f+="A ".concat(d[1],",").concat(d[1],",0,0,").concat(u,`, `).concat(t+n,",").concat(r+s*d[1])),f+="L ".concat(t+n,",").concat(r+i-s*d[2]),d[2]>0&&(f+="A ".concat(d[2],",").concat(d[2],",0,0,").concat(u,`, `).concat(t+n-l*d[2],",").concat(r+i)),f+="L ".concat(t+l*d[3],",").concat(r+i),d[3]>0&&(f+="A ".concat(d[3],",").concat(d[3],",0,0,").concat(u,`, `).concat(t,",").concat(r+i-s*d[3])),f+="Z"}else if(o>0&&a===+a&&a>0){var v=Math.min(o,a);f="M ".concat(t,",").concat(r+s*v,` @@ -249,22 +249,22 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+n,",").concat(r+i-s*v,` A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t+n-l*v,",").concat(r+i,` L `).concat(t+l*v,",").concat(r+i,` - A `).concat(v,",").concat(v,",0,0,").concat(u,",").concat(t,",").concat(r+i-s*v," Z")}else f="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return f},KZ=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,a=r.x,o=r.y,s=r.width,l=r.height;if(Math.abs(s)>0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),d=Math.min(o,o+l),h=Math.max(o,o+l);return n>=u&&n<=f&&i>=d&&i<=h}return!1},VZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Ub=function(t){var r=zj(zj({},VZ),t),n=k.useRef(),i=k.useState(-1),a=LZ(i,2),o=a[0],s=a[1];k.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,d=r.height,h=r.radius,p=r.className,v=r.animationEasing,m=r.animationDuration,y=r.animationBegin,b=r.isAnimationActive,g=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var x=oe("recharts-rectangle",p);return g?_.createElement(xr,{canBegin:o>0,from:{width:f,height:d,x:l,y:u},to:{width:f,height:d,x:l,y:u},duration:m,animationEasing:v,isActive:g},function(S){var w=S.width,j=S.height,O=S.x,P=S.y;return _.createElement(xr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:b,easing:v},_.createElement("path",Md({},X(r,!0),{className:x,d:Uj(O,P,w,j,h),ref:n})))}):_.createElement("path",Md({},X(r,!0),{className:x,d:Uj(l,u,f,d,h)}))},GZ=["points","className","baseLinePoints","connectNulls"];function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function qj(e){return eJ(e)||JZ(e)||ZZ(e)||XZ()}function XZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZZ(e,t){if(e){if(typeof e=="string")return sg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sg(e,t)}}function JZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function eJ(e){if(Array.isArray(e))return sg(e)}function sg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Wj(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Wj(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Wl=function(t,r){var n=tJ(t);r&&(n=[n.reduce(function(a,o){return[].concat(qj(a),qj(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},rJ=function(t,r,n){var i=Wl(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Wl(r.reverse(),n).slice(1))},h2=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=QZ(t,GZ);if(!r||!r.length)return null;var s=oe("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=rJ(r,i,a);return _.createElement("g",{className:s},_.createElement("path",So({},X(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?_.createElement("path",So({},X(o,!0),{fill:"none",d:Wl(r,a)})):null,l?_.createElement("path",So({},X(o,!0),{fill:"none",d:Wl(i,a)})):null)}var f=Wl(r,a);return _.createElement("path",So({},X(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function lg(){return lg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function uJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var cJ=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},fJ=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,d=f===void 0?0:f,h=t.height,p=h===void 0?0:h,v=t.className,m=lJ(t,nJ),y=iJ({x:n,y:a,top:s,left:u,width:d,height:p},m);return!H(n)||!H(a)||!H(d)||!H(p)||!H(s)||!H(u)?null:_.createElement("path",ug({},X(y,!0),{className:oe("recharts-cross",v),d:cJ(n,a,d,p,s,u)}))},dJ=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function qu(e){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qu(e)}function hJ(e,t){if(e==null)return{};var r=pJ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function pJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function IJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function LJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qj(e,t){for(var r=0;rZj?o=i==="outer"?"start":"end":a<-Zj?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=ia(ia({},X(this.props,!1)),{},{fill:"none"},X(s,!1));if(l==="circle")return _.createElement(Xs,fa({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,d=f.map(function(h){return ge(i,a,o,h.coordinate)});return _.createElement(h2,fa({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=X(this.props,!1),d=X(o,!1),h=ia(ia({},f),{},{fill:"none"},X(s,!1)),p=a.map(function(v,m){var y=n.getTickLineCoord(v),b=n.getTickTextAnchor(v),g=ia(ia(ia({textAnchor:b},f),{},{stroke:"none",fill:u},d),{},{index:m,payload:v,x:y.x2,y:y.y2});return _.createElement(se,fa({className:oe("recharts-polar-angle-axis-tick",ZN(o)),key:"tick-".concat(v.coordinate)},zi(n.props,v,m)),s&&_.createElement("line",fa({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&t.renderTickItem(o,g,l?l(v.value,m):v.value))});return _.createElement(se,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:_.createElement(se,{className:oe("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return _.isValidElement(n)?o=_.cloneElement(n,i):te(n)?o=n(i):o=_.createElement(Wa,fa({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(k.PureComponent);mp(Js,"displayName","PolarAngleAxis");mp(Js,"axisType","angleAxis");mp(Js,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var JJ=xE,eee=JJ(Object.getPrototypeOf,Object),tee=eee,ree=Zn,nee=tee,iee=Jn,aee="[object Object]",oee=Function.prototype,see=Object.prototype,x2=oee.toString,lee=see.hasOwnProperty,uee=x2.call(Object);function cee(e){if(!iee(e)||ree(e)!=aee)return!1;var t=nee(e);if(t===null)return!0;var r=lee.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&x2.call(r)==uee}var fee=cee;const dee=Se(fee);var hee=Zn,pee=Jn,mee="[object Boolean]";function vee(e){return e===!0||e===!1||pee(e)&&hee(e)==mee}var yee=vee;const gee=Se(yee);function Hu(e){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(e)}function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:f,lowerWidth:d,height:h,x:l,y:u},duration:m,animationEasing:v,isActive:b},function(x){var S=x.upperWidth,w=x.lowerWidth,j=x.height,O=x.x,P=x.y;return _.createElement(xr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:v},_.createElement("path",Id({},X(r,!0),{className:g,d:rO(O,P,S,w,j),ref:n})))}):_.createElement("g",null,_.createElement("path",Id({},X(r,!0),{className:g,d:rO(l,u,f,d,h)})))},Eee=["option","shapeType","propTransformer","activeClassName","isActive"];function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function Nee(e,t){if(e==null)return{};var r=Tee(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Tee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ld(e){for(var t=1;t0?mr(x,"paddingAngle",0):0;if(w){var O=ke(w.endAngle-w.startAngle,x.endAngle-x.startAngle),P=Ne(Ne({},x),{},{startAngle:g+j,endAngle:g+O(m)+j});y.push(P),g=P.endAngle}else{var A=x.endAngle,E=x.startAngle,N=ke(0,A-E),T=N(m),M=Ne(Ne({},x),{},{startAngle:g+j,endAngle:g+T+j});y.push(M),g=M.endAngle}}),_.createElement(se,null,n.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Gn(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,f=i.cy,d=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,v=this.state.isAnimationFinished;if(a||!o||!o.length||!H(u)||!H(f)||!H(d)||!H(h))return null;var m=oe("recharts-pie",s);return _.createElement(se,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){n.pieRef=b}},this.renderSectors(),l&&this.renderLabels(o),bt.renderCallByParent(this.props,null,!1),(!p||v)&&Mr.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n0&&Math.abs(l)>0){var u=Math.min(a,a+s),f=Math.max(a,a+s),d=Math.min(o,o+l),h=Math.max(o,o+l);return n>=u&&n<=f&&i>=d&&i<=h}return!1},GZ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qb=function(t){var r=Uj(Uj({},GZ),t),n=k.useRef(),i=k.useState(-1),a=FZ(i,2),o=a[0],s=a[1];k.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&s(S)}catch{}},[]);var l=r.x,u=r.y,f=r.width,d=r.height,h=r.radius,p=r.className,v=r.animationEasing,m=r.animationDuration,y=r.animationBegin,b=r.isAnimationActive,g=r.isUpdateAnimationActive;if(l!==+l||u!==+u||f!==+f||d!==+d||f===0||d===0)return null;var x=oe("recharts-rectangle",p);return g?_.createElement(xr,{canBegin:o>0,from:{width:f,height:d,x:l,y:u},to:{width:f,height:d,x:l,y:u},duration:m,animationEasing:v,isActive:g},function(S){var w=S.width,j=S.height,O=S.x,P=S.y;return _.createElement(xr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,isActive:b,easing:v},_.createElement("path",Md({},X(r,!0),{className:x,d:qj(O,P,w,j,h),ref:n})))}):_.createElement("path",Md({},X(r,!0),{className:x,d:qj(l,u,f,d,h)}))},QZ=["points","className","baseLinePoints","connectNulls"];function So(){return So=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function XZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Wj(e){return tJ(e)||eJ(e)||JZ(e)||ZZ()}function ZZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JZ(e,t){if(e){if(typeof e=="string")return lg(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lg(e,t)}}function eJ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tJ(e){if(Array.isArray(e))return lg(e)}function lg(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){Hj(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),Hj(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},Wl=function(t,r){var n=rJ(t);r&&(n=[n.reduce(function(a,o){return[].concat(Wj(a),Wj(o))},[])]);var i=n.map(function(a){return a.reduce(function(o,s,l){return"".concat(o).concat(l===0?"M":"L").concat(s.x,",").concat(s.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},nJ=function(t,r,n){var i=Wl(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Wl(r.reverse(),n).slice(1))},p2=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,a=t.connectNulls,o=YZ(t,QZ);if(!r||!r.length)return null;var s=oe("recharts-polygon",n);if(i&&i.length){var l=o.stroke&&o.stroke!=="none",u=nJ(r,i,a);return _.createElement("g",{className:s},_.createElement("path",So({},X(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),l?_.createElement("path",So({},X(o,!0),{fill:"none",d:Wl(r,a)})):null,l?_.createElement("path",So({},X(o,!0),{fill:"none",d:Wl(i,a)})):null)}var f=Wl(r,a);return _.createElement("path",So({},X(o,!0),{fill:f.slice(-1)==="Z"?o.fill:"none",className:s,d:f}))};function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var fJ=function(t,r,n,i,a,o){return"M".concat(t,",").concat(a,"v").concat(i,"M").concat(o,",").concat(r,"h").concat(n)},dJ=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,a=i===void 0?0:i,o=t.top,s=o===void 0?0:o,l=t.left,u=l===void 0?0:l,f=t.width,d=f===void 0?0:f,h=t.height,p=h===void 0?0:h,v=t.className,m=uJ(t,iJ),y=aJ({x:n,y:a,top:s,left:u,width:d,height:p},m);return!H(n)||!H(a)||!H(d)||!H(p)||!H(s)||!H(u)?null:_.createElement("path",cg({},X(y,!0),{className:oe("recharts-cross",v),d:fJ(n,a,d,p,s,u)}))},hJ=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function qu(e){"@babel/helpers - typeof";return qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qu(e)}function pJ(e,t){if(e==null)return{};var r=mJ(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function FJ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yj(e,t){for(var r=0;rJj?o=i==="outer"?"start":"end":a<-Jj?o=i==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,a=n.cy,o=n.radius,s=n.axisLine,l=n.axisLineType,u=ia(ia({},X(this.props,!1)),{},{fill:"none"},X(s,!1));if(l==="circle")return _.createElement(Xs,fa({className:"recharts-polar-angle-axis-line"},u,{cx:i,cy:a,r:o}));var f=this.props.ticks,d=f.map(function(h){return ge(i,a,o,h.coordinate)});return _.createElement(p2,fa({className:"recharts-polar-angle-axis-line"},u,{points:d}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,a=i.ticks,o=i.tick,s=i.tickLine,l=i.tickFormatter,u=i.stroke,f=X(this.props,!1),d=X(o,!1),h=ia(ia({},f),{},{fill:"none"},X(s,!1)),p=a.map(function(v,m){var y=n.getTickLineCoord(v),b=n.getTickTextAnchor(v),g=ia(ia(ia({textAnchor:b},f),{},{stroke:"none",fill:u},d),{},{index:m,payload:v,x:y.x2,y:y.y2});return _.createElement(se,fa({className:oe("recharts-polar-angle-axis-tick",JN(o)),key:"tick-".concat(v.coordinate)},zi(n.props,v,m)),s&&_.createElement("line",fa({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&t.renderTickItem(o,g,l?l(v.value,m):v.value))});return _.createElement(se,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,i=n.ticks,a=n.radius,o=n.axisLine;return a<=0||!i||!i.length?null:_.createElement(se,{className:oe("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,a){var o;return _.isValidElement(n)?o=_.cloneElement(n,i):te(n)?o=n(i):o=_.createElement(Wa,fa({},i,{className:"recharts-polar-angle-axis-tick-value"}),a),o}}])}(k.PureComponent);mp(Js,"displayName","PolarAngleAxis");mp(Js,"axisType","angleAxis");mp(Js,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var eee=bE,tee=eee(Object.getPrototypeOf,Object),ree=tee,nee=Zn,iee=ree,aee=Jn,oee="[object Object]",see=Function.prototype,lee=Object.prototype,b2=see.toString,uee=lee.hasOwnProperty,cee=b2.call(Object);function fee(e){if(!aee(e)||nee(e)!=oee)return!1;var t=iee(e);if(t===null)return!0;var r=uee.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&b2.call(r)==cee}var dee=fee;const hee=Se(dee);var pee=Zn,mee=Jn,vee="[object Boolean]";function yee(e){return e===!0||e===!1||mee(e)&&pee(e)==vee}var gee=yee;const xee=Se(gee);function Hu(e){"@babel/helpers - typeof";return Hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hu(e)}function Id(){return Id=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:h,x:l,y:u},to:{upperWidth:f,lowerWidth:d,height:h,x:l,y:u},duration:m,animationEasing:v,isActive:b},function(x){var S=x.upperWidth,w=x.lowerWidth,j=x.height,O=x.x,P=x.y;return _.createElement(xr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:m,easing:v},_.createElement("path",Id({},X(r,!0),{className:g,d:nO(O,P,S,w,j),ref:n})))}):_.createElement("g",null,_.createElement("path",Id({},X(r,!0),{className:g,d:nO(l,u,f,d,h)})))},Nee=["option","shapeType","propTransformer","activeClassName","isActive"];function Ku(e){"@babel/helpers - typeof";return Ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ku(e)}function Tee(e,t){if(e==null)return{};var r=$ee(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $ee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ld(e){for(var t=1;t0?mr(x,"paddingAngle",0):0;if(w){var O=ke(w.endAngle-w.startAngle,x.endAngle-x.startAngle),P=Ne(Ne({},x),{},{startAngle:g+j,endAngle:g+O(m)+j});y.push(P),g=P.endAngle}else{var A=x.endAngle,E=x.startAngle,N=ke(0,A-E),T=N(m),M=Ne(Ne({},x),{},{startAngle:g+j,endAngle:g+T+j});y.push(M),g=M.endAngle}}),_.createElement(se,null,n.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(a){if(!a.altKey)switch(a.key){case"ArrowLeft":{var o=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[o].focus(),i.setState({sectorToFocus:o});break}case"ArrowRight":{var s=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,a=n.isAnimationActive,o=this.state.prevSectors;return a&&i&&i.length&&(!o||!Gn(o,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,a=i.hide,o=i.sectors,s=i.className,l=i.label,u=i.cx,f=i.cy,d=i.innerRadius,h=i.outerRadius,p=i.isAnimationActive,v=this.state.isAnimationFinished;if(a||!o||!o.length||!H(u)||!H(f)||!H(d)||!H(h))return null;var m=oe("recharts-pie",s);return _.createElement(se,{tabIndex:this.props.rootTabIndex,className:m,ref:function(b){n.pieRef=b}},this.renderSectors(),l&&this.renderLabels(o),bt.renderCallByParent(this.props,null,!1),(!p||v)&&Mr.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?g:g-1)*l,S=y-g*p-x,w=i.reduce(function(P,A){var E=Ae(A,b,0);return P+(H(E)?E:0)},0),j;if(w>0){var O;j=i.map(function(P,A){var E=Ae(P,b,0),N=Ae(P,f,A),T=(H(E)?E:0)/w,M;A?M=O.endAngle+Bt(m)*l*(E!==0?1:0):M=o;var R=M+Bt(m)*((E!==0?p:0)+T*S),D=(M+R)/2,L=(v.innerRadius+v.outerRadius)/2,z=[{name:N,value:E,payload:P,dataKey:b,type:h}],C=ge(v.cx,v.cy,L,D);return O=Ne(Ne(Ne({percent:T,cornerRadius:a,name:N,tooltipPayload:z,midAngle:D,middleRadius:L,tooltipPosition:C},P),v),{},{value:Ae(P,b),startAngle:M,endAngle:R,payload:P,paddingAngle:Bt(m)*l}),O})}return Ne(Ne({},v),{},{sectors:j,data:i})});function Zee(e){return e&&e.length?e[0]:void 0}var Jee=Zee,ete=Jee;const tte=Se(ete);var rte=["key"];function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}function nte(e,t){if(e==null)return{};var r=ite(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ite(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zd(){return zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=2&&(l=!0),u.push(Lt(Lt({},ge(o,s,g,y)),{},{name:v,value:m,cx:o,cy:s,radius:g,angle:y,payload:h}))});var d=[];return l&&u.forEach(function(h){if(Array.isArray(h.value)){var p=tte(h.value),v=re(p)?void 0:t.scale(p);d.push(Lt(Lt({},h),{},{radius:v},ge(o,s,v,h.angle)))}else d.push(h)}),{points:u,isRange:l,baseLinePoints:d}});var dte=Math.ceil,hte=Math.max;function pte(e,t,r,n){for(var i=-1,a=hte(dte((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var mte=pte,vte=LE,uO=1/0,yte=17976931348623157e292;function gte(e){if(!e)return e===0?e:0;if(e=vte(e),e===uO||e===-uO){var t=e<0?-1:1;return t*yte}return e===e?e:0}var O2=gte,xte=mte,bte=np,Cm=O2;function wte(e){return function(t,r,n){return n&&typeof n!="number"&&bte(t,r,n)&&(r=n=void 0),t=Cm(t),r===void 0?(r=t,t=0):r=Cm(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),ur(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),ur(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),ur(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),ur(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),ur(n,"handleSlideDragStart",function(i){var a=pO(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Rte(t,e),Tte(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,d=Math.min(i,a),h=Math.max(i,a),p=t.getIndexInRange(o,d),v=t.getIndexInRange(o,h);return{startIndex:p-p%l,endIndex:v===f?f:v-v%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=Ae(a[n],s,n);return te(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,f=l.width,d=l.travellerWidth,h=l.startIndex,p=l.endIndex,v=l.onChange,m=n.pageX-a;m>0?m=Math.min(m,u+f-d-s,u+f-d-o):m<0&&(m=Math.max(m,u-o,u-s));var y=this.getIndex({startX:o+m,endX:s+m});(y.startIndex!==h||y.endIndex!==p)&&v&&v(y),this.setState({startX:o+m,endX:s+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=pO(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],f=this.props,d=f.x,h=f.width,p=f.travellerWidth,v=f.onChange,m=f.gap,y=f.data,b={startX:this.state.startX,endX:this.state.endX},g=n.pageX-a;g>0?g=Math.min(g,d+h-p-u):g<0&&(g=Math.max(g,d-u)),b[o]=u+g;var x=this.getIndex(b),S=x.startIndex,w=x.endIndex,j=function(){var P=y.length-1;return o==="startX"&&(s>l?S%m===0:w%m===0)||sl?w%m===0:S%m===0)||s>l&&w===P};this.setState(ur(ur({},o,u+g),"brushMoveStartX",n.pageX),function(){v&&j()&&v(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],d=s.indexOf(f);if(d!==-1){var h=d+n;if(!(h===-1||h>=s.length)){var p=s[h];i==="startX"&&p>=u||i==="endX"&&p<=l||this.setState(ur({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return _.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,d=k.Children.only(u);return d?_.cloneElement(d,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,d=l.height,h=l.traveller,p=l.ariaLabel,v=l.data,m=l.startIndex,y=l.endIndex,b=Math.max(n,this.props.x),g=Mm(Mm({},X(this.props,!1)),{},{x:b,y:u,width:f,height:d}),x=p||"Min value: ".concat((a=v[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[y])===null||o===void 0?void 0:o.name);return _.createElement(se,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,g))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,d=Math.max(Math.abs(i-n)-u,0);return _.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:d,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,h=f.endX,p=5,v={pointerEvents:"none",fill:u};return _.createElement(se,{className:"recharts-brush-texts"},_.createElement(Wa,Wd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,h)-p,y:o+s/2},v),this.getTextOfTick(i)),_.createElement(Wa,Wd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,h)+l+p,y:o+s/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,d=n.alwaysShowText,h=this.state,p=h.startX,v=h.endX,m=h.isTextActive,y=h.isSlideMoving,b=h.isTravellerMoving,g=h.isTravellerFocused;if(!i||!i.length||!H(s)||!H(l)||!H(u)||!H(f)||u<=0||f<=0)return null;var x=oe("recharts-brush",a),S=_.Children.count(o)===1,w=Ete("userSelect","none");return _.createElement(se,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,v),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(v,"endX"),(m||y||b||g||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return _.createElement(_.Fragment,null,_.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),_.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),_.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return _.isValidElement(n)?a=_.cloneElement(n,i):te(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Mm({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?Ite({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(k.PureComponent);ur(ys,"displayName","Brush");ur(ys,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Lte=pb;function Fte(e,t){var r;return Lte(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var Bte=Fte,zte=fE,Ute=jn,qte=Bte,Wte=sr,Hte=np;function Kte(e,t,r){var n=Wte(e)?zte:qte;return r&&Hte(e,t,r)&&(t=void 0),n(e,Ute(t))}var Vte=Kte;const Gte=Se(Vte);var gn=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},mO=CE;function Qte(e,t,r){t=="__proto__"&&mO?mO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Yte=Qte,Xte=Yte,Zte=TE,Jte=jn;function ere(e,t){var r={};return t=Jte(t),Zte(e,function(n,i,a){Xte(r,i,t(n,i,a))}),r}var tre=ere;const rre=Se(tre);function nre(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wre(e,t){var r=e.x,n=e.y,i=xre(e,mre),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),d="".concat(t.width||i.width),h=parseInt(d,10);return wl(wl(wl(wl(wl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function yO(e){return _.createElement(Fd,mg({shapeType:"rectangle",propTransformer:wre,activeClassName:"recharts-active-bar"},e))}var Sre=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=H(n)||wF(n);return a?t(n,i):(a||Ka(),r)}},jre=["value","background"],E2;function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function Ore(e,t){if(e==null)return{};var r=Pre(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(D)0&&Math.abs(R)0&&(M=Math.min((ce||0)-(R[V-1]||0),M))}),Number.isFinite(M)){var D=M/T,L=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(O=D*L/2),m.padding==="no-gap"){var z=zt(t.barCategoryGap,D*L),C=D*L/2;O=C-z-(C-z)/L*z}}}i==="xAxis"?P=[n.left+(x.left||0)+(O||0),n.left+n.width-(x.right||0)-(O||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(O||0),n.top+n.height-(x.bottom||0)-(O||0)]:P=m.range,w&&(P=[P[1],P[0]]);var B=WN(m,a,h),U=B.scale,G=B.realScaleType;U.domain(b).range(P),HN(U);var q=KN(U,Gr(Gr({},m),{},{realScaleType:G}));i==="xAxis"?(N=y==="top"&&!S||y==="bottom"&&S,A=n.left,E=d[j]-N*m.height):i==="yAxis"&&(N=y==="left"&&!S||y==="right"&&S,A=d[j]-N*m.width,E=n.top);var ee=Gr(Gr(Gr({},m),q),{},{realScaleType:G,x:A,y:E,scale:U,width:i==="xAxis"?n.width:m.width,height:i==="yAxis"?n.height:m.height});return ee.bandSize=kd(ee,q),!m.hide&&i==="xAxis"?d[j]+=(N?-1:1)*ee.height:m.hide||(d[j]+=(N?-1:1)*ee.width),Gr(Gr({},p),{},gp({},v,ee))},{})},C2=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},Dre=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return C2({x:r,y:n},{x:i,y:a})},M2=function(){function e(t){Cre(this,e),this.scale=t}return Mre(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();gp(M2,"EPS",1e-4);var qb=function(t){var r=Object.keys(t).reduce(function(n,i){return Gr(Gr({},n),{},gp({},i,M2.create(t[i])))},{});return Gr(Gr({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return rre(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return A2(i,function(a,o){return r[o].isInRange(a)})}})};function Ire(e){return(e%180+180)%180}var Lre=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Ire(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?i[a?t[o]:o]:void 0}}var qre=Ure,Wre=O2;function Hre(e){var t=Wre(e),r=t%1;return t===t?r?t-r:t:0}var Kre=Hre,Vre=PE,Gre=jn,Qre=Kre,Yre=Math.max;function Xre(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:Qre(r);return i<0&&(i=Yre(n+i,0)),Vre(e,Gre(t),i)}var Zre=Xre,Jre=qre,ene=Zre,tne=Jre(ene),rne=tne;const nne=Se(rne);var ine=k4(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Wb=k.createContext(void 0),Hb=k.createContext(void 0),R2=k.createContext(void 0),D2=k.createContext({}),I2=k.createContext(void 0),L2=k.createContext(0),F2=k.createContext(0),SO=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,f=ine(a);return _.createElement(Wb.Provider,{value:n},_.createElement(Hb.Provider,{value:i},_.createElement(D2.Provider,{value:a},_.createElement(R2.Provider,{value:f},_.createElement(I2.Provider,{value:o},_.createElement(L2.Provider,{value:u},_.createElement(F2.Provider,{value:l},s)))))))},ane=function(){return k.useContext(I2)},B2=function(t){var r=k.useContext(Wb);r==null&&Ka();var n=r[t];return n==null&&Ka(),n},one=function(){var t=k.useContext(Wb);return di(t)},sne=function(){var t=k.useContext(Hb),r=nne(t,function(n){return A2(n.domain,Number.isFinite)});return r||di(t)},z2=function(t){var r=k.useContext(Hb);r==null&&Ka();var n=r[t];return n==null&&Ka(),n},lne=function(){var t=k.useContext(R2);return t},une=function(){return k.useContext(D2)},Kb=function(){return k.useContext(F2)},Vb=function(){return k.useContext(L2)};function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function cne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fne(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function Kne(e,t){return G2(e,t+1)}function Vne(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,d=function(){var v=n==null?void 0:n[l];if(v===void 0)return{v:G2(n,u)};var m=l,y,b=function(){return y===void 0&&(y=r(v,m)),y},g=v.coordinate,x=l===0||Xd(e,g,b,f,s);x||(l=0,f=o,u+=1),x&&(f=g+e*(b()/2+i),l+=u)},h;u<=a.length;)if(h=d(),h)return h.v;return[]}function Xu(e){"@babel/helpers - typeof";return Xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xu(e)}function NO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t0?p.coordinate-y*e:p.coordinate})}else a[h]=p=Tt(Tt({},p),{},{tickCoord:p.coordinate});var b=Xd(e,p.tickCoord,m,s,l);b&&(l=p.tickCoord-e*(m()/2+i),a[h]=Tt(Tt({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function Zne(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],d=r(f,s-1),h=e*(f.coordinate+e*d/2-u);o[s-1]=f=Tt(Tt({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=Xd(e,f.tickCoord,function(){return d},l,u);p&&(u=f.tickCoord-e*(d/2+i),o[s-1]=Tt(Tt({},f),{},{isShow:!0}))}for(var v=a?s-1:s,m=function(g){var x=o[g],S,w=function(){return S===void 0&&(S=r(x,g)),S};if(g===0){var j=e*(x.coordinate-e*w()/2-l);o[g]=x=Tt(Tt({},x),{},{tickCoord:j<0?x.coordinate-j*e:x.coordinate})}else o[g]=x=Tt(Tt({},x),{},{tickCoord:x.coordinate});var O=Xd(e,x.tickCoord,w,l,u);O&&(l=x.tickCoord+e*(w()/2+i),o[g]=Tt(Tt({},x),{},{isShow:!0}))},y=0;y=2?Bt(i[1].coordinate-i[0].coordinate):1,b=Hne(a,y,p);return l==="equidistantPreserveStart"?Vne(y,b,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=Zne(y,b,m,i,o,l==="preserveStartEnd"):h=Xne(y,b,m,i,o),h.filter(function(g){return g.isShow}))}var Jne=["viewBox"],eie=["viewBox"],tie=["ticks"];function Ss(e){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(e)}function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function rie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function nie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $O(e,t){for(var r=0;r0?l(this.props):l(p)),o<=0||s<=0||!v||!v.length?null:_.createElement(se,{className:oe("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),bt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=oe(i.className,"recharts-cartesian-axis-tick-value");return _.isValidElement(n)?o=_.cloneElement(n,ut(ut({},i),{},{className:s})):te(n)?o=n(ut(ut({},i),{},{className:s})):o=_.createElement(Wa,Oo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(k.Component);Xb(el,"displayName","CartesianAxis");Xb(el,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var cie=["x1","y1","x2","y2","key"],fie=["offset"];function Va(e){"@babel/helpers - typeof";return Va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Va(e)}function CO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var vie=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,l=t.ry;return _.createElement("rect",{x:i,y:a,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function X2(e,t){var r;if(_.isValidElement(e))r=_.cloneElement(e,t);else if(te(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,l=MO(t,cie),u=X(l,!1);u.offset;var f=MO(u,fie);r=_.createElement("line",ba({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function yie(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var u=Ct(Ct({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return X2(i,u)});return _.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function gie(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var u=Ct(Ct({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return X2(i,u)});return _.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function xie(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var f=s.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var v=!f[p+1],m=v?i+o-h:f[p+1]-h;if(m<=0)return null;var y=p%t.length;return _.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:m,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return _.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function bie(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var v=!f[p+1],m=v?a+s-h:f[p+1]-h;if(m<=0)return null;var y=p%n.length;return _.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:l,stroke:"none",fill:n[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return _.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var wie=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return qN(Yb(Ct(Ct(Ct({},el.defaultProps),n),{},{ticks:In(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},Sie=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return qN(Yb(Ct(Ct(Ct({},el.defaultProps),n),{},{ticks:In(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},ao={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ht(e){var t,r,n,i,a,o,s=Kb(),l=Vb(),u=une(),f=Ct(Ct({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:ao.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:ao.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:ao.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:ao.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:ao.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:ao.verticalFill,x:H(e.x)?e.x:u.left,y:H(e.y)?e.y:u.top,width:H(e.width)?e.width:u.width,height:H(e.height)?e.height:u.height}),d=f.x,h=f.y,p=f.width,v=f.height,m=f.syncWithTicks,y=f.horizontalValues,b=f.verticalValues,g=one(),x=sne();if(!H(p)||p<=0||!H(v)||v<=0||!H(d)||d!==+d||!H(h)||h!==+h)return null;var S=f.verticalCoordinatesGenerator||wie,w=f.horizontalCoordinatesGenerator||Sie,j=f.horizontalPoints,O=f.verticalPoints;if((!j||!j.length)&&te(w)){var P=y&&y.length,A=w({yAxis:x?Ct(Ct({},x),{},{ticks:P?y:x.ticks}):void 0,width:s,height:l,offset:u},P?!0:m);en(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Va(A),"]")),Array.isArray(A)&&(j=A)}if((!O||!O.length)&&te(S)){var E=b&&b.length,N=S({xAxis:g?Ct(Ct({},g),{},{ticks:E?b:g.ticks}):void 0,width:s,height:l,offset:u},E?!0:m);en(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Va(N),"]")),Array.isArray(N)&&(O=N)}return _.createElement("g",{className:"recharts-cartesian-grid"},_.createElement(vie,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),_.createElement(yie,ba({},f,{offset:u,horizontalPoints:j,xAxis:g,yAxis:x})),_.createElement(gie,ba({},f,{offset:u,verticalPoints:O,xAxis:g,yAxis:x})),_.createElement(xie,ba({},f,{horizontalPoints:j})),_.createElement(bie,ba({},f,{verticalPoints:O})))}Ht.displayName="CartesianGrid";var jie=["type","layout","connectNulls","ref"],Oie=["key"];function js(e){"@babel/helpers - typeof";return js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},js(e)}function RO(e,t){if(e==null)return{};var r=Pie(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rd){p=[].concat(oo(l.slice(0,v)),[d-m]);break}var y=p.length%2===0?[0,h]:[h];return[].concat(oo(t.repeat(l,f)),oo(p),y).map(function(b){return"".concat(b,"px")}).join(", ")}),Qr(r,"id",Qi("recharts-line-")),Qr(r,"pathRef",function(o){r.mainCurve=o}),Qr(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Qr(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Rie(t,e),Tie(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,f=a.children,d=Wt(f,Ys);if(!d)return null;var h=function(m,y){return{x:m.x,y:m.y,value:m.value,errorVal:Ae(m.payload,y)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return _.createElement(se,p,d.map(function(v){return _.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,d=X(this.props,!1),h=X(l,!0),p=u.map(function(m,y){var b=lr(lr(lr({key:"dot-".concat(y),r:3},d),h),{},{index:y,cx:m.x,cy:m.y,value:m.value,dataKey:f,payload:m.payload,points:u});return t.renderDotItem(l,b)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return _.createElement(se,Kl({className:"recharts-line-dots",key:"dots"},v),p)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,f=s.connectNulls;s.ref;var d=RO(s,jie),h=lr(lr(lr({},X(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:f});return _.createElement(Li,Kl({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,h=o.animationEasing,p=o.animationId,v=o.animateNewValues,m=o.width,y=o.height,b=this.state,g=b.prevPoints,x=b.totalLength;return _.createElement(xr,{begin:f,duration:d,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(g){var j=g.length/s.length,O=s.map(function(T,M){var R=Math.floor(M*j);if(g[R]){var D=g[R],L=ke(D.x,T.x),z=ke(D.y,T.y);return lr(lr({},T),{},{x:L(w),y:z(w)})}if(v){var C=ke(m*2,T.x),B=ke(y/2,T.y);return lr(lr({},T),{},{x:C(w),y:B(w)})}return lr(lr({},T),{},{x:T.x,y:T.y})});return a.renderCurveStatically(O,n,i)}var P=ke(0,x),A=P(w),E;if(l){var N="".concat(l).split(/[,\s]+/gim).map(function(T){return parseFloat(T)});E=a.getStrokeDasharray(A,x,N)}else E=a.generateSimpleStrokeDasharray(x,A);return a.renderCurveStatically(s,n,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,f=l.totalLength;return s&&o&&o.length&&(!u&&f>0||!Gn(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.xAxis,f=i.yAxis,d=i.top,h=i.left,p=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,g=s.length===1,x=oe("recharts-line",l),S=u&&u.allowDataOverflow,w=f&&f.allowDataOverflow,j=S||w,O=re(y)?this.id:y,P=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=P.r,E=A===void 0?3:A,N=P.strokeWidth,T=N===void 0?2:N,M=DA(o)?o:{},R=M.clipDot,D=R===void 0?!0:R,L=E*2+T;return _.createElement(se,{className:x},S||w?_.createElement("defs",null,_.createElement("clipPath",{id:"clipPath-".concat(O)},_.createElement("rect",{x:S?h:h-p/2,y:w?d:d-v/2,width:S?p:p*2,height:w?v:v*2})),!D&&_.createElement("clipPath",{id:"clipPath-dots-".concat(O)},_.createElement("rect",{x:h-L/2,y:d-L/2,width:p+L,height:v+L}))):null,!g&&this.renderCurve(j,O),this.renderErrorBar(j,O),(g||o)&&this.renderDots(j,D,O),(!m||b)&&Mr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(oo(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Fie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Gn(f,o)||!Gn(d,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,f=i.left,d=i.xAxis,h=i.yAxis,p=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,g=s.length===1,x=oe("recharts-area",l),S=d&&d.allowDataOverflow,w=h&&h.allowDataOverflow,j=S||w,O=re(y)?this.id:y,P=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=P.r,E=A===void 0?3:A,N=P.strokeWidth,T=N===void 0?2:N,M=DA(o)?o:{},R=M.clipDot,D=R===void 0?!0:R,L=E*2+T;return _.createElement(se,{className:x},S||w?_.createElement("defs",null,_.createElement("clipPath",{id:"clipPath-".concat(O)},_.createElement("rect",{x:S?f:f-p/2,y:w?u:u-v/2,width:S?p:p*2,height:w?v:v*2})),!D&&_.createElement("clipPath",{id:"clipPath-dots-".concat(O)},_.createElement("rect",{x:f-L/2,y:u-L/2,width:p+L,height:v+L}))):null,g?null:this.renderArea(j,O),(o||g)&&this.renderDots(j,D,O),(!m||b)&&Mr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(k.PureComponent);eT=wn;pn(wn,"displayName","Area");pn(wn,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!On.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});pn(wn,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(H(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return s==="dataMin"?d:s==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});pn(wn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=t.layout,v=u&&u.length,m=eT.getBaseValue(t,r,n,i),y=p==="horizontal",b=!1,g=d.map(function(S,w){var j;v?j=u[f+w]:(j=Ae(S,l),Array.isArray(j)?b=!0:j=[m,j]);var O=j[1]==null||v&&Ae(S,l)==null;return y?{x:cs({axis:n,ticks:a,bandSize:s,entry:S,index:w}),y:O?null:i.scale(j[1]),value:j,payload:S}:{x:O?null:n.scale(j[1]),y:cs({axis:i,ticks:o,bandSize:s,entry:S,index:w}),value:j,payload:S}}),x;return v||b?x=g.map(function(S){var w=Array.isArray(S.value)?S.value[0]:null;return y?{x:S.x,y:w!=null&&S.y!=null?i.scale(w):null}:{x:w!=null?n.scale(w):null,y:S.y}}):x=y?i.scale(m):n.scale(m),oi({points:g,baseLine:x,layout:p,isRange:b},h)});pn(wn,"renderDotItem",function(e,t){var r;if(_.isValidElement(e))r=_.cloneElement(e,t);else if(te(e))r=e(t);else{var n=oe("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=tT(t,Lie);r=_.createElement(Xs,wa({},a,{key:i,className:n}))}return r});function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function Vie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Gie(e,t){for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iae(e){var t=e.option,r=e.isActive,n=rae(e,tae);return typeof t=="string"?k.createElement(Fd,Vl({option:k.createElement(ep,Vl({type:t},n)),isActive:r,shapeType:"symbols"},n)):k.createElement(Fd,Vl({option:t,isActive:r,shapeType:"symbols"},n))}function _s(e){"@babel/helpers - typeof";return _s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(e)}function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Jae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function eoe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function toe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&H(i)&&H(a)?t.slice(i,a+1):[]};function ST(e){return e==="number"?[0,"auto"]:void 0}var Ig=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Pp(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=d===void 0?s:d;h=Zf(p,o.dataKey,i)}else h=d&&d[n]||s[n];return h?[].concat(Ns(l),[GN(u,h)]):l},[])},VO=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=hoe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=MQ(o,s,u,l);if(f>=0&&u){var d=u[f]&&u[f].value,h=Ig(t,r,f,d),p=poe(n,s,f,a);return{activeTooltipIndex:f,activeLabel:d,activePayload:h,activeCoordinate:p}}return null},moe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=t.stackOffset,p=UN(f,a);return n.reduce(function(v,m){var y,b=m.type.defaultProps!==void 0?F(F({},m.type.defaultProps),m.props):m.props,g=b.type,x=b.dataKey,S=b.allowDataOverflow,w=b.allowDuplicatedCategory,j=b.scale,O=b.ticks,P=b.includeHidden,A=b[o];if(v[A])return v;var E=Pp(t.data,{graphicalItems:i.filter(function(q){var ee,ce=o in q.props?q.props[o]:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee[o];return ce===A}),dataStartIndex:l,dataEndIndex:u}),N=E.length,T,M,R;zae(b.domain,S,g)&&(T=Vy(b.domain,null,S),p&&(g==="number"||j!=="auto")&&(R=Ul(E,x,"category")));var D=ST(g);if(!T||T.length===0){var L,z=(L=b.domain)!==null&&L!==void 0?L:D;if(x){if(T=Ul(E,x,g),g==="category"&&p){var C=jF(T);w&&C?(M=T,T=qd(0,N)):w||(T=fj(z,T,m).reduce(function(q,ee){return q.indexOf(ee)>=0?q:[].concat(Ns(q),[ee])},[]))}else if(g==="category")w?T=T.filter(function(q){return q!==""&&!re(q)}):T=fj(z,T,m).reduce(function(q,ee){return q.indexOf(ee)>=0||ee===""||re(ee)?q:[].concat(Ns(q),[ee])},[]);else if(g==="number"){var B=FQ(E,i.filter(function(q){var ee,ce,V=o in q.props?q.props[o]:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee[o],ie="hide"in q.props?q.props.hide:(ce=q.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return V===A&&(P||!ie)}),x,a,f);B&&(T=B)}p&&(g==="number"||j!=="auto")&&(R=Ul(E,x,"category"))}else p?T=qd(0,N):s&&s[A]&&s[A].hasStack&&g==="number"?T=h==="expand"?[0,1]:VN(s[A].stackGroups,l,u):T=zN(E,i.filter(function(q){var ee=o in q.props?q.props[o]:q.type.defaultProps[o],ce="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return ee===A&&(P||!ce)}),g,f,!0);if(g==="number")T=Mg(d,T,A,a,O),z&&(T=Vy(z,T,S));else if(g==="category"&&z){var U=z,G=T.every(function(q){return U.indexOf(q)>=0});G&&(T=U)}}return F(F({},v),{},ae({},A,F(F({},b),{},{axisType:a,domain:T,categoricalDomain:R,duplicateDomain:M,originalDomain:(y=b.domain)!==null&&y!==void 0?y:D,isCategorical:p,layout:f})))},{})},voe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=Pp(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),p=h.length,v=UN(f,a),m=-1;return n.reduce(function(y,b){var g=b.type.defaultProps!==void 0?F(F({},b.type.defaultProps),b.props):b.props,x=g[o],S=ST("number");if(!y[x]){m++;var w;return v?w=qd(0,p):s&&s[x]&&s[x].hasStack?(w=VN(s[x].stackGroups,l,u),w=Mg(d,w,x,a)):(w=Vy(S,zN(h,n.filter(function(j){var O,P,A=o in j.props?j.props[o]:(O=j.type.defaultProps)===null||O===void 0?void 0:O[o],E="hide"in j.props?j.props.hide:(P=j.type.defaultProps)===null||P===void 0?void 0:P.hide;return A===x&&!E}),"number",f),i.defaultProps.allowDataOverflow),w=Mg(d,w,x,a)),F(F({},y),{},ae({},x,F(F({axisType:a},i.defaultProps),{},{hide:!0,orientation:mr(foe,"".concat(a,".").concat(m%2),null),domain:w,originalDomain:S,isCategorical:v,layout:f})))}return y},{})},yoe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(i,"Id"),h=Wt(f,a),p={};return h&&h.length?p=moe(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(p=voe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),p},goe=function(t){var r=di(t),n=In(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:mb(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:kd(r,n)}},GO=function(t){var r=t.children,n=t.defaultShowTooltip,i=fr(r,ys),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},xoe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Fn(r&&r.type);return n&&n.indexOf("Bar")>=0})},QO=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},boe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,d=n.children,h=n.margin||{},p=fr(d,ys),v=fr(d,ar),m=Object.keys(l).reduce(function(w,j){var O=l[j],P=O.orientation;return!O.mirror&&!O.hide?F(F({},w),{},ae({},P,w[P]+O.width)):w},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(w,j){var O=o[j],P=O.orientation;return!O.mirror&&!O.hide?F(F({},w),{},ae({},P,mr(w,"".concat(P))+O.height)):w},{top:h.top||0,bottom:h.bottom||0}),b=F(F({},y),m),g=b.bottom;p&&(b.bottom+=p.props.height||ys.defaultProps.height),v&&r&&(b=IQ(b,i,n,r));var x=u-b.left-b.right,S=f-b.top-b.bottom;return F(F({brushBottom:g},b),{},{width:Math.max(x,0),height:Math.max(S,0)})},woe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},rl=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,h=function(b,g){var x=g.graphicalItems,S=g.stackGroups,w=g.offset,j=g.updateId,O=g.dataStartIndex,P=g.dataEndIndex,A=b.barSize,E=b.layout,N=b.barGap,T=b.barCategoryGap,M=b.maxBarSize,R=QO(E),D=R.numericAxisName,L=R.cateAxisName,z=xoe(x),C=[];return x.forEach(function(B,U){var G=Pp(b.data,{graphicalItems:[B],dataStartIndex:O,dataEndIndex:P}),q=B.type.defaultProps!==void 0?F(F({},B.type.defaultProps),B.props):B.props,ee=q.dataKey,ce=q.maxBarSize,V=q["".concat(D,"Id")],ie=q["".concat(L,"Id")],Le={},ot=l.reduce(function(ea,ta){var Ep=g["".concat(ta.axisType,"Map")],Zb=q["".concat(ta.axisType,"Id")];Ep&&Ep[Zb]||ta.axisType==="zAxis"||Ka();var Jb=Ep[Zb];return F(F({},ea),{},ae(ae({},ta.axisType,Jb),"".concat(ta.axisType,"Ticks"),In(Jb)))},Le),Q=ot[L],le=ot["".concat(L,"Ticks")],fe=S&&S[V]&&S[V].hasStack&&GQ(B,S[V].stackGroups),W=Fn(B.type).indexOf("Bar")>=0,We=kd(Q,le),me=[],st=z&&RQ({barSize:A,stackGroups:S,totalSize:woe(ot,L)});if(W){var lt,Gt,ti=re(ce)?M:ce,to=(lt=(Gt=kd(Q,le,!0))!==null&&Gt!==void 0?Gt:ti)!==null&<!==void 0?lt:0;me=DQ({barGap:N,barCategoryGap:T,bandSize:to!==We?to:We,sizeList:st[ie],maxBarSize:ti}),to!==We&&(me=me.map(function(ea){return F(F({},ea),{},{position:F(F({},ea.position),{},{offset:ea.position.offset-to/2})})}))}var Oc=B&&B.type&&B.type.getComposedData;Oc&&C.push({props:F(F({},Oc(F(F({},ot),{},{displayedData:G,props:b,dataKey:ee,item:B,bandSize:We,barPosition:me,offset:w,stackedData:fe,layout:E,dataStartIndex:O,dataEndIndex:P}))),{},ae(ae(ae({key:B.key||"item-".concat(U)},D,ot[D]),L,ot[L]),"animationId",j)),childIndex:DF(B,b.children),item:B})}),C},p=function(b,g){var x=b.props,S=b.dataStartIndex,w=b.dataEndIndex,j=b.updateId;if(!a1({props:x}))return null;var O=x.children,P=x.layout,A=x.stackOffset,E=x.data,N=x.reverseStackOrder,T=QO(P),M=T.numericAxisName,R=T.cateAxisName,D=Wt(O,n),L=KQ(E,D,"".concat(M,"Id"),"".concat(R,"Id"),A,N),z=l.reduce(function(q,ee){var ce="".concat(ee.axisType,"Map");return F(F({},q),{},ae({},ce,yoe(x,F(F({},ee),{},{graphicalItems:D,stackGroups:ee.axisType===M&&L,dataStartIndex:S,dataEndIndex:w}))))},{}),C=boe(F(F({},z),{},{props:x,graphicalItems:D}),g==null?void 0:g.legendBBox);Object.keys(z).forEach(function(q){z[q]=f(x,z[q],C,q.replace("Map",""),r)});var B=z["".concat(R,"Map")],U=goe(B),G=h(x,F(F({},z),{},{dataStartIndex:S,dataEndIndex:w,updateId:j,graphicalItems:D,stackGroups:L,offset:C}));return F(F({formattedGraphicalItems:G,graphicalItems:D,offset:C,stackGroups:L},U),z)},v=function(y){function b(g){var x,S,w;return eoe(this,b),w=noe(this,b,[g]),ae(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ae(w,"accessibilityManager",new Bae),ae(w,"handleLegendBBoxUpdate",function(j){if(j){var O=w.state,P=O.dataStartIndex,A=O.dataEndIndex,E=O.updateId;w.setState(F({legendBBox:j},p({props:w.props,dataStartIndex:P,dataEndIndex:A,updateId:E},F(F({},w.state),{},{legendBBox:j}))))}}),ae(w,"handleReceiveSyncEvent",function(j,O,P){if(w.props.syncId===j){if(P===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),ae(w,"handleBrushChange",function(j){var O=j.startIndex,P=j.endIndex;if(O!==w.state.dataStartIndex||P!==w.state.dataEndIndex){var A=w.state.updateId;w.setState(function(){return F({dataStartIndex:O,dataEndIndex:P},p({props:w.props,dataStartIndex:O,dataEndIndex:P,updateId:A},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:P})}}),ae(w,"handleMouseEnter",function(j){var O=w.getMouseInfo(j);if(O){var P=F(F({},O),{},{isTooltipActive:!0});w.setState(P),w.triggerSyncEvent(P);var A=w.props.onMouseEnter;te(A)&&A(P,j)}}),ae(w,"triggeredAfterMouseMove",function(j){var O=w.getMouseInfo(j),P=O?F(F({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(P),w.triggerSyncEvent(P);var A=w.props.onMouseMove;te(A)&&A(P,j)}),ae(w,"handleItemMouseEnter",function(j){w.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),ae(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),ae(w,"handleMouseMove",function(j){j.persist(),w.throttleTriggeredAfterMouseMove(j)}),ae(w,"handleMouseLeave",function(j){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var P=w.props.onMouseLeave;te(P)&&P(O,j)}),ae(w,"handleOuterEvent",function(j){var O=RF(j),P=mr(w.props,"".concat(O));if(O&&te(P)){var A,E;/.*touch.*/i.test(O)?E=w.getMouseInfo(j.changedTouches[0]):E=w.getMouseInfo(j),P((A=E)!==null&&A!==void 0?A:{},j)}}),ae(w,"handleClick",function(j){var O=w.getMouseInfo(j);if(O){var P=F(F({},O),{},{isTooltipActive:!0});w.setState(P),w.triggerSyncEvent(P);var A=w.props.onClick;te(A)&&A(P,j)}}),ae(w,"handleMouseDown",function(j){var O=w.props.onMouseDown;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleMouseUp",function(j){var O=w.props.onMouseUp;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),ae(w,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseDown(j.changedTouches[0])}),ae(w,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseUp(j.changedTouches[0])}),ae(w,"handleDoubleClick",function(j){var O=w.props.onDoubleClick;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleContextMenu",function(j){var O=w.props.onContextMenu;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"triggerSyncEvent",function(j){w.props.syncId!==void 0&&Dm.emit(Im,w.props.syncId,j,w.eventEmitterSymbol)}),ae(w,"applySyncEvent",function(j){var O=w.props,P=O.layout,A=O.syncMethod,E=w.state.updateId,N=j.dataStartIndex,T=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)w.setState(F({dataStartIndex:N,dataEndIndex:T},p({props:w.props,dataStartIndex:N,dataEndIndex:T,updateId:E},w.state)));else if(j.activeTooltipIndex!==void 0){var M=j.chartX,R=j.chartY,D=j.activeTooltipIndex,L=w.state,z=L.offset,C=L.tooltipTicks;if(!z)return;if(typeof A=="function")D=A(C,j);else if(A==="value"){D=-1;for(var B=0;B=0){var fe,W;if(M.dataKey&&!M.allowDuplicatedCategory){var We=typeof M.dataKey=="function"?le:"payload.".concat(M.dataKey.toString());fe=Zf(B,We,D),W=U&&G&&Zf(G,We,D)}else fe=B==null?void 0:B[R],W=U&&G&&G[R];if(ie||V){var me=j.props.activeIndex!==void 0?j.props.activeIndex:R;return[k.cloneElement(j,F(F(F({},A.props),ot),{},{activeIndex:me})),null,null]}if(!re(fe))return[Q].concat(Ns(w.renderActivePoints({item:A,activePoint:fe,basePoint:W,childIndex:R,isRange:U})))}else{var st,lt=(st=w.getItemByXY(w.state.activeCoordinate))!==null&&st!==void 0?st:{graphicalItem:Q},Gt=lt.graphicalItem,ti=Gt.item,to=ti===void 0?j:ti,Oc=Gt.childIndex,ea=F(F(F({},A.props),ot),{},{activeIndex:Oc});return[k.cloneElement(to,ea),null,null]}return U?[Q,null,null]:[Q,null]}),ae(w,"renderCustomized",function(j,O,P){return k.cloneElement(j,F(F({key:"recharts-customized-".concat(P)},w.props),w.state))}),ae(w,"renderMap",{CartesianGrid:{handler:of,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:of},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:of},YAxis:{handler:of},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=g.id)!==null&&x!==void 0?x:Qi("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=FE(w.triggeredAfterMouseMove,(S=g.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return ooe(b,y),roe(b,[{key:"componentDidMount",value:function(){var x,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,S=x.children,w=x.data,j=x.height,O=x.layout,P=fr(S,$e);if(P){var A=P.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var E=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,N=Ig(this.state,w,A,E),T=this.state.tooltipTicks[A].coordinate,M=(this.state.offset.top+j)/2,R=O==="horizontal",D=R?{x:T,y:M}:{y:T,x:M},L=this.state.formattedGraphicalItems.find(function(C){var B=C.item;return B.type.name==="Scatter"});L&&(D=F(F({},D),L.props.points[A].tooltipPosition),N=L.props.points[A].tooltipPayload);var z={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:E,activePayload:N,activeCoordinate:D};this.setState(z),this.renderCursor(P),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,j;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(x){ly([fr(x.children,$e)],[fr(this.props.children,$e)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=fr(this.props.children,$e);if(x&&typeof x.props.shared=="boolean"){var S=x.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),j=lK(w),O={chartX:Math.round(x.pageX-j.left),chartY:Math.round(x.pageY-j.top)},P=w.width/S.offsetWidth||1,A=this.inRange(O.chartX,O.chartY,P);if(!A)return null;var E=this.state,N=E.xAxisMap,T=E.yAxisMap,M=this.getTooltipEventType(),R=VO(this.state,this.props.data,this.props.layout,A);if(M!=="axis"&&N&&T){var D=di(N).scale,L=di(T).scale,z=D&&D.invert?D.invert(O.chartX):null,C=L&&L.invert?L.invert(O.chartY):null;return F(F({},O),{},{xValue:z,yValue:C},R)}return R?F(F({},O),R):null}},{key:"inRange",value:function(x,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,O=x/w,P=S/w;if(j==="horizontal"||j==="vertical"){var A=this.state.offset,E=O>=A.left&&O<=A.left+A.width&&P>=A.top&&P<=A.top+A.height;return E?{x:O,y:P}:null}var N=this.state,T=N.angleAxisMap,M=N.radiusAxisMap;if(T&&M){var R=di(T);return pj({x:O,y:P},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,S=this.getTooltipEventType(),w=fr(x,$e),j={};w&&S==="axis"&&(w.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Jf(this.props,this.handleOuterEvent);return F(F({},O),j)}},{key:"addListener",value:function(){Dm.on(Im,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dm.removeListener(Im,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,S,w){for(var j=this.state.formattedGraphicalItems,O=0,P=j.length;O{const u=e.reduce((f,d)=>(f[d.status]=(f[d.status]||0)+1,f),{});return Object.entries(u).map(([f,d])=>({name:f.charAt(0).toUpperCase()+f.slice(1),value:d,status:f,color:YO[f]||YO.default}))},[e]),i=u=>{u&&u.status&&(t?t(u.status):r(`/?status=${u.status}`))};if(n.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const a=n.reduce((u,f)=>u+f.value,0),o=n.length>1,s=u=>`${u.name}: ${u.value}`,l=({active:u,payload:f})=>{if(u&&f&&f.length){const d=f[0].payload,h=a>0?(d.value/a*100).toFixed(1):0;return c.jsxs("div",{className:"bg-dark-surface border border-dark-border rounded-lg p-3 shadow-lg",children:[c.jsx("p",{className:"text-white font-semibold",children:d.name}),c.jsxs("p",{className:"text-dark-text-muted text-sm",children:["Count: ",c.jsx("span",{className:"text-white font-medium",children:d.value})]}),c.jsxs("p",{className:"text-dark-text-muted text-sm",children:["Percentage: ",c.jsxs("span",{className:"text-white font-medium",children:[h,"%"]})]})]})}return null};return c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ql,{children:[c.jsx(yr,{data:n,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:o?2:0,dataKey:"value",onClick:i,style:{cursor:"pointer"},label:s,labelLine:!1,children:n.map((u,f)=>c.jsx(vr,{fill:u.color},`cell-${f}`))}),c.jsx($e,{content:c.jsx(l,{})}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"},iconType:"circle",formatter:(u,f)=>{const d=a>0?(f.payload.value/a*100).toFixed(1):0;return`${u} (${f.payload.value}, ${d}%)`}})]})})}function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function Ui(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function At(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function an(e){At(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||oh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Ooe(e,t){At(2,arguments);var r=an(e).getTime(),n=Ui(t);return new Date(r+n)}var Poe={};function kp(){return Poe}function _oe(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function PT(e){At(1,arguments);var t=an(e);return t.setHours(0,0,0,0),t}var _T=6e4,kT=36e5;function koe(e){return At(1,arguments),e instanceof Date||oh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Aoe(e){if(At(1,arguments),!koe(e)&&typeof e!="number")return!1;var t=an(e);return!isNaN(Number(t))}function Eoe(e,t){At(2,arguments);var r=Ui(t);return Ooe(e,-r)}var Noe=864e5;function Toe(e){At(1,arguments);var t=an(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=r-n;return Math.floor(i/Noe)+1}function sh(e){At(1,arguments);var t=1,r=an(e),n=r.getUTCDay(),i=(n=i.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function $oe(e){At(1,arguments);var t=AT(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=sh(r);return n}var Coe=6048e5;function Moe(e){At(1,arguments);var t=an(e),r=sh(t).getTime()-$oe(t).getTime();return Math.round(r/Coe)+1}function lh(e,t){var r,n,i,a,o,s,l,u;At(1,arguments);var f=kp(),d=Ui((r=(n=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:f.weekStartsOn)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=an(e),p=h.getUTCDay(),v=(p=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,p),v.setUTCHours(0,0,0,0);var m=lh(v,t),y=new Date(0);y.setUTCFullYear(d,0,p),y.setUTCHours(0,0,0,0);var b=lh(y,t);return f.getTime()>=m.getTime()?d+1:f.getTime()>=b.getTime()?d:d-1}function Roe(e,t){var r,n,i,a,o,s,l,u;At(1,arguments);var f=kp(),d=Ui((r=(n=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1),h=ET(e,t),p=new Date(0);p.setUTCFullYear(h,0,d),p.setUTCHours(0,0,0,0);var v=lh(p,t);return v}var Doe=6048e5;function Ioe(e,t){At(1,arguments);var r=an(e),n=lh(r,t).getTime()-Roe(r,t).getTime();return Math.round(n/Doe)+1}function je(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return je(r==="yy"?i%100:i,r.length)},M:function(t,r){var n=t.getUTCMonth();return r==="M"?String(n+1):je(n+1,2)},d:function(t,r){return je(t.getUTCDate(),r.length)},a:function(t,r){var n=t.getUTCHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,r){return je(t.getUTCHours()%12||12,r.length)},H:function(t,r){return je(t.getUTCHours(),r.length)},m:function(t,r){return je(t.getUTCMinutes(),r.length)},s:function(t,r){return je(t.getUTCSeconds(),r.length)},S:function(t,r){var n=r.length,i=t.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return je(a,r.length)}},so={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Loe={G:function(t,r,n){var i=t.getUTCFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,r,n){if(r==="yo"){var i=t.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return ii.y(t,r)},Y:function(t,r,n,i){var a=ET(t,i),o=a>0?a:1-a;if(r==="YY"){var s=o%100;return je(s,2)}return r==="Yo"?n.ordinalNumber(o,{unit:"year"}):je(o,r.length)},R:function(t,r){var n=AT(t);return je(n,r.length)},u:function(t,r){var n=t.getUTCFullYear();return je(n,r.length)},Q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"Q":return String(i);case"QQ":return je(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"q":return String(i);case"qq":return je(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,r,n){var i=t.getUTCMonth();switch(r){case"M":case"MM":return ii.M(t,r);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,r,n){var i=t.getUTCMonth();switch(r){case"L":return String(i+1);case"LL":return je(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,r,n,i){var a=Ioe(t,i);return r==="wo"?n.ordinalNumber(a,{unit:"week"}):je(a,r.length)},I:function(t,r,n){var i=Moe(t);return r==="Io"?n.ordinalNumber(i,{unit:"week"}):je(i,r.length)},d:function(t,r,n){return r==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):ii.d(t,r)},D:function(t,r,n){var i=Toe(t);return r==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):je(i,r.length)},E:function(t,r,n){var i=t.getUTCDay();switch(r){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,r,n,i){var a=t.getUTCDay(),o=(a-i.weekStartsOn+8)%7||7;switch(r){case"e":return String(o);case"ee":return je(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,r,n,i){var a=t.getUTCDay(),o=(a-i.weekStartsOn+8)%7||7;switch(r){case"c":return String(o);case"cc":return je(o,r.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,r,n){var i=t.getUTCDay(),a=i===0?7:i;switch(r){case"i":return String(a);case"ii":return je(a,r.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,r,n){var i=t.getUTCHours(),a=i/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,r,n){var i=t.getUTCHours(),a;switch(i===12?a=so.noon:i===0?a=so.midnight:a=i/12>=1?"pm":"am",r){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,r,n){var i=t.getUTCHours(),a;switch(i>=17?a=so.evening:i>=12?a=so.afternoon:i>=4?a=so.morning:a=so.night,r){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,r,n){if(r==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return ii.h(t,r)},H:function(t,r,n){return r==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):ii.H(t,r)},K:function(t,r,n){var i=t.getUTCHours()%12;return r==="Ko"?n.ordinalNumber(i,{unit:"hour"}):je(i,r.length)},k:function(t,r,n){var i=t.getUTCHours();return i===0&&(i=24),r==="ko"?n.ordinalNumber(i,{unit:"hour"}):je(i,r.length)},m:function(t,r,n){return r==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):ii.m(t,r)},s:function(t,r,n){return r==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):ii.s(t,r)},S:function(t,r){return ii.S(t,r)},X:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();if(o===0)return"Z";switch(r){case"X":return ZO(o);case"XXXX":case"XX":return ca(o);case"XXXXX":case"XXX":default:return ca(o,":")}},x:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"x":return ZO(o);case"xxxx":case"xx":return ca(o);case"xxxxx":case"xxx":default:return ca(o,":")}},O:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+XO(o,":");case"OOOO":default:return"GMT"+ca(o,":")}},z:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+XO(o,":");case"zzzz":default:return"GMT"+ca(o,":")}},t:function(t,r,n,i){var a=i._originalDate||t,o=Math.floor(a.getTime()/1e3);return je(o,r.length)},T:function(t,r,n,i){var a=i._originalDate||t,o=a.getTime();return je(o,r.length)}};function XO(e,t){var r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return r+String(i);var o=t;return r+String(i)+o+je(a,2)}function ZO(e,t){if(e%60===0){var r=e>0?"-":"+";return r+je(Math.abs(e)/60,2)}return ca(e,t)}function ca(e,t){var r=t||"",n=e>0?"-":"+",i=Math.abs(e),a=je(Math.floor(i/60),2),o=je(i%60,2);return n+a+r+o}var JO=function(t,r){switch(t){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},NT=function(t,r){switch(t){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Foe=function(t,r){var n=t.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return JO(t,r);var o;switch(i){case"P":o=r.dateTime({width:"short"});break;case"PP":o=r.dateTime({width:"medium"});break;case"PPP":o=r.dateTime({width:"long"});break;case"PPPP":default:o=r.dateTime({width:"full"});break}return o.replace("{{date}}",JO(i,r)).replace("{{time}}",NT(a,r))},Boe={p:NT,P:Foe},zoe=["D","DD"],Uoe=["YY","YYYY"];function qoe(e){return zoe.indexOf(e)!==-1}function Woe(e){return Uoe.indexOf(e)!==-1}function eP(e,t,r){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Hoe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Koe=function(t,r,n){var i,a=Hoe[t];return typeof a=="string"?i=a:r===1?i=a.one:i=a.other.replace("{{count}}",r.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Fm(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var Voe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Goe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Qoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yoe={date:Fm({formats:Voe,defaultWidth:"full"}),time:Fm({formats:Goe,defaultWidth:"full"}),dateTime:Fm({formats:Qoe,defaultWidth:"full"})},Xoe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Zoe=function(t,r,n,i){return Xoe[t]};function Sl(e){return function(t,r){var n=r!=null&&r.context?String(r.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,o=r!=null&&r.width?String(r.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{var s=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[s]}var u=e.argumentCallback?e.argumentCallback(t):t;return i[u]}}var Joe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ese={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},tse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},rse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},nse={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ise={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ase=function(t,r){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},ose={ordinalNumber:ase,era:Sl({values:Joe,defaultWidth:"wide"}),quarter:Sl({values:ese,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Sl({values:tse,defaultWidth:"wide"}),day:Sl({values:rse,defaultWidth:"wide"}),dayPeriod:Sl({values:nse,defaultWidth:"wide",formattingValues:ise,defaultFormattingWidth:"wide"})};function jl(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;var o=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?lse(s,function(d){return d.test(o)}):sse(s,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u;var f=t.slice(o.length);return{value:u,rest:f}}}function sse(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function lse(e,t){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(e.matchPattern);if(!n)return null;var i=n[0],a=t.match(e.parsePattern);if(!a)return null;var o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;var s=t.slice(i.length);return{value:o,rest:s}}}var cse=/^(\d+)(th|st|nd|rd)?/i,fse=/\d+/i,dse={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},hse={any:[/^b/i,/^(a|c)/i]},pse={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},mse={any:[/1/i,/2/i,/3/i,/4/i]},vse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},yse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},gse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},xse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},bse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sse={ordinalNumber:use({matchPattern:cse,parsePattern:fse,valueCallback:function(t){return parseInt(t,10)}}),era:jl({matchPatterns:dse,defaultMatchWidth:"wide",parsePatterns:hse,defaultParseWidth:"any"}),quarter:jl({matchPatterns:pse,defaultMatchWidth:"wide",parsePatterns:mse,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:jl({matchPatterns:vse,defaultMatchWidth:"wide",parsePatterns:yse,defaultParseWidth:"any"}),day:jl({matchPatterns:gse,defaultMatchWidth:"wide",parsePatterns:xse,defaultParseWidth:"any"}),dayPeriod:jl({matchPatterns:bse,defaultMatchWidth:"any",parsePatterns:wse,defaultParseWidth:"any"})},jse={code:"en-US",formatDistance:Koe,formatLong:Yoe,formatRelative:Zoe,localize:ose,match:Sse,options:{weekStartsOn:0,firstWeekContainsDate:1}},Ose=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Pse=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_se=/^'([^]*?)'?$/,kse=/''/g,Ase=/[a-zA-Z]/;function Yn(e,t,r){var n,i,a,o,s,l,u,f,d,h,p,v,m,y;At(2,arguments);var b=String(t),g=kp(),x=(n=(i=void 0)!==null&&i!==void 0?i:g.locale)!==null&&n!==void 0?n:jse,S=Ui((a=(o=(s=(l=void 0)!==null&&l!==void 0?l:void 0)!==null&&s!==void 0?s:g.firstWeekContainsDate)!==null&&o!==void 0?o:(u=g.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=Ui((d=(h=(p=(v=void 0)!==null&&v!==void 0?v:void 0)!==null&&p!==void 0?p:g.weekStartsOn)!==null&&h!==void 0?h:(m=g.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&d!==void 0?d:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var j=an(e);if(!Aoe(j))throw new RangeError("Invalid time value");var O=_oe(j),P=Eoe(j,O),A={firstWeekContainsDate:S,weekStartsOn:w,locale:x,_originalDate:j},E=b.match(Pse).map(function(N){var T=N[0];if(T==="p"||T==="P"){var M=Boe[T];return M(N,x.formatLong)}return N}).join("").match(Ose).map(function(N){if(N==="''")return"'";var T=N[0];if(T==="'")return Ese(N);var M=Loe[T];if(M)return Woe(N)&&eP(N,t,String(e)),qoe(N)&&eP(N,t,String(e)),M(P,N,x.localize,A);if(T.match(Ase))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return N}).join("");return E}function Ese(e){var t=e.match(_se);return t?t[1].replace(kse,"'"):e}function uh(e,t){var r;At(1,arguments);var n=Ui((r=void 0)!==null&&r!==void 0?r:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var i=Cse(e),a;if(i.date){var o=Mse(i.date,n);a=Rse(o.restDateString,o.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var s=a.getTime(),l=0,u;if(i.time&&(l=Dse(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(u=Ise(i.timezone),isNaN(u))return new Date(NaN)}else{var f=new Date(s+l),d=new Date(0);return d.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),d.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),d}return new Date(s+l+u)}var sf={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Nse=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Tse=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,$se=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Cse(e){var t={},r=e.split(sf.dateTimeDelimiter),n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],sf.timeZoneDelimiter.test(t.date)&&(t.date=e.split(sf.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){var i=sf.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function Mse(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function Rse(e,t){if(t===null)return new Date(NaN);var r=e.match(Nse);if(!r)return new Date(NaN);var n=!!r[4],i=Ol(r[1]),a=Ol(r[2])-1,o=Ol(r[3]),s=Ol(r[4]),l=Ol(r[5])-1;if(n)return Use(t,s,l)?Lse(t,s,l):new Date(NaN);var u=new Date(0);return!Bse(t,a,o)||!zse(t,i)?new Date(NaN):(u.setUTCFullYear(t,a,Math.max(i,o)),u)}function Ol(e){return e?parseInt(e):1}function Dse(e){var t=e.match(Tse);if(!t)return NaN;var r=Bm(t[1]),n=Bm(t[2]),i=Bm(t[3]);return qse(r,n,i)?r*kT+n*_T+i*1e3:NaN}function Bm(e){return e&&parseFloat(e.replace(",","."))||0}function Ise(e){if(e==="Z")return 0;var t=e.match($se);if(!t)return 0;var r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Wse(n,i)?r*(n*kT+i*_T):NaN}function Lse(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var i=n.getUTCDay()||7,a=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}var Fse=[31,null,31,30,31,30,31,31,30,31,30,31];function TT(e){return e%400===0||e%4===0&&e%100!==0}function Bse(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(Fse[t]||(TT(e)?29:28))}function zse(e,t){return t>=1&&t<=(TT(e)?366:365)}function Use(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function qse(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Wse(e,t){return t>=0&&t<=59}function Ap({runId:e,truncate:t=!0,className:r="",showFullOnHover:n=!1}){const[i,a]=k.useState(!1),[o,s]=k.useState(!1),l=async f=>{f.stopPropagation();try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch(d){console.error("Failed to copy:",d)}},u=t&&!o?`${e.substring(0,12)}...`:e;return c.jsxs("div",{className:`flex items-center gap-2 group ${r}`,onMouseEnter:()=>n&&s(!0),onMouseLeave:()=>n&&s(!1),children:[c.jsx("span",{className:"font-mono text-xs text-dark-text",title:e,children:u}),c.jsx("button",{onClick:l,className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-dark-bg rounded text-dark-text-muted hover:text-primary",title:"Copy run ID to clipboard",children:i?c.jsx(eD,{size:14,className:"text-success"}):c.jsx(rD,{size:14})})]})}function ch({runs:e,highlightShots:t=!1,title:r,showDownloadButton:n=!1}){const i=mt(),a=s=>{i(`/runs/${s}`)},o=()=>{const s=r?`qobserva-${r.toLowerCase().replace(/\s+/g,"-")}`:"qobserva-runs";Kx(e,s)};return c.jsxs("div",{children:[n&&c.jsx("div",{className:"flex justify-end mb-4",children:c.jsxs("button",{onClick:o,className:"btn-secondary flex items-center gap-2",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Run ID"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Time"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Project"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Status"}),c.jsx("th",{className:`text-left py-3 px-4 text-sm font-semibold ${t?"text-primary bg-primary/10":"text-dark-text-muted"}`,children:"Shots"})]})}),c.jsx("tbody",{children:e.slice(0,50).map(s=>c.jsxs("tr",{onClick:()=>a(s.run_id),className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 cursor-pointer transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:c.jsx(Ap,{runId:s.run_id})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:Yn(new Date(s.created_at),"MMM dd, HH:mm")}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.project}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.backend_name}),c.jsx("td",{className:"py-3 px-4",children:c.jsx("span",{className:`px-2 py-1 rounded text-xs font-semibold ${s.status==="success"?"bg-success/20 text-success":s.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:s.status})}),c.jsx("td",{className:`py-3 px-4 text-sm font-semibold ${t?"text-primary bg-primary/5":"text-dark-text"}`,children:s.shots.toLocaleString()})]},s.run_id))})]})})]})}function Lg({runs:e,title:t}){const r=()=>{const n=t?`qobserva-${t.toLowerCase().replace(/\s+/g,"-")}`:"qobserva-runs";Kx(e,n)};return c.jsxs("button",{onClick:r,className:"btn-secondary flex items-center gap-2 ml-auto",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}function Hse({runs:e}){const t=k.useMemo(()=>{const r=e.reduce((n,i)=>{const a=new Date(i.created_at).toLocaleDateString();return n[a]||(n[a]={date:a,success:0,failed:0,total:0}),n[a].total++,i.status==="success"?n[a].success++:i.status==="failed"&&n[a].failed++,n},{});return Object.values(r).map(n=>({date:n.date,successRate:n.total>0?n.success/n.total*100:0,failureRate:n.total>0?n.failed/n.total*100:0})).sort((n,i)=>new Date(n.date).getTime()-new Date(i.date).getTime())},[e]);return t.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"}):c.jsx(tt,{width:"100%",height:300,children:c.jsxs(OT,{data:t,children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"colorSuccess",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#10b981",stopOpacity:.3}),c.jsx("stop",{offset:"95%",stopColor:"#10b981",stopOpacity:0})]}),c.jsxs("linearGradient",{id:"colorFailed",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#ef4444",stopOpacity:.3}),c.jsx("stop",{offset:"95%",stopColor:"#ef4444",stopOpacity:0})]})]}),c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"date",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},domain:[0,100],label:{value:"Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},formatter:r=>[`${r.toFixed(1)}%`,""]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"},iconType:"circle"}),c.jsx(wn,{type:"monotone",dataKey:"successRate",name:"Success Rate",stroke:"#10b981",strokeWidth:2,fill:"url(#colorSuccess)"}),c.jsx(wn,{type:"monotone",dataKey:"failureRate",name:"Failure Rate",stroke:"#ef4444",strokeWidth:2,fill:"url(#colorFailed)"})]})})}function Kse({filters:e={}}){const t=mt(),[r,n]=k.useState(null),i=k.useMemo(()=>["runs",JSON.stringify(e)],[e]),{data:a=[],isLoading:o}=Qe({queryKey:i,queryFn:()=>(console.log("Fetching runs with filters:",JSON.stringify(e,null,2)),Ye.getRuns({limit:1e3,...e})),staleTime:0,refetchOnWindowFocus:!1});if(o)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});const s=a.length,l=a.filter(m=>m.status==="success").length,u=s>0?l/s*100:0,f=a.reduce((m,y)=>m+y.shots,0),d=s>0?Math.round(f/s):0,h=new Set(a.map(m=>m.backend_name)).size,p=r?a.filter(m=>m.status===r):a,v=m=>{const y=new URLSearchParams({type:m});return e.project&&y.set("project",e.project),e.provider&&y.set("provider",e.provider),e.status&&y.set("status",e.status),e.startDate&&y.set("startDate",e.startDate),e.endDate&&y.set("endDate",e.endDate),`/runs-filtered?${y.toString()}`};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"grid grid-cols-5 gap-6",children:[c.jsx(be,{label:"Total Runs",value:s.toLocaleString(),clickable:!0,onClick:()=>t(v("all"))}),c.jsx(be,{label:"Success Rate",value:`${u.toFixed(1)}%`,clickable:!0,onClick:()=>t(v("success"))}),c.jsx(be,{label:"Avg Shots",value:d.toLocaleString(),clickable:!0,onClick:()=>t(v("shots"))}),c.jsx(be,{label:"Backends",value:h.toString(),clickable:!0,onClick:()=>t(v("backends"))}),c.jsx(be,{label:"Total Shots",value:f.toLocaleString(),clickable:!0,onClick:()=>t(v("shots"))})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Success Rate Trend"}),c.jsx(Hse,{runs:a})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runs by Status"}),c.jsx(joe,{runs:a,onSliceClick:m=>{n(m)}})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("h3",{className:"text-lg font-semibold text-white",children:[r?`${r.charAt(0).toUpperCase()+r.slice(1)} Runs`:"Recent Runs",r&&c.jsx("button",{onClick:()=>n(null),className:"ml-4 text-sm text-primary hover:underline",children:"Clear filter"})]}),c.jsx(Lg,{runs:p})]}),c.jsx(ch,{runs:p})]})]})}function Fg({counts:e}){const t=Object.entries(e).sort(([,r],[,n])=>n-r).slice(0,20).map(([r,n])=>({bitstring:r,count:n}));return t.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No counts available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Ts,{data:t,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"bitstring",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80,label:{value:"Bitstring (Measurement Outcome)",position:"insideBottom",offset:-5,fill:"#94a3b8",style:{textAnchor:"middle"}}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Count (Number of Observations)",angle:-90,position:"insideLeft",fill:"#94a3b8",style:{textAnchor:"middle"}}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0",fontWeight:"bold"},formatter:r=>[r.toLocaleString(),"Count"]}),c.jsx(or,{dataKey:"count",fill:"#3b82f6",radius:[8,8,0,0]})]})})}function Vse({queueTime:e,runtime:t}){const r=(e||0)+(t||0);return!e&&!t?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No timeline data"}):c.jsxs("div",{className:"space-y-4",children:[e&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("span",{className:"text-sm text-dark-text-muted",children:"Queue Time"}),c.jsxs("span",{className:"text-sm text-dark-text",children:[e,"ms"]})]}),c.jsx("div",{className:"h-4 bg-dark-bg rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-warning",style:{width:`${e/r*100}%`}})})]}),t&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("span",{className:"text-sm text-dark-text-muted",children:"Runtime"}),c.jsxs("span",{className:"text-sm text-dark-text",children:[t,"ms"]})]}),c.jsx("div",{className:"h-4 bg-dark-bg rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-success",style:{width:`${t/r*100}%`}})})]})]})}function Gse({top1:e,top5:t,top10:r}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Top-K Dominance"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Probability mass in top states. High values indicate algorithm convergence; low values suggest noise-dominated output."}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(be,{label:"Top-1 Probability",value:`${(e*100).toFixed(3)}%`}),c.jsx(be,{label:"Top-5 Cumulative",value:`${(t*100).toFixed(3)}%`}),c.jsx(be,{label:"Top-10 Cumulative",value:`${(r*100).toFixed(3)}%`})]}),e<.01&&r<.05&&c.jsx("p",{className:"text-sm text-warning mt-4",children:"⚠️ Highly uniform distribution → likely noise-dominated"})]})}function Qse({effectiveSupportSize:e,totalStates:t}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Effective Support Size"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Number of states covering 95% of probability mass. More intuitive than entropy for understanding algorithm sharpness vs noise."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(be,{label:"Effective Support (95%)",value:e.toLocaleString()}),c.jsx(be,{label:"Total Unique States",value:t.toLocaleString()})]}),c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Coverage:"}),c.jsxs("span",{className:"text-dark-text",children:[t>0?(e/t*100).toFixed(1):0,"% of states"]})]}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-2",children:c.jsx("div",{className:"bg-primary h-2 rounded-full transition-all",style:{width:`${t>0?e/t*100:0}%`}})})]})]})}function Yse({entropy:e,idealEntropy:t,entropyRatio:r}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Entropy Analysis"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:'Measured entropy vs ideal (max) entropy. Ratio shows "how random" relative to expectation.'}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(be,{label:"Shannon Entropy",value:`${e.toFixed(4)} bits`}),t!==void 0&&c.jsx(be,{label:"Ideal Entropy (Max)",value:`${t.toFixed(4)} bits`}),r!==void 0&&c.jsx(be,{label:"Entropy Ratio",value:`${(r*100).toFixed(1)}%`,change:r>.9?"Highly random":r>.5?"Moderately random":"Concentrated"})]}),r!==void 0&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Randomness:"}),c.jsx("span",{className:`font-semibold ${r>.9?"text-warning":r>.5?"text-primary":"text-success"}`,children:r>.9?"Highly Random":r>.5?"Moderately Random":"Concentrated"})]}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-2",children:c.jsx("div",{className:`h-2 rounded-full transition-all ${r>.9?"bg-warning":r>.5?"bg-primary":"bg-success"}`,style:{width:`${r*100}%`}})})]})]})}function Xse({uniqueStates:e,shots:t,uniqueStatesRatio:r,collisionRate:n}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shot Efficiency & Sampling Quality"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Unique states vs total shots. High unique ratio indicates undersampling; low ratio with high collisions suggests concentration."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[c.jsx(be,{label:"Unique States",value:e.toLocaleString()}),c.jsx(be,{label:"Total Shots",value:t.toLocaleString()})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(be,{label:"Unique/Shots Ratio",value:`${(r*100).toFixed(2)}%`,change:r>.9?"Undersampled":r<.1?"Oversampled":"Balanced"}),c.jsx(be,{label:"Collision Rate",value:`${(n*100).toFixed(2)}%`,change:n>.5?"High concentration":"Low concentration"})]}),r>.9&&c.jsxs("p",{className:"text-sm text-warning mt-4",children:["⚠️ High unique ratio (",r>.9?">90%":">50%",") - Additional shots unlikely to improve signal"]})]})}function Zse({runtimeMs:e,queueMs:t,runtimePerShot:r,classification:n}){const i=o=>{switch(o){case"queue-dominated":return"text-warning";case"execution-dominated":return"text-primary";case"cpu-bound":return"text-success";default:return"text-dark-text-muted"}},a=o=>{switch(o){case"queue-dominated":return"Queue-Dominated";case"execution-dominated":return"Execution-Dominated";case"cpu-bound":return"CPU-Bound";default:return"Unknown"}};return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runtime & Execution Behavior"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Runtime analysis helps identify if backend is slow or circuit is slow. Classification is heuristic."}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-4",children:[c.jsx(be,{label:"Runtime",value:`${e.toLocaleString()}ms`}),c.jsx(be,{label:"Queue Time",value:`${t.toLocaleString()}ms`}),c.jsx(be,{label:"Runtime/Shot",value:`${r.toFixed(3)}ms`}),c.jsxs("div",{className:"metric-card",children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Classification"}),c.jsx("div",{className:`text-2xl font-bold ${i(n)}`,children:a(n)})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("div",{className:"flex items-center justify-between text-sm mb-2",children:c.jsx("span",{className:"text-dark-text-muted",children:"Time Distribution:"})}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-4 flex overflow-hidden",children:e>0&&t>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"bg-primary h-4 transition-all",style:{width:`${e/(e+t)*100}%`},title:`Execution: ${e}ms`}),c.jsx("div",{className:"bg-warning h-4 transition-all",style:{width:`${t/(e+t)*100}%`},title:`Queue: ${t}ms`})]})}),c.jsxs("div",{className:"flex justify-between text-xs text-dark-text-muted mt-2",children:[c.jsxs("span",{children:["Execution: ",e,"ms"]}),c.jsxs("span",{children:["Queue: ",t,"ms"]})]})]}),n==="queue-dominated"&&c.jsx("p",{className:"text-sm text-warning mt-4",children:"⚠️ Queue time dominates - Backend may be heavily loaded"})]})}function Jse({cpuTimeS:e,qpuTimeS:t,queueTimeS:r,postProcessingTimeS:n}){const i=a=>`${a.toFixed(2)} s`;return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Execution time breakdown"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Provider-reported time spent in CPU, QPU, queue, and post-processing. Shown when the backend supplies this metadata (e.g. IBM cloud/hardware)."}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e!=null&&c.jsx(be,{label:"CPU",value:i(e)}),t!=null&&c.jsx(be,{label:"QPU",value:i(t)}),r!=null&&c.jsx(be,{label:"Queue (provider)",value:i(r)}),n!=null&&c.jsx(be,{label:"Post-processing",value:i(n)})]})]})}function ec(e,t){var v,m,y,b,g,x,S,w;const r={},n=((m=(v=e.artifacts)==null?void 0:v.counts)==null?void 0:m.histogram)||{},i=((y=e.execution)==null?void 0:y.shots)||0,a=((b=e.execution)==null?void 0:b.runtime_ms)||0,o=((g=e.execution)==null?void 0:g.queue_ms)||0,s=(S=(x=e.program)==null?void 0:x.circuit_metrics)==null?void 0:S.num_qubits;if(!n||i===0)return r;const l=Object.entries(n).map(([j,O])=>({state:j,count:parseInt(O,10),probability:parseInt(O,10)/i})).sort((j,O)=>O.probability-j.probability);if(l.length>0){r.top1Probability=l[0].probability;const j=l.slice(0,5).reduce((P,A)=>P+A.probability,0);r.top5Probability=j;const O=l.slice(0,10).reduce((P,A)=>P+A.probability,0);r.top10Probability=O}let u=0,f=0;for(const j of l)if(u+=j.probability,f++,u>=.95)break;r.effectiveSupportSize=f;const d=(w=t.metrics)==null?void 0:w["qc.quality.shannon_entropy_bits"];if(d!=null&&(r.entropy=d,s&&s>0)){const j=s;r.idealEntropy=j,r.entropyRatio=d/j}const h=Object.keys(n).length;r.uniqueStates=h,r.uniqueStatesRatio=i>0?h/i:0;let p=0;for(const j of Object.values(n)){const O=parseInt(String(j),10);O>1&&(p+=O-1)}if(r.collisionRate=i>0?p/i:0,a>0&&i>0&&(r.runtimePerShot=a/i),a>0){const j=a+o;if(j>0){const O=o/j,P=a/j;O>.5?r.runtimeClassification="queue-dominated":P>.7?r.runtimeClassification="execution-dominated":a<100&&o<100?r.runtimeClassification="cpu-bound":r.runtimeClassification="unknown"}else r.runtimeClassification="unknown"}else r.runtimeClassification="unknown";return r}function ele(e){var n,i,a,o,s;if(!e||Object.keys(e).length===0)return null;if(e.algorithm==="error_test"){const l=e.error_type||"error scenario";return{severity:"warn",message:`This run is tagged as an error test (${l}). Results may not represent normal execution and should be interpreted accordingly.`,tagContext:`algorithm: error_test, error_type: ${l}`}}if(e.error_type&&e.error_type!=="none"&&e.error_type!==""&&(e.algorithm==="error_test"||((n=e.test)==null?void 0:n.toLowerCase().includes("error"))||((i=e.purpose)==null?void 0:i.toLowerCase().includes("error"))||((a=e.scenario)==null?void 0:a.toLowerCase().includes("error"))))return{severity:"warn",message:`This run is tagged with error_type: "${e.error_type}". This appears to be an intentional error test scenario - results may not be meaningful for normal analysis.`,tagContext:`error_type: ${e.error_type}`};if(e.test&&e.test.toLowerCase().includes("error"))return{severity:"info",message:'This run is tagged as a test with "error" in the tag value. Results may be from an error handling test scenario.',tagContext:`test: ${e.test}`};const t=((o=e.purpose)==null?void 0:o.toLowerCase())||"",r=((s=e.scenario)==null?void 0:s.toLowerCase())||"";return(t.includes("error")||r.includes("error"))&&(t.includes("test")||r.includes("test"))?{severity:"info",message:"This run appears to be an error test scenario based on tags. Results should be interpreted in that context.",tagContext:t?`purpose: ${e.purpose}`:`scenario: ${e.scenario}`}:null}function tle(){var g,x,S,w,j,O,P,A,E,N,T,M,R,D;const{runId:e}=xR(),[t,r]=k.useState({rawMetadata:!1,rawEvent:!1,rawAnalysis:!1}),{data:n=[]}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3})}),i=n.find(L=>L.run_id===e),a=(i==null?void 0:i.project)||"default",{data:o,isLoading:s,error:l}=Qe({queryKey:["run",e],queryFn:()=>Ye.getRun(a,e),enabled:!!e,retry:2}),u=k.useMemo(()=>o?ec(o.event,o.analysis):{},[o]),f=o==null?void 0:o.event,d=o==null?void 0:o.analysis,h=(d==null?void 0:d.metrics)||{},p=h["qc.quality.shannon_entropy_bits"],v=((x=(g=f==null?void 0:f.artifacts)==null?void 0:g.counts)==null?void 0:x.histogram)||{},m=Object.keys(v).length,y=k.useMemo(()=>f!=null&&f.tags?ele(f.tags):null,[f==null?void 0:f.tags]);if(s)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});if(l||!o||!f||!d)return c.jsxs("div",{className:"text-center py-12",children:[c.jsx("p",{className:"text-dark-text-muted mb-4",children:"Run not found"}),c.jsxs("p",{className:"text-sm text-dark-text-muted",children:["Run ID: ",e]})]});const b=L=>{r(z=>({...z,[L]:!z[L]}))};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Run Details"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Run ID:"}),c.jsx(Ap,{runId:e||"",truncate:!1})]})]}),y&&c.jsx("div",{className:`card border-l-4 ${y.severity==="warn"?"border-warning bg-warning/10":"border-primary bg-primary/10"}`,children:c.jsxs("div",{className:"flex items-start gap-3",children:[y.severity==="warn"?c.jsx(YR,{className:"text-warning mt-0.5 flex-shrink-0",size:20}):c.jsx(Yk,{className:"text-primary mt-0.5 flex-shrink-0",size:20}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h4",{className:`font-semibold mb-1 ${y.severity==="warn"?"text-warning":"text-primary"}`,children:y.severity==="warn"?"Test Scenario Warning":"Tag Information"}),c.jsx("p",{className:"text-sm text-dark-text",children:y.message}),y.tagContext&&c.jsxs("p",{className:"text-xs text-dark-text-muted mt-2",children:["Tag context: ",y.tagContext]})]})]})}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Run Information"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Project"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.project})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Provider"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.backend.provider})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Backend"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.backend.name})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Status"}),c.jsx("span",{className:`font-medium ${f.execution.status==="success"?"text-success":f.execution.status==="failed"?"text-error":"text-dark-text-muted"}`,children:f.execution.status})]})]}),(((S=f.software)==null?void 0:S.sdk)||((w=f.software)==null?void 0:w.python_version))&&c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("h4",{className:"text-sm font-semibold text-white mb-3",children:"Software Environment"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[((j=f.software.sdk)==null?void 0:j.name)&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"SDK"}),c.jsxs("span",{className:"text-dark-text font-medium",children:[f.software.sdk.name,f.software.sdk.version&&c.jsxs("span",{className:"text-dark-text-muted ml-1",children:["v",f.software.sdk.version]})]})]}),f.software.python_version&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Python"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.software.python_version})]}),f.software.agent_version&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"QObserva Agent"}),c.jsxs("span",{className:"text-dark-text font-medium",children:["v",f.software.agent_version]})]})]})]}),f.event_id&&c.jsx("div",{className:"mt-4 pt-4 border-t border-dark-border",children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted text-sm mb-1",children:"Event ID"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.event_id})]})})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[h["qc.quality.success_probability"]!==void 0?c.jsx(be,{label:"Success Rate",value:`${(h["qc.quality.success_probability"]*100).toFixed(1)}%`}):h["qc.optimization.energy"]!==void 0?c.jsx(be,{label:"Energy",value:h["qc.optimization.energy"].toFixed(4)}):c.jsx(be,{label:"Success Rate",value:"N/A"}),c.jsx(be,{label:"Shots",value:f.execution.shots.toLocaleString()}),c.jsx(be,{label:"Runtime",value:f.execution.runtime_ms?`${f.execution.runtime_ms}ms`:"N/A"}),c.jsx(be,{label:"Cost",value:h["qc.cost.estimated_usd"]?`$${h["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]}),h["qc.optimization.energy"]!==void 0&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Optimization Results"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Energy"}),c.jsx("span",{className:"text-dark-text font-medium text-lg",children:h["qc.optimization.energy"].toFixed(6)})]}),h["qc.optimization.energy_stderr"]!==void 0&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Energy Std Error"}),c.jsx("span",{className:"text-dark-text font-medium",children:h["qc.optimization.energy_stderr"].toFixed(6)})]}),h["qc.optimization.approximation_ratio"]!==void 0&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Approximation Ratio"}),c.jsxs("span",{className:`font-medium ${h["qc.optimization.approximation_ratio"]<=1.1?"text-success":h["qc.optimization.approximation_ratio"]<=2?"text-warning":"text-error"}`,children:[h["qc.optimization.approximation_ratio"].toFixed(4),"x"]}),c.jsx("span",{className:"text-xs text-dark-text-muted mt-1",children:h["qc.optimization.approximation_ratio"]<=1.1?"Excellent (near ground state)":h["qc.optimization.approximation_ratio"]<=2?"Good":"Needs improvement"})]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Measurement Results"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Distribution of measurement outcomes (bitstrings) and how many times each was observed. Shows the top 20 most frequent outcomes."}),c.jsx(Fg,{counts:((P=(O=f.artifacts)==null?void 0:O.counts)==null?void 0:P.histogram)||{}})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Execution Timeline"}),c.jsx(Vse,{queueTime:f.execution.queue_ms,runtime:f.execution.runtime_ms})]})]}),u.top1Probability!==void 0&&c.jsx(Gse,{top1:u.top1Probability,top5:u.top5Probability||0,top10:u.top10Probability||0}),u.effectiveSupportSize!==void 0&&c.jsx(Qse,{effectiveSupportSize:u.effectiveSupportSize,totalStates:m}),p!=null&&c.jsx(Yse,{entropy:p,idealEntropy:u.idealEntropy,entropyRatio:u.entropyRatio}),u.uniqueStates!==void 0&&((A=f.execution)==null?void 0:A.shots)&&c.jsx(Xse,{uniqueStates:u.uniqueStates,shots:f.execution.shots,uniqueStatesRatio:u.uniqueStatesRatio||0,collisionRate:u.collisionRate||0}),u.runtimePerShot!==void 0&&((E=f.execution)==null?void 0:E.runtime_ms)!==void 0&&c.jsx(Zse,{runtimeMs:f.execution.runtime_ms||0,queueMs:f.execution.queue_ms||0,shots:f.execution.shots||0,runtimePerShot:u.runtimePerShot,classification:u.runtimeClassification||"unknown"}),(h["qc.time.cpu_s"]!=null||h["qc.time.qpu_s"]!=null||h["qc.time.queue_s"]!=null||h["qc.time.post_processing_s"]!=null)&&c.jsx(Jse,{cpuTimeS:h["qc.time.cpu_s"],qpuTimeS:h["qc.time.qpu_s"],queueTimeS:h["qc.time.queue_s"],postProcessingTimeS:h["qc.time.post_processing_s"]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawMetadata"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detailed Metadata"}),t.rawMetadata?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawMetadata&&c.jsxs("div",{className:"mt-4 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Run ID:"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.run_id})]}),f.event_id&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Event ID:"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.event_id})]}),f.created_at&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Created At:"}),c.jsx("span",{className:"text-dark-text",children:new Date(f.created_at).toLocaleString()})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Raw Metadata (JSON)"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-96",children:JSON.stringify({project:f.project,backend:f.backend,run_id:f.run_id,event_id:f.event_id||void 0,created_at:f.created_at||void 0,execution:{status:f.execution.status,shots:f.execution.shots,runtime_ms:f.execution.runtime_ms,queue_ms:f.execution.queue_ms}},null,2)})]})]})]}),d.insights&&d.insights.length>0&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Insights"}),c.jsx("div",{className:"space-y-2",children:d.insights.map((L,z)=>c.jsx("div",{className:`p-3 rounded-lg ${L.severity==="critical"?"bg-error/20 border border-error/30 text-error":L.severity==="warn"?"bg-warning/20 border border-warning/30 text-warning":"bg-primary/20 border border-primary/30 text-primary"}`,children:L.summary},z))})]}),((N=f.artifacts)==null?void 0:N.energies)&&c.jsxs("div",{className:"card border-l-4 border-primary",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Energy Artifacts (Debug)"}),c.jsxs("div",{className:"text-sm",children:[c.jsxs("div",{className:"mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Energy Value:"}),c.jsx("span",{className:"text-dark-text font-mono ml-2",children:((T=f.artifacts.energies)==null?void 0:T.value)!==null&&((M=f.artifacts.energies)==null?void 0:M.value)!==void 0?String(f.artifacts.energies.value):"null/undefined"})]}),c.jsxs("div",{className:"mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Energy Std Error:"}),c.jsx("span",{className:"text-dark-text font-mono ml-2",children:((R=f.artifacts.energies)==null?void 0:R.stderr)!==null&&((D=f.artifacts.energies)==null?void 0:D.stderr)!==void 0?String(f.artifacts.energies.stderr):"null/undefined"})]}),c.jsx("div",{className:"text-xs text-dark-text-muted mt-2",children:"If energy value is null/undefined, the adapter didn't extract it. If it has a value but metrics don't show it, the analysis needs to be re-run."})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawEvent"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Raw Event Data"}),t.rawEvent?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawEvent&&c.jsx("div",{className:"mt-4",children:c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-96",children:JSON.stringify(f,null,2)})})]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawAnalysis"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Raw Analytics Data"}),t.rawAnalysis?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawAnalysis&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Metrics"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-64",children:JSON.stringify(h,null,2)})]}),d.insights&&d.insights.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Insights"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-64",children:JSON.stringify(d.insights,null,2)})]})]})]})]})}function tP({runs:e,value:t,onChange:r,label:n,placeholder:i="Search by run ID, project, backend..."}){const[a,o]=k.useState(!1),[s,l]=k.useState(""),u=e.find(p=>p.run_id===t),f=k.useMemo(()=>{if(!s.trim())return e.slice(0,50);const p=s.toLowerCase();return e.filter(v=>v.run_id.toLowerCase().includes(p)||v.project.toLowerCase().includes(p)||v.provider.toLowerCase().includes(p)||v.backend_name.toLowerCase().includes(p)||v.status.toLowerCase().includes(p)).slice(0,50)},[e,s]),d=p=>{r(p),o(!1),l("")},h=()=>{r(""),l("")};return c.jsxs("div",{className:"relative",children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:n}),c.jsxs("div",{className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>o(!a),className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm flex items-center justify-between hover:border-primary/50 transition-colors",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[c.jsx(Yf,{size:16,className:"text-dark-text-muted flex-shrink-0"}),u?c.jsxs("span",{className:"truncate",children:[c.jsxs("span",{className:"font-mono text-xs text-primary",children:[u.run_id.substring(0,12),"..."]})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{children:u.project})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{children:u.backend_name})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{className:"text-xs",children:Yn(new Date(u.created_at),"MMM dd, HH:mm")})]}):c.jsx("span",{className:"text-dark-text-muted",children:i})]}),u&&c.jsx("div",{onClick:p=>{p.stopPropagation(),h()},className:"ml-2 text-dark-text-muted hover:text-dark-text transition-colors cursor-pointer flex items-center",role:"button",tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),h())},children:c.jsx(Xk,{size:16})})]}),a&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),c.jsxs("div",{className:"absolute z-20 w-full mt-1 bg-dark-surface border border-dark-border rounded-lg shadow-xl max-h-96 overflow-hidden",children:[c.jsx("div",{className:"p-2 border-b border-dark-border",children:c.jsxs("div",{className:"relative",children:[c.jsx(Yf,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-dark-text-muted"}),c.jsx("input",{type:"text",value:s,onChange:p=>l(p.target.value),placeholder:"Type to search...",className:"w-full bg-dark-bg border border-dark-border rounded-lg pl-10 pr-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50",autoFocus:!0,onClick:p=>p.stopPropagation()})]})}),c.jsx("div",{className:"overflow-y-auto max-h-80",children:f.length===0?c.jsx("div",{className:"p-4 text-center text-dark-text-muted text-sm",children:"No runs found"}):c.jsx("div",{className:"p-1",children:f.map(p=>c.jsx("button",{onClick:()=>d(p.run_id),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${p.run_id===t?"bg-primary/20 text-primary border border-primary/30":"text-dark-text hover:bg-dark-bg"}`,children:c.jsx("div",{className:"flex items-center justify-between gap-2",children:c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsxs("span",{className:"font-mono text-xs text-primary font-semibold",children:[p.run_id.substring(0,12),"..."]}),c.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${p.status==="success"?"bg-success/20 text-success":p.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:p.status})]}),c.jsxs("div",{className:"text-xs text-dark-text-muted space-x-2",children:[c.jsx("span",{children:p.project}),c.jsx("span",{children:"•"}),c.jsx("span",{children:p.provider}),c.jsx("span",{children:"•"}),c.jsx("span",{children:p.backend_name}),c.jsx("span",{children:"•"}),c.jsx("span",{children:Yn(new Date(p.created_at),"MMM dd, HH:mm")})]})]})})},p.run_id))})})]})]})]})]})}function rP({event:e,runId:t,label:r}){const n=mt();return c.jsx("div",{className:"card",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:r}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ap,{runId:t}),c.jsx("button",{onClick:()=>n(`/runs/${t}`),className:"flex items-center gap-1 text-primary hover:text-primary/80 text-sm transition-colors",title:"View run details",children:c.jsx(nD,{size:14})})]})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Project:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.project})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Provider:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.backend.provider})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Backend:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.backend.name})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Time:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.created_at?Yn(new Date(e.created_at),"MMM dd, HH:mm"):"N/A"})]})]})]})})})}function rle({runA:e,runB:t}){var l,u,f,d,h,p,v,m,y,b;const r=k.useMemo(()=>ec(e.event,e.analysis),[e]),n=k.useMemo(()=>ec(t.event,t.analysis),[t]),i=e.analysis.metrics||{},a=t.analysis.metrics||{},o=(g,x,S="number")=>{if(g===void 0||x===void 0)return"N/A";const w=x-g,j=w>=0?"+":"";return S==="percent"?`${j}${(w*100).toFixed(1)}%`:S==="ms"?`${j}${w.toFixed(0)}ms`:S==="usd"?`${j}$${w.toFixed(4)}`:S==="s"?`${j}${w.toFixed(2)} s`:`${j}${w.toLocaleString()}`},s=(g,x,S=!1)=>{if(g===void 0||x===void 0)return"text-dark-text-muted";const w=x-g;return w===0?"text-dark-text-muted":S?w<0?"text-success":"text-error":w>0?"text-success":"text-error"};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Basic Execution Metrics"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Comparing Run A vs Run B. Delta shows change from Run A to Run B (positive = Run B is higher, negative = Run B is lower)."}),c.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Shots"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:e.event.execution.shots.toLocaleString()})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:t.event.execution.shots.toLocaleString()})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.shots,t.event.execution.shots)}`,children:["Δ: ",o(e.event.execution.shots,t.event.execution.shots)]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Success Rate"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:i["qc.quality.success_probability"]?`${(i["qc.quality.success_probability"]*100).toFixed(1)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:a["qc.quality.success_probability"]?`${(a["qc.quality.success_probability"]*100).toFixed(1)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.quality.success_probability"],a["qc.quality.success_probability"])}`,children:["Δ: ",o(i["qc.quality.success_probability"],a["qc.quality.success_probability"],"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Runtime"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:e.event.execution.runtime_ms?`${e.event.execution.runtime_ms.toLocaleString()}ms`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:t.event.execution.runtime_ms?`${t.event.execution.runtime_ms.toLocaleString()}ms`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.runtime_ms,t.event.execution.runtime_ms,!0)}`,children:["Δ: ",o(e.event.execution.runtime_ms,t.event.execution.runtime_ms,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Cost"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:i["qc.cost.estimated_usd"]?`$${i["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:a["qc.cost.estimated_usd"]?`$${a["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.cost.estimated_usd"],a["qc.cost.estimated_usd"],!0)}`,children:["Δ: ",o(i["qc.cost.estimated_usd"],a["qc.cost.estimated_usd"],"usd")]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Quality Metrics"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Entropy"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((l=i["qc.quality.shannon_entropy_bits"])==null?void 0:l.toFixed(4))||"N/A"," bits"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((u=a["qc.quality.shannon_entropy_bits"])==null?void 0:u.toFixed(4))||"N/A"," bits"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.quality.shannon_entropy_bits"],a["qc.quality.shannon_entropy_bits"])}`,children:["Δ: ",o(i["qc.quality.shannon_entropy_bits"],a["qc.quality.shannon_entropy_bits"])]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Top-1 Probability"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.top1Probability?`${(r.top1Probability*100).toFixed(3)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.top1Probability?`${(n.top1Probability*100).toFixed(3)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.top1Probability,n.top1Probability)}`,children:["Δ: ",o(r.top1Probability,n.top1Probability,"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Effective Support"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((f=r.effectiveSupportSize)==null?void 0:f.toLocaleString())||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((d=n.effectiveSupportSize)==null?void 0:d.toLocaleString())||"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.effectiveSupportSize,n.effectiveSupportSize)}`,children:["Δ: ",o(r.effectiveSupportSize,n.effectiveSupportSize)]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shot Efficiency"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Unique States"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((h=r.uniqueStates)==null?void 0:h.toLocaleString())||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((p=n.uniqueStates)==null?void 0:p.toLocaleString())||"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.uniqueStates,n.uniqueStates)}`,children:["Δ: ",o(r.uniqueStates,n.uniqueStates)]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Unique/Shots Ratio"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.uniqueStatesRatio?`${(r.uniqueStatesRatio*100).toFixed(2)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.uniqueStatesRatio?`${(n.uniqueStatesRatio*100).toFixed(2)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.uniqueStatesRatio,n.uniqueStatesRatio)}`,children:["Δ: ",o(r.uniqueStatesRatio,n.uniqueStatesRatio,"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Collision Rate"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.collisionRate?`${(r.collisionRate*100).toFixed(2)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.collisionRate?`${(n.collisionRate*100).toFixed(2)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.collisionRate,n.collisionRate,!0)}`,children:["Δ: ",o(r.collisionRate,n.collisionRate,"percent")]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runtime Analysis"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Runtime/Shot"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((v=r.runtimePerShot)==null?void 0:v.toFixed(3))||"N/A"," ms"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((m=n.runtimePerShot)==null?void 0:m.toFixed(3))||"N/A"," ms"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.runtimePerShot,n.runtimePerShot,!0)}`,children:["Δ: ",o(r.runtimePerShot,n.runtimePerShot,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Queue Time"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((y=e.event.execution.queue_ms)==null?void 0:y.toLocaleString())||"N/A"," ms"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((b=t.event.execution.queue_ms)==null?void 0:b.toLocaleString())||"N/A"," ms"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.queue_ms,t.event.execution.queue_ms,!0)}`,children:["Δ: ",o(e.event.execution.queue_ms,t.event.execution.queue_ms,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Classification"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white capitalize",children:r.runtimeClassification||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white capitalize",children:n.runtimeClassification||"N/A"})]})]})]})]})]}),(i["qc.time.cpu_s"]!=null||a["qc.time.cpu_s"]!=null||i["qc.time.qpu_s"]!=null||a["qc.time.qpu_s"]!=null||i["qc.time.queue_s"]!=null||a["qc.time.queue_s"]!=null||i["qc.time.post_processing_s"]!=null||a["qc.time.post_processing_s"]!=null)&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Execution time breakdown"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Provider-reported CPU, QPU, queue, and post-processing time (seconds). Shown when the backend supplies this metadata."}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(i["qc.time.cpu_s"]!=null||a["qc.time.cpu_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"CPU"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.cpu_s"]!=null?`${Number(i["qc.time.cpu_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.cpu_s"]!=null?`${Number(a["qc.time.cpu_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.cpu_s"],a["qc.time.cpu_s"],!0)}`,children:["Δ: ",o(i["qc.time.cpu_s"],a["qc.time.cpu_s"],"s")]})})]}),(i["qc.time.qpu_s"]!=null||a["qc.time.qpu_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"QPU"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.qpu_s"]!=null?`${Number(i["qc.time.qpu_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.qpu_s"]!=null?`${Number(a["qc.time.qpu_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.qpu_s"],a["qc.time.qpu_s"],!0)}`,children:["Δ: ",o(i["qc.time.qpu_s"],a["qc.time.qpu_s"],"s")]})})]}),(i["qc.time.queue_s"]!=null||a["qc.time.queue_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Queue (provider)"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.queue_s"]!=null?`${Number(i["qc.time.queue_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.queue_s"]!=null?`${Number(a["qc.time.queue_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.queue_s"],a["qc.time.queue_s"],!0)}`,children:["Δ: ",o(i["qc.time.queue_s"],a["qc.time.queue_s"],"s")]})})]}),(i["qc.time.post_processing_s"]!=null||a["qc.time.post_processing_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Post-processing"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.post_processing_s"]!=null?`${Number(i["qc.time.post_processing_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.post_processing_s"]!=null?`${Number(a["qc.time.post_processing_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.post_processing_s"],a["qc.time.post_processing_s"],!0)}`,children:["Δ: ",o(i["qc.time.post_processing_s"],a["qc.time.post_processing_s"],"s")]})})]})]})]})]})}function nle({runA:e,runB:t}){var r,n,i,a;return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Measurement Results Comparison"}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:e.label}),c.jsx(Fg,{counts:((n=(r=e.event.artifacts)==null?void 0:r.counts)==null?void 0:n.histogram)||{}})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:t.label}),c.jsx(Fg,{counts:((a=(i=t.event.artifacts)==null?void 0:i.counts)==null?void 0:a.histogram)||{}})]})]})]})}function ile({runA:e,runB:t}){const r=k.useMemo(()=>ec(e.event,e.analysis),[e]),n=k.useMemo(()=>ec(t.event,t.analysis),[t]),i=[{category:"Top-1",[e.label]:r.top1Probability?r.top1Probability*100:0,[t.label]:n.top1Probability?n.top1Probability*100:0},{category:"Top-5",[e.label]:r.top5Probability?r.top5Probability*100:0,[t.label]:n.top5Probability?n.top5Probability*100:0},{category:"Top-10",[e.label]:r.top10Probability?r.top10Probability*100:0,[t.label]:n.top10Probability?n.top10Probability*100:0}];return!r.top1Probability&&!n.top1Probability?null:c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Top-K Dominance Comparison"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Probability mass in top states. Higher values indicate better algorithm convergence."}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:i,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"category",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Probability (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"},formatter:a=>[`${a.toFixed(3)}%`,"Probability"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(or,{dataKey:e.label,fill:"#3b82f6",radius:[8,8,0,0]}),c.jsx(or,{dataKey:t.label,fill:"#10b981",radius:[8,8,0,0]})]})})]})}function ale({runA:e,runB:t}){const r=k.useMemo(()=>{var a;return{entropy:(a=e.analysis.metrics)==null?void 0:a["qc.quality.shannon_entropy_bits"],entropyRatio:void 0}},[e]),n=k.useMemo(()=>{var a;return{entropy:(a=t.analysis.metrics)==null?void 0:a["qc.quality.shannon_entropy_bits"],entropyRatio:void 0}},[t]);if(r.entropy===void 0&&n.entropy===void 0)return null;const i=[{metric:"Shannon Entropy",[e.label]:r.entropy||0,[t.label]:n.entropy||0}];return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Entropy Comparison"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Shannon entropy measures the randomness/uniformity of measurement distributions."}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:i,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"metric",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Entropy (bits)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"},formatter:a=>[`${a.toFixed(4)} bits`,"Entropy"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(or,{dataKey:e.label,fill:"#3b82f6",radius:[8,8,0,0]}),c.jsx(or,{dataKey:t.label,fill:"#10b981",radius:[8,8,0,0]})]})})]})}function ole(){const[e,t]=Ah(),{data:r=[],isLoading:n}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3}),staleTime:5e3}),[i,a]=k.useState(()=>e.get("runA")||""),[o,s]=k.useState(()=>e.get("runB")||"");k.useEffect(()=>{var g,x;if(r.length>0&&!i&&!o&&!e.get("runA")&&!e.get("runB")){const S=((g=r[0])==null?void 0:g.run_id)||"",w=r.length>1?((x=r[1])==null?void 0:x.run_id)||"":S;a(S),s(w),t({runA:S,runB:w},{replace:!0})}},[r,i,o,e,t]),k.useEffect(()=>{const g=new URLSearchParams;i&&g.set("runA",i),o&&g.set("runB",o),t(g,{replace:!0})},[i,o,t]);const l=r.find(g=>g.run_id===i),u=r.find(g=>g.run_id===o),f=(l==null?void 0:l.project)||"default",d=(u==null?void 0:u.project)||"default",{data:h,isLoading:p}=Qe({queryKey:["run",i],queryFn:()=>Ye.getRun(f,i),enabled:!!i,retry:2}),{data:v,isLoading:m}=Qe({queryKey:["run",o],queryFn:()=>Ye.getRun(d,o),enabled:!!o,retry:2});if(n)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading runs..."});const y=p||m,b=h&&v;return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Compare Runs"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Select two runs to compare metrics, quality, and performance"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx(tP,{runs:r,value:i,onChange:a,label:"Run A",placeholder:"Search for first run..."}),c.jsx(tP,{runs:r,value:o,onChange:s,label:"Run B",placeholder:"Search for second run..."})]}),y&&c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading run data..."}),!y&&b&&i&&o&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx(rP,{event:h.event,runId:i,label:"Run A"}),c.jsx(rP,{event:v.event,runId:o,label:"Run B"})]}),c.jsx(rle,{runA:h,runB:v}),c.jsx(ile,{runA:{event:h.event,analysis:h.analysis,runId:i,label:"Run A"},runB:{event:v.event,analysis:v.analysis,runId:o,label:"Run B"}}),c.jsx(ale,{runA:{analysis:h.analysis,runId:i,label:"Run A"},runB:{analysis:v.analysis,runId:o,label:"Run B"}}),c.jsx(nle,{runA:{event:h.event,runId:i,label:"Run A"},runB:{event:v.event,runId:o,label:"Run B"}})]}),!y&&!b&&(i||o)&&c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Please select both runs to compare"})]})}function sle({runs:e}){var i;const t=mt(),n=((i=Qe({queryKey:["runs-analyses",e.map(a=>a.run_id)],queryFn:async()=>(await Promise.all(e.slice(0,50).map(async o=>{const s=await Ye.getRun(o.project,o.run_id).catch(()=>null);return s?{run:o,res:s}:null}))).filter(Boolean)}).data)==null?void 0:i.map(({run:a,res:o})=>{var u,f,d,h;const s=(f=(u=o==null?void 0:o.analysis)==null?void 0:u.metrics)==null?void 0:f["qc.circuit.depth.post"],l=(h=(d=o==null?void 0:o.analysis)==null?void 0:d.metrics)==null?void 0:h["qc.quality.success_probability"];return s&&l!==void 0?{depth:s,success:l*100,backend:a.backend_name,runId:a.run_id,project:a.project}:null}).filter(Boolean))||[];return n.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(jT,{data:n,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"depth",name:"Circuit Depth",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Circuit Depth",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"success",name:"Success Rate",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Success Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{cursor:{strokeDasharray:"3 3"},contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"}}),c.jsx(tl,{dataKey:"success",fill:"#3b82f6",onClick:a=>{const o=a==null?void 0:a.payload;o!=null&&o.runId&&t(`/runs/${o.runId}`)},style:{cursor:"pointer"},children:n.map((a,o)=>c.jsx(vr,{fill:"#3b82f6"},`cell-${o}`))})]})})}function lle({runs:e}){var i;const t=mt(),n=((i=Qe({queryKey:["runs-analyses-cost",e.map(a=>a.run_id)],queryFn:async()=>(await Promise.all(e.slice(0,50).map(async o=>{const s=await Ye.getRun(o.project,o.run_id).catch(()=>null);return s?{run:o,res:s}:null}))).filter(Boolean)}).data)==null?void 0:i.map(({run:a,res:o})=>{var u,f,d,h;const s=(f=(u=o==null?void 0:o.analysis)==null?void 0:u.metrics)==null?void 0:f["qc.cost.estimated_usd"],l=(h=(d=o==null?void 0:o.analysis)==null?void 0:d.metrics)==null?void 0:h["qc.quality.success_probability"];return s&&s>0&&l!==void 0?{cost:s,success:l*100,backend:a.backend_name,runId:a.run_id,project:a.project}:null}).filter(Boolean))||[];return n.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No cost data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(jT,{data:n,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"cost",name:"Cost (USD)",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Cost (USD)",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"success",name:"Success Rate",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Success Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{cursor:{strokeDasharray:"3 3"},contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"}}),c.jsx(tl,{dataKey:"success",fill:"#8b5cf6",onClick:a=>{const o=a==null?void 0:a.payload;o!=null&&o.runId&&t(`/runs/${o.runId}`)},style:{cursor:"pointer"},children:n.map((a,o)=>c.jsx(vr,{fill:"#8b5cf6"},`cell-${o}`))})]})})}function ule({runs:e}){const t=k.useMemo(()=>{const n=e.reduce((i,a)=>(i[a.backend_name]||(i[a.backend_name]={success:0,total:0}),i[a.backend_name].total++,a.status==="success"&&i[a.backend_name].success++,i),{});return Object.entries(n).map(([i,a])=>({backend:i,successRate:a.total>0?a.success/a.total*100:0,totalRuns:a.total}))},[e]);if(t.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const r=Math.max(...t.map(n=>n.successRate));return c.jsx("div",{className:"space-y-4",children:t.map(n=>c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("div",{className:"w-32 text-sm text-dark-text",children:n.backend}),c.jsxs("div",{className:"flex-1 h-8 bg-dark-bg rounded-full overflow-hidden relative",children:[c.jsx("div",{className:"h-full transition-all",style:{width:`${n.successRate/r*100}%`,backgroundColor:n.successRate>70?"#10b981":n.successRate>40?"#f59e0b":"#ef4444"}}),c.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-dark-text",children:[n.successRate.toFixed(1),"% (",n.totalRuns," runs)"]})]})]},n.backend))})}function zm({value:e,label:t,max:r=100}){const n=Math.min(e/r*100,100),i=2*Math.PI*90,a=i,o=i-n/100*i,s=()=>n>=70?"#10b981":n>=40?"#f59e0b":"#ef4444";return c.jsx("div",{className:"flex flex-col items-center justify-center",children:c.jsxs("div",{className:"relative",children:[c.jsxs("svg",{width:"200",height:"200",className:"transform -rotate-90",children:[c.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:"#334155",strokeWidth:"12"}),c.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:s(),strokeWidth:"12",strokeDasharray:a,strokeDashoffset:o,strokeLinecap:"round",className:"transition-all duration-500"})]}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c.jsx("div",{className:"text-4xl font-bold text-white",children:e.toFixed(1)}),c.jsx("div",{className:"text-sm text-dark-text-muted",children:t})]})]})})}function cle(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function fle({runs:e,baseFilters:t}){const r=mt(),n=k.useMemo(()=>{const o=new Map;e.forEach(u=>{if(!u.created_at)return;const f=Yn(PT(uh(u.created_at)),"yyyy-MM-dd"),d=u.provider;o.has(f)||o.set(f,new Map);const h=o.get(f);h.has(d)||h.set(d,{total:0,count:0});const p=h.get(d);p.count+=1});const s=Array.from(o.keys()).sort(),l=Array.from(new Set(e.map(u=>u.provider))).filter(Boolean);return s.map(u=>{const f={dateLabel:Yn(uh(u),"MMM dd"),dateIso:u},d=o.get(u);return l.forEach(h=>{const p=d==null?void 0:d.get(h);p&&p.count>0&&(f[h]=p.count)}),f})},[e]);if(n.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const i=Array.from(new Set(e.map(o=>o.provider))).filter(Boolean),a=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#14b8a6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(_p,{data:n,onClick:o=>{var f,d,h;const s=o==null?void 0:o.activePayload;if(!s||s.length===0)return;const l=(f=s[0])==null?void 0:f.dataKey,u=(h=(d=s[0])==null?void 0:d.payload)==null?void 0:h.dateIso;!l||!u||r(`/runs-filtered${cle(t,{provider:String(l),startDate:`${u}T00:00:00Z`,endDate:`${u}T23:59:59Z`})}`)},children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"dateLabel",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Runs per Day",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"}}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),i.map((o,s)=>c.jsx(Ji,{type:"monotone",dataKey:o,stroke:a[s%a.length],strokeWidth:2,dot:{r:4},activeDot:{r:6},style:{cursor:"pointer"}},o))]})})}function dle(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function hle({runs:e,baseFilters:t}){const r=mt(),n=e.slice(0,50),i=Qe({queryKey:["run-details-analytics",n.map(o=>o.run_id)],queryFn:async()=>(await Promise.all(n.map(async s=>{try{const l=await Ye.getRun(s.project,s.run_id);return{run_id:s.run_id,created_at:s.created_at,runtime_ms:l.event.execution.runtime_ms||0,provider:s.provider}}catch{return null}}))).filter(Boolean),enabled:n.length>0}),a=k.useMemo(()=>{if(!i.data)return[];const o=new Map;return i.data.forEach(s=>{if(!s)return;const l=Yn(PT(uh(s.created_at)),"yyyy-MM-dd");o.has(l)||o.set(l,{total:0,count:0});const u=o.get(l);u.total+=s.runtime_ms||0,u.count+=1}),Array.from(o.entries()).map(([s,l])=>({dateLabel:Yn(uh(s),"MMM dd"),dateIso:s,avgRuntime:l.count>0?l.total/l.count:0})).sort((s,l)=>s.dateIso.localeCompare(l.dateIso))},[i.data]);return i.isLoading?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading runtime data..."}):a.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No runtime data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(OT,{data:a,onClick:o=>{var u,f;const s=o==null?void 0:o.activePayload;if(!s||s.length===0)return;const l=(f=(u=s[0])==null?void 0:u.payload)==null?void 0:f.dateIso;l&&r(`/runs-filtered${dle(t,{startDate:`${l}T00:00:00Z`,endDate:`${l}T23:59:59Z`})}`)},children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:"colorRuntime",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#3b82f6",stopOpacity:.8}),c.jsx("stop",{offset:"95%",stopColor:"#3b82f6",stopOpacity:.1})]})}),c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"dateLabel",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Avg Runtime (ms)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},formatter:o=>[`${o.toFixed(0)} ms`,"Average Runtime"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(wn,{type:"monotone",dataKey:"avgRuntime",stroke:"#3b82f6",strokeWidth:2,fillOpacity:1,fill:"url(#colorRuntime)",style:{cursor:"pointer"}})]})})}function nP(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function ple({runs:e,baseFilters:t}){const r=mt(),{chartData:n,backends:i}=k.useMemo(()=>{const o=new Map;e.forEach(p=>{const v=p.backend_name;o.has(v)||o.set(v,{total:0,success:0,totalShots:0});const m=o.get(v);m.total+=1,p.status==="success"&&(m.success+=1),m.totalShots+=p.shots||0});const s=Array.from(o.entries()).sort((p,v)=>v[1].total-p[1].total).slice(0,5),l=Math.max(...s.map(([p,v])=>v.total),1),u=Math.max(...s.map(([p,v])=>v.totalShots/v.total),1),f=s.map(([p,v])=>({backend:p.length>15?p.substring(0,15)+"...":p,"Success Rate":v.total>0?v.success/v.total*100:0,"Total Runs":v.total/l*100,"Avg Shots":v.total>0?Math.min(v.totalShots/v.total/u*100,100):0}));return{chartData:["Success Rate","Total Runs","Avg Shots"].map(p=>{const v={metric:p};return f.forEach(m=>{v[m.backend]=m[p]}),v}),backends:f.map(p=>p.backend)}},[e]);if(n.length===0||i.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const a=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Soe,{data:n,children:[c.jsx(p2,{stroke:"#334155"}),c.jsx(Js,{dataKey:"metric",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(Zs,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"}}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0",cursor:"pointer"},onClick:()=>r(`/runs-filtered${nP(t,{type:"backends"})}`)}),i.map((o,s)=>c.jsx(jc,{name:o,dataKey:o,stroke:a[s%a.length],fill:a[s%a.length],fillOpacity:.3,style:{cursor:"pointer"},onClick:()=>r(`/runs-filtered${nP(t,{type:"backends"})}`)},o))]})})}function mle({runs:e}){const t=k.useMemo(()=>{const n={"0-100":0,"101-1K":0,"1K-10K":0,"10K-100K":0,"100K+":0};return e.forEach(i=>{const a=i.shots||0;a<=100?n["0-100"]++:a<=1e3?n["101-1K"]++:a<=1e4?n["1K-10K"]++:a<=1e5?n["10K-100K"]++:n["100K+"]++}),Object.entries(n).filter(([i,a])=>a>0).map(([i,a])=>({name:i,value:a}))},[e]);if(t.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const r=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Ql,{children:[c.jsx(yr,{data:t,cx:"50%",cy:"50%",labelLine:!1,label:({name:n,percent:i})=>`${n}: ${(i*100).toFixed(0)}%`,outerRadius:120,fill:"#8884d8",dataKey:"value",children:t.map((n,i)=>c.jsx(vr,{fill:r[i%r.length]},`cell-${i}`))}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},formatter:n=>[n,"Runs"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}})]})})}function Um(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function vle({filters:e}){const t=mt(),{data:r=[],isLoading:n}=Qe({queryKey:["runs",e],queryFn:()=>Ye.getRuns({limit:1e3,...e||{}}),staleTime:5e3});if(n)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});const i=s=>{s==="success"?t(`/runs-filtered${Um(e,{type:"success"})}`):s==="backends"?t(`/runs-filtered${Um(e,{type:"backends"})}`):s==="runs"&&t(`/runs-filtered${Um(e)}`)},a=r.length>0?r.filter(s=>s.status==="success").length/r.length*100:0,o=new Set(r.map(s=>s.backend_name)).size;return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Run Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Comprehensive analysis and trends of quantum run performance"})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("success"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Overall Success Rate"}),c.jsx(zm,{value:a,label:"Success Rate"}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view successful runs"})]}),c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("backends"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Active Backends"}),c.jsx(zm,{value:o,label:"Backends",max:Math.max(o,10)}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view backend statistics"})]}),c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("runs"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Total Runs"}),c.jsx(zm,{value:r.length,label:"Runs",max:Math.max(r.length,1e3)}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view all runs"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Provider Performance Over Time"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Track run volume across different providers over time"}),c.jsx(fle,{runs:r,baseFilters:e})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Average Runtime Trend"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Monitor average execution time trends over time"}),c.jsx(hle,{runs:r,baseFilters:e})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Backend Multi-Dimensional Analysis"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Compare backends across multiple performance dimensions"}),c.jsx(ple,{runs:r,baseFilters:e})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Circuit Depth vs Success"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Relationship between circuit complexity and success rate"}),c.jsx(sle,{runs:r})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Cost vs Quality Trade-off"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Analyze the balance between execution cost and result quality"}),c.jsx(lle,{runs:r})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shots Distribution"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Distribution of runs by shots range"}),c.jsx(mle,{runs:r})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Backend Performance Heatmap"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Heatmap showing backend performance patterns"}),c.jsx(ule,{runs:r})]})]})]})}function yle({filters:e}){const t=mt(),[r,n]=k.useState(""),{data:i=[],isLoading:a}=Qe({queryKey:["algorithms"],queryFn:()=>Ye.getAlgorithms()});k.useEffect(()=>{i.length>0&&!r&&n(i[0].name)},[i,r]);const{data:o=[],isLoading:s}=Qe({queryKey:["runs",e,r],queryFn:()=>Ye.getRuns({limit:1e3,...e||{},algorithm:r||void 0}),enabled:!!r}),{data:l=[]}=Qe({queryKey:["runs",e],queryFn:()=>Ye.getRuns({limit:1e3,...e||{}})}),u=o,f=k.useMemo(()=>u.map(x=>x.run_id),[u]),{data:d}=Qe({queryKey:["run-events",f],queryFn:async()=>{const x=new Map,S=u.slice(0,100);return await Promise.all(S.map(async w=>{try{const j=await Ye.getRun(w.project,w.run_id);x.set(w.run_id,j.event)}catch(j){console.error(`Error loading event for ${w.run_id}:`,j)}})),x},enabled:u.length>0&&u.length<=100}),h=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{var O,P,A,E;let w=S.provider;if(d){const N=d.get(S.run_id);(P=(O=N==null?void 0:N.software)==null?void 0:O.sdk)!=null&&P.name?w=N.software.sdk.name:(A=N==null?void 0:N.tags)!=null&&A.sdk&&(w=N.tags.sdk)}x.has(w)||x.set(w,{success:0,total:0,totalRuntime:0,totalShots:0});const j=x.get(w);if(j.total++,S.status==="success"&&j.success++,j.totalShots+=S.shots,d){const N=d.get(S.run_id);(E=N==null?void 0:N.execution)!=null&&E.runtime_ms&&(j.totalRuntime+=N.execution.runtime_ms)}}),Array.from(x.entries()).map(([S,w])=>({sdk:S,successRate:w.total>0?w.success/w.total*100:0,avgShots:w.total>0?w.totalShots/w.total:0,avgRuntime:w.total>0&&w.totalRuntime>0?w.totalRuntime/w.total:0,totalRuns:w.total})).sort((S,w)=>w.totalRuns-S.totalRuns)},[u,d]),p=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{const w=new Date(S.created_at).toISOString().split("T")[0];x.has(w)||x.set(w,{success:0,total:0});const j=x.get(w);j.total++,S.status==="success"&&j.success++}),Array.from(x.entries()).map(([S,w])=>({date:S,successRate:w.total>0?w.success/w.total*100:0,totalRuns:w.total})).sort((S,w)=>S.date.localeCompare(w.date)).slice(-30)},[u]),v=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{const w=`${S.provider}/${S.backend_name}`;x.has(w)||x.set(w,{success:0,total:0});const j=x.get(w);j.total++,S.status==="success"&&j.success++}),Array.from(x.entries()).map(([S,w])=>({backend:S,successRate:w.total>0?w.success/w.total*100:0,totalRuns:w.total})).sort((S,w)=>w.totalRuns-S.totalRuns).slice(0,10)},[u]),m=k.useMemo(()=>{if(!d||u.length===0)return null;const x={vqe:{energies:[]},grover:{targetSuccessRates:[]},optimization:{approximationRatios:[]}};return u.slice(0,50).forEach(w=>{var A;const j=d.get(w.run_id);if(!((A=j==null?void 0:j.program)!=null&&A.benchmark_params))return;const O=j.program.benchmark_params,P=r.toLowerCase();P.includes("vqe")&&O.energy!==void 0&&x.vqe.energies.push(O.energy),P.includes("grover")&&O.expected_success_rate!==void 0&&x.grover.targetSuccessRates.push(O.expected_success_rate),(P.includes("optimization")||P.includes("qubo")||P.includes("ising"))&&O.approximation_ratio!==void 0&&x.optimization.approximationRatios.push(O.approximation_ratio)}),x.vqe.energies.length>0||x.grover.targetSuccessRates.length>0||x.optimization.approximationRatios.length>0?x:null},[u,d,r]),y=l.length>0?l.filter(x=>x.status==="success").length/l.length*100:0,b=u.length>0?u.filter(x=>x.status==="success").length/u.length*100:0,g=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#06b6d4"];return a?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading algorithms..."}):i.length===0?c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Algorithm Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:h-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Algorithm-specific performance analysis and benchmarking"})]}),c.jsxs("div",{className:"card text-center py-12",children:[c.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"No Algorithm-Tagged Runs Found"}),c.jsxs("p",{className:"text-dark-text-muted mb-4",children:["Tag your runs with an ",c.jsx("code",{className:"bg-dark-bg px-2 py-1 rounded text-primary",children:"algorithm"})," tag to see algorithm-specific metrics."]}),c.jsx("p",{className:"text-sm text-dark-text-muted",children:"Example:"}),c.jsx("pre",{className:"bg-dark-bg p-4 rounded-lg text-left text-sm text-dark-text overflow-x-auto mt-4",children:`@observe_run( + the props "valueKey" will be deprecated in 1.1.0`),b=d);var g=i.filter(function(P){return Ae(P,b,0)!==0}).length,x=(y>=360?g:g-1)*l,S=y-g*p-x,w=i.reduce(function(P,A){var E=Ae(A,b,0);return P+(H(E)?E:0)},0),j;if(w>0){var O;j=i.map(function(P,A){var E=Ae(P,b,0),N=Ae(P,f,A),T=(H(E)?E:0)/w,M;A?M=O.endAngle+Bt(m)*l*(E!==0?1:0):M=o;var R=M+Bt(m)*((E!==0?p:0)+T*S),D=(M+R)/2,L=(v.innerRadius+v.outerRadius)/2,U=[{name:N,value:E,payload:P,dataKey:b,type:h}],C=ge(v.cx,v.cy,L,D);return O=Ne(Ne(Ne({percent:T,cornerRadius:a,name:N,tooltipPayload:U,midAngle:D,middleRadius:L,tooltipPosition:C},P),v),{},{value:Ae(P,b),startAngle:M,endAngle:R,payload:P,paddingAngle:Bt(m)*l}),O})}return Ne(Ne({},v),{},{sectors:j,data:i})});function Jee(e){return e&&e.length?e[0]:void 0}var ete=Jee,tte=ete;const rte=Se(tte);var nte=["key"];function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}function ite(e,t){if(e==null)return{};var r=ate(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ate(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function zd(){return zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t=2&&(l=!0),u.push(Lt(Lt({},ge(o,s,g,y)),{},{name:v,value:m,cx:o,cy:s,radius:g,angle:y,payload:h}))});var d=[];return l&&u.forEach(function(h){if(Array.isArray(h.value)){var p=rte(h.value),v=re(p)?void 0:t.scale(p);d.push(Lt(Lt({},h),{},{radius:v},ge(o,s,v,h.angle)))}else d.push(h)}),{points:u,isRange:l,baseLinePoints:d}});var hte=Math.ceil,pte=Math.max;function mte(e,t,r,n){for(var i=-1,a=pte(hte((t-e)/(r||1)),0),o=Array(a);a--;)o[n?a:++i]=e,e+=r;return o}var vte=mte,yte=FE,cO=1/0,gte=17976931348623157e292;function xte(e){if(!e)return e===0?e:0;if(e=yte(e),e===cO||e===-cO){var t=e<0?-1:1;return t*gte}return e===e?e:0}var P2=xte,bte=vte,wte=np,Cm=P2;function Ste(e){return function(t,r,n){return n&&typeof n!="number"&&wte(t,r,n)&&(r=n=void 0),t=Cm(t),r===void 0?(r=t,t=0):r=Cm(r),n=n===void 0?t0&&n.handleDrag(i.changedTouches[0])}),ur(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,a=i.endIndex,o=i.onDragEnd,s=i.startIndex;o==null||o({endIndex:a,startIndex:s})}),n.detachDragEndListener()}),ur(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),ur(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),ur(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),ur(n,"handleSlideDragStart",function(i){var a=mO(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Dte(t,e),$te(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,a=n.endX,o=this.state.scaleValues,s=this.props,l=s.gap,u=s.data,f=u.length-1,d=Math.min(i,a),h=Math.max(i,a),p=t.getIndexInRange(o,d),v=t.getIndexInRange(o,h);return{startIndex:p-p%l,endIndex:v===f?f:v-v%l}}},{key:"getTextOfTick",value:function(n){var i=this.props,a=i.data,o=i.tickFormatter,s=i.dataKey,l=Ae(a[n],s,n);return te(o)?o(l,n):l}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,a=i.slideMoveStartX,o=i.startX,s=i.endX,l=this.props,u=l.x,f=l.width,d=l.travellerWidth,h=l.startIndex,p=l.endIndex,v=l.onChange,m=n.pageX-a;m>0?m=Math.min(m,u+f-d-s,u+f-d-o):m<0&&(m=Math.max(m,u-o,u-s));var y=this.getIndex({startX:o+m,endX:s+m});(y.startIndex!==h||y.endIndex!==p)&&v&&v(y),this.setState({startX:o+m,endX:s+m,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var a=mO(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,a=i.brushMoveStartX,o=i.movingTravellerId,s=i.endX,l=i.startX,u=this.state[o],f=this.props,d=f.x,h=f.width,p=f.travellerWidth,v=f.onChange,m=f.gap,y=f.data,b={startX:this.state.startX,endX:this.state.endX},g=n.pageX-a;g>0?g=Math.min(g,d+h-p-u):g<0&&(g=Math.max(g,d-u)),b[o]=u+g;var x=this.getIndex(b),S=x.startIndex,w=x.endIndex,j=function(){var P=y.length-1;return o==="startX"&&(s>l?S%m===0:w%m===0)||sl?w%m===0:S%m===0)||s>l&&w===P};this.setState(ur(ur({},o,u+g),"brushMoveStartX",n.pageX),function(){v&&j()&&v(x)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var a=this,o=this.state,s=o.scaleValues,l=o.startX,u=o.endX,f=this.state[i],d=s.indexOf(f);if(d!==-1){var h=d+n;if(!(h===-1||h>=s.length)){var p=s[h];i==="startX"&&p>=u||i==="endX"&&p<=l||this.setState(ur({},i,p),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.fill,u=n.stroke;return _.createElement("rect",{stroke:u,fill:l,x:i,y:a,width:o,height:s})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,a=n.y,o=n.width,s=n.height,l=n.data,u=n.children,f=n.padding,d=k.Children.only(u);return d?_.cloneElement(d,{x:i,y:a,width:o,height:s,margin:f,compact:!0,data:l}):null}},{key:"renderTravellerLayer",value:function(n,i){var a,o,s=this,l=this.props,u=l.y,f=l.travellerWidth,d=l.height,h=l.traveller,p=l.ariaLabel,v=l.data,m=l.startIndex,y=l.endIndex,b=Math.max(n,this.props.x),g=Mm(Mm({},X(this.props,!1)),{},{x:b,y:u,width:f,height:d}),x=p||"Min value: ".concat((a=v[m])===null||a===void 0?void 0:a.name,", Max value: ").concat((o=v[y])===null||o===void 0?void 0:o.name);return _.createElement(se,{tabIndex:0,role:"slider","aria-label":x,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(w){["ArrowLeft","ArrowRight"].includes(w.key)&&(w.preventDefault(),w.stopPropagation(),s.handleTravellerMoveKeyboard(w.key==="ArrowRight"?1:-1,i))},onFocus:function(){s.setState({isTravellerFocused:!0})},onBlur:function(){s.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,g))}},{key:"renderSlide",value:function(n,i){var a=this.props,o=a.y,s=a.height,l=a.stroke,u=a.travellerWidth,f=Math.min(n,i)+u,d=Math.max(Math.abs(i-n)-u,0);return _.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:l,fillOpacity:.2,x:f,y:o,width:d,height:s})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,a=n.endIndex,o=n.y,s=n.height,l=n.travellerWidth,u=n.stroke,f=this.state,d=f.startX,h=f.endX,p=5,v={pointerEvents:"none",fill:u};return _.createElement(se,{className:"recharts-brush-texts"},_.createElement(Wa,Wd({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,h)-p,y:o+s/2},v),this.getTextOfTick(i)),_.createElement(Wa,Wd({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,h)+l+p,y:o+s/2},v),this.getTextOfTick(a)))}},{key:"render",value:function(){var n=this.props,i=n.data,a=n.className,o=n.children,s=n.x,l=n.y,u=n.width,f=n.height,d=n.alwaysShowText,h=this.state,p=h.startX,v=h.endX,m=h.isTextActive,y=h.isSlideMoving,b=h.isTravellerMoving,g=h.isTravellerFocused;if(!i||!i.length||!H(s)||!H(l)||!H(u)||!H(f)||u<=0||f<=0)return null;var x=oe("recharts-brush",a),S=_.Children.count(o)===1,w=Nte("userSelect","none");return _.createElement(se,{className:x,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:w},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(p,v),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(v,"endX"),(m||y||b||g||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,a=n.y,o=n.width,s=n.height,l=n.stroke,u=Math.floor(a+s/2)-1;return _.createElement(_.Fragment,null,_.createElement("rect",{x:i,y:a,width:o,height:s,fill:l,stroke:"none"}),_.createElement("line",{x1:i+1,y1:u,x2:i+o-1,y2:u,fill:"none",stroke:"#fff"}),_.createElement("line",{x1:i+1,y1:u+2,x2:i+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var a;return _.isValidElement(n)?a=_.cloneElement(n,i):te(n)?a=n(i):a=t.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(n,i){var a=n.data,o=n.width,s=n.x,l=n.travellerWidth,u=n.updateId,f=n.startIndex,d=n.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return Mm({prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o},a&&a.length?Lte({data:a,width:o,x:s,travellerWidth:l,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(o!==i.prevWidth||s!==i.prevX||l!==i.prevTravellerWidth)){i.scale.range([s,s+o-l]);var h=i.scale.domain().map(function(p){return i.scale(p)});return{prevData:a,prevTravellerWidth:l,prevUpdateId:u,prevX:s,prevWidth:o,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(n,i){for(var a=n.length,o=0,s=a-1;s-o>1;){var l=Math.floor((o+s)/2);n[l]>i?s=l:o=l}return i>=n[s]?s:o}}])}(k.PureComponent);ur(ys,"displayName","Brush");ur(ys,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var Fte=mb;function Bte(e,t){var r;return Fte(e,function(n,i,a){return r=t(n,i,a),!r}),!!r}var zte=Bte,Ute=dE,qte=jn,Wte=zte,Hte=sr,Kte=np;function Vte(e,t,r){var n=Hte(e)?Ute:Wte;return r&&Kte(e,t,r)&&(t=void 0),n(e,qte(t))}var Gte=Vte;const Qte=Se(Gte);var gn=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},vO=ME;function Yte(e,t,r){t=="__proto__"&&vO?vO(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Xte=Yte,Zte=Xte,Jte=$E,ere=jn;function tre(e,t){var r={};return t=ere(t),Jte(e,function(n,i,a){Zte(r,i,t(n,i,a))}),r}var rre=tre;const nre=Se(rre);function ire(e,t){for(var r=-1,n=e==null?0:e.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Sre(e,t){var r=e.x,n=e.y,i=bre(e,vre),a="".concat(r),o=parseInt(a,10),s="".concat(n),l=parseInt(s,10),u="".concat(t.height||i.height),f=parseInt(u,10),d="".concat(t.width||i.width),h=parseInt(d,10);return wl(wl(wl(wl(wl({},t),i),o?{x:o}:{}),l?{y:l}:{}),{},{height:f,width:h,name:t.name,radius:t.radius})}function gO(e){return _.createElement(Fd,vg({shapeType:"rectangle",propTransformer:Sre,activeClassName:"recharts-active-bar"},e))}var jre=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var a=H(n)||SF(n);return a?t(n,i):(a||Ka(),r)}},Ore=["value","background"],N2;function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function Pre(e,t){if(e==null)return{};var r=_re(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _re(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(D)0&&Math.abs(R)0&&(M=Math.min((ce||0)-(R[V-1]||0),M))}),Number.isFinite(M)){var D=M/T,L=m.layout==="vertical"?n.height:n.width;if(m.padding==="gap"&&(O=D*L/2),m.padding==="no-gap"){var U=zt(t.barCategoryGap,D*L),C=D*L/2;O=C-U-(C-U)/L*U}}}i==="xAxis"?P=[n.left+(x.left||0)+(O||0),n.left+n.width-(x.right||0)-(O||0)]:i==="yAxis"?P=l==="horizontal"?[n.top+n.height-(x.bottom||0),n.top+(x.top||0)]:[n.top+(x.top||0)+(O||0),n.top+n.height-(x.bottom||0)-(O||0)]:P=m.range,w&&(P=[P[1],P[0]]);var F=HN(m,a,h),z=F.scale,G=F.realScaleType;z.domain(b).range(P),KN(z);var q=VN(z,Gr(Gr({},m),{},{realScaleType:G}));i==="xAxis"?(N=y==="top"&&!S||y==="bottom"&&S,A=n.left,E=d[j]-N*m.height):i==="yAxis"&&(N=y==="left"&&!S||y==="right"&&S,A=d[j]-N*m.width,E=n.top);var ee=Gr(Gr(Gr({},m),q),{},{realScaleType:G,x:A,y:E,scale:z,width:i==="xAxis"?n.width:m.width,height:i==="yAxis"?n.height:m.height});return ee.bandSize=kd(ee,q),!m.hide&&i==="xAxis"?d[j]+=(N?-1:1)*ee.height:m.hide||(d[j]+=(N?-1:1)*ee.width),Gr(Gr({},p),{},gp({},v,ee))},{})},M2=function(t,r){var n=t.x,i=t.y,a=r.x,o=r.y;return{x:Math.min(n,a),y:Math.min(i,o),width:Math.abs(a-n),height:Math.abs(o-i)}},Ire=function(t){var r=t.x1,n=t.y1,i=t.x2,a=t.y2;return M2({x:r,y:n},{x:i,y:a})},R2=function(){function e(t){Mre(this,e),this.scale=t}return Rre(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,a=n.position;if(r!==void 0){if(a)switch(a){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(r)+s}default:return this.scale(r)}if(i){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],a=n[n.length-1];return i<=a?r>=i&&r<=a:r>=a&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])}();gp(R2,"EPS",1e-4);var Wb=function(t){var r=Object.keys(t).reduce(function(n,i){return Gr(Gr({},n),{},gp({},i,R2.create(t[i])))},{});return Gr(Gr({},r),{},{apply:function(i){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=a.bandAware,s=a.position;return nre(i,function(l,u){return r[u].apply(l,{bandAware:o,position:s})})},isInRange:function(i){return E2(i,function(a,o){return r[o].isInRange(a)})}})};function Lre(e){return(e%180+180)%180}var Fre=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=Lre(i),o=a*Math.PI/180,s=Math.atan(n/r),l=o>s&&o-1?i[a?t[o]:o]:void 0}}var Wre=qre,Hre=P2;function Kre(e){var t=Hre(e),r=t%1;return t===t?r?t-r:t:0}var Vre=Kre,Gre=_E,Qre=jn,Yre=Vre,Xre=Math.max;function Zre(e,t,r){var n=e==null?0:e.length;if(!n)return-1;var i=r==null?0:Yre(r);return i<0&&(i=Xre(n+i,0)),Gre(e,Qre(t),i)}var Jre=Zre,ene=Wre,tne=Jre,rne=ene(tne),nne=rne;const ine=Se(nne);var ane=A4(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),Hb=k.createContext(void 0),Kb=k.createContext(void 0),D2=k.createContext(void 0),I2=k.createContext({}),L2=k.createContext(void 0),F2=k.createContext(0),B2=k.createContext(0),jO=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,a=r.offset,o=t.clipPathId,s=t.children,l=t.width,u=t.height,f=ane(a);return _.createElement(Hb.Provider,{value:n},_.createElement(Kb.Provider,{value:i},_.createElement(I2.Provider,{value:a},_.createElement(D2.Provider,{value:f},_.createElement(L2.Provider,{value:o},_.createElement(F2.Provider,{value:u},_.createElement(B2.Provider,{value:l},s)))))))},one=function(){return k.useContext(L2)},z2=function(t){var r=k.useContext(Hb);r==null&&Ka();var n=r[t];return n==null&&Ka(),n},sne=function(){var t=k.useContext(Hb);return di(t)},lne=function(){var t=k.useContext(Kb),r=ine(t,function(n){return E2(n.domain,Number.isFinite)});return r||di(t)},U2=function(t){var r=k.useContext(Kb);r==null&&Ka();var n=r[t];return n==null&&Ka(),n},une=function(){var t=k.useContext(D2);return t},cne=function(){return k.useContext(I2)},Vb=function(){return k.useContext(B2)},Gb=function(){return k.useContext(F2)};function xs(e){"@babel/helpers - typeof";return xs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xs(e)}function fne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function dne(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var a=r();return e*(t-e*a/2-n)>=0&&e*(t+e*a/2-i)<=0}function Vne(e,t){return Q2(e,t+1)}function Gne(e,t,r,n,i){for(var a=(n||[]).slice(),o=t.start,s=t.end,l=0,u=1,f=o,d=function(){var v=n==null?void 0:n[l];if(v===void 0)return{v:Q2(n,u)};var m=l,y,b=function(){return y===void 0&&(y=r(v,m)),y},g=v.coordinate,x=l===0||Xd(e,g,b,f,s);x||(l=0,f=o,u+=1),x&&(f=g+e*(b()/2+i),l+=u)},h;u<=a.length;)if(h=d(),h)return h.v;return[]}function Xu(e){"@babel/helpers - typeof";return Xu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xu(e)}function TO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t0?p.coordinate-y*e:p.coordinate})}else a[h]=p=Tt(Tt({},p),{},{tickCoord:p.coordinate});var b=Xd(e,p.tickCoord,m,s,l);b&&(l=p.tickCoord-e*(m()/2+i),a[h]=Tt(Tt({},p),{},{isShow:!0}))},f=o-1;f>=0;f--)u(f);return a}function Jne(e,t,r,n,i,a){var o=(n||[]).slice(),s=o.length,l=t.start,u=t.end;if(a){var f=n[s-1],d=r(f,s-1),h=e*(f.coordinate+e*d/2-u);o[s-1]=f=Tt(Tt({},f),{},{tickCoord:h>0?f.coordinate-h*e:f.coordinate});var p=Xd(e,f.tickCoord,function(){return d},l,u);p&&(u=f.tickCoord-e*(d/2+i),o[s-1]=Tt(Tt({},f),{},{isShow:!0}))}for(var v=a?s-1:s,m=function(g){var x=o[g],S,w=function(){return S===void 0&&(S=r(x,g)),S};if(g===0){var j=e*(x.coordinate-e*w()/2-l);o[g]=x=Tt(Tt({},x),{},{tickCoord:j<0?x.coordinate-j*e:x.coordinate})}else o[g]=x=Tt(Tt({},x),{},{tickCoord:x.coordinate});var O=Xd(e,x.tickCoord,w,l,u);O&&(l=x.tickCoord+e*(w()/2+i),o[g]=Tt(Tt({},x),{},{isShow:!0}))},y=0;y=2?Bt(i[1].coordinate-i[0].coordinate):1,b=Kne(a,y,p);return l==="equidistantPreserveStart"?Gne(y,b,m,i,o):(l==="preserveStart"||l==="preserveStartEnd"?h=Jne(y,b,m,i,o,l==="preserveStartEnd"):h=Zne(y,b,m,i,o),h.filter(function(g){return g.isShow}))}var eie=["viewBox"],tie=["viewBox"],rie=["ticks"];function Ss(e){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(e)}function Oo(){return Oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function nie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function iie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CO(e,t){for(var r=0;r0?l(this.props):l(p)),o<=0||s<=0||!v||!v.length?null:_.createElement(se,{className:oe("recharts-cartesian-axis",u),ref:function(y){n.layerReference=y}},a&&this.renderAxisLine(),this.renderTicks(v,this.state.fontSize,this.state.letterSpacing),bt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,a){var o,s=oe(i.className,"recharts-cartesian-axis-tick-value");return _.isValidElement(n)?o=_.cloneElement(n,ut(ut({},i),{},{className:s})):te(n)?o=n(ut(ut({},i),{},{className:s})):o=_.createElement(Wa,Oo({},i,{className:"recharts-cartesian-axis-tick-value"}),a),o}}])}(k.Component);Zb(el,"displayName","CartesianAxis");Zb(el,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var fie=["x1","y1","x2","y2","key"],die=["offset"];function Va(e){"@babel/helpers - typeof";return Va=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Va(e)}function MO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ct(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var yie=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,a=t.y,o=t.width,s=t.height,l=t.ry;return _.createElement("rect",{x:i,y:a,ry:l,width:o,height:s,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function Z2(e,t){var r;if(_.isValidElement(e))r=_.cloneElement(e,t);else if(te(e))r=e(t);else{var n=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,l=RO(t,fie),u=X(l,!1);u.offset;var f=RO(u,die);r=_.createElement("line",ba({},f,{x1:n,y1:i,x2:a,y2:o,fill:"none",key:s}))}return r}function gie(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var u=Ct(Ct({},e),{},{x1:t,y1:s,x2:t+r,y2:s,key:"line-".concat(l),index:l});return Z2(i,u)});return _.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function xie(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(s,l){var u=Ct(Ct({},e),{},{x1:s,y1:t,x2:s,y2:t+r,key:"line-".concat(l),index:l});return Z2(i,u)});return _.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function bie(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,l=e.horizontal,u=l===void 0?!0:l;if(!u||!t||!t.length)return null;var f=s.map(function(h){return Math.round(h+i-i)}).sort(function(h,p){return h-p});i!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var v=!f[p+1],m=v?i+o-h:f[p+1]-h;if(m<=0)return null;var y=p%t.length;return _.createElement("rect",{key:"react-".concat(p),y:h,x:n,height:m,width:a,stroke:"none",fill:t[y],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return _.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function wie(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,l=e.height,u=e.verticalPoints;if(!r||!n||!n.length)return null;var f=u.map(function(h){return Math.round(h+a-a)}).sort(function(h,p){return h-p});a!==f[0]&&f.unshift(0);var d=f.map(function(h,p){var v=!f[p+1],m=v?a+s-h:f[p+1]-h;if(m<=0)return null;var y=p%n.length;return _.createElement("rect",{key:"react-".concat(p),x:h,y:o,width:m,height:l,stroke:"none",fill:n[y],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return _.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},d)}var Sie=function(t,r){var n=t.xAxis,i=t.width,a=t.height,o=t.offset;return WN(Xb(Ct(Ct(Ct({},el.defaultProps),n),{},{ticks:In(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.left,o.left+o.width,r)},jie=function(t,r){var n=t.yAxis,i=t.width,a=t.height,o=t.offset;return WN(Xb(Ct(Ct(Ct({},el.defaultProps),n),{},{ticks:In(n,!0),viewBox:{x:0,y:0,width:i,height:a}})),o.top,o.top+o.height,r)},ao={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Ht(e){var t,r,n,i,a,o,s=Vb(),l=Gb(),u=cne(),f=Ct(Ct({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:ao.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:ao.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:ao.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:ao.horizontalFill,vertical:(a=e.vertical)!==null&&a!==void 0?a:ao.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:ao.verticalFill,x:H(e.x)?e.x:u.left,y:H(e.y)?e.y:u.top,width:H(e.width)?e.width:u.width,height:H(e.height)?e.height:u.height}),d=f.x,h=f.y,p=f.width,v=f.height,m=f.syncWithTicks,y=f.horizontalValues,b=f.verticalValues,g=sne(),x=lne();if(!H(p)||p<=0||!H(v)||v<=0||!H(d)||d!==+d||!H(h)||h!==+h)return null;var S=f.verticalCoordinatesGenerator||Sie,w=f.horizontalCoordinatesGenerator||jie,j=f.horizontalPoints,O=f.verticalPoints;if((!j||!j.length)&&te(w)){var P=y&&y.length,A=w({yAxis:x?Ct(Ct({},x),{},{ticks:P?y:x.ticks}):void 0,width:s,height:l,offset:u},P?!0:m);en(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Va(A),"]")),Array.isArray(A)&&(j=A)}if((!O||!O.length)&&te(S)){var E=b&&b.length,N=S({xAxis:g?Ct(Ct({},g),{},{ticks:E?b:g.ticks}):void 0,width:s,height:l,offset:u},E?!0:m);en(Array.isArray(N),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Va(N),"]")),Array.isArray(N)&&(O=N)}return _.createElement("g",{className:"recharts-cartesian-grid"},_.createElement(yie,{fill:f.fill,fillOpacity:f.fillOpacity,x:f.x,y:f.y,width:f.width,height:f.height,ry:f.ry}),_.createElement(gie,ba({},f,{offset:u,horizontalPoints:j,xAxis:g,yAxis:x})),_.createElement(xie,ba({},f,{offset:u,verticalPoints:O,xAxis:g,yAxis:x})),_.createElement(bie,ba({},f,{horizontalPoints:j})),_.createElement(wie,ba({},f,{verticalPoints:O})))}Ht.displayName="CartesianGrid";var Oie=["type","layout","connectNulls","ref"],Pie=["key"];function js(e){"@babel/helpers - typeof";return js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},js(e)}function DO(e,t){if(e==null)return{};var r=_ie(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _ie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Kl(){return Kl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rd){p=[].concat(oo(l.slice(0,v)),[d-m]);break}var y=p.length%2===0?[0,h]:[h];return[].concat(oo(t.repeat(l,f)),oo(p),y).map(function(b){return"".concat(b,"px")}).join(", ")}),Qr(r,"id",Qi("recharts-line-")),Qr(r,"pathRef",function(o){r.mainCurve=o}),Qr(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Qr(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return Die(t,e),$ie(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.points,s=a.xAxis,l=a.yAxis,u=a.layout,f=a.children,d=Wt(f,Ys);if(!d)return null;var h=function(m,y){return{x:m.x,y:m.y,value:m.value,errorVal:Ae(m.payload,y)}},p={clipPath:n?"url(#clipPath-".concat(i,")"):null};return _.createElement(se,p,d.map(function(v){return _.cloneElement(v,{key:"bar-".concat(v.props.dataKey),data:o,xAxis:s,yAxis:l,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(n,i,a){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var s=this.props,l=s.dot,u=s.points,f=s.dataKey,d=X(this.props,!1),h=X(l,!0),p=u.map(function(m,y){var b=lr(lr(lr({key:"dot-".concat(y),r:3},d),h),{},{index:y,cx:m.x,cy:m.y,value:m.value,dataKey:f,payload:m.payload,points:u});return t.renderDotItem(l,b)}),v={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return _.createElement(se,Kl({className:"recharts-line-dots",key:"dots"},v),p)}},{key:"renderCurveStatically",value:function(n,i,a,o){var s=this.props,l=s.type,u=s.layout,f=s.connectNulls;s.ref;var d=DO(s,Oie),h=lr(lr(lr({},X(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:n},o),{},{type:l,layout:u,connectNulls:f});return _.createElement(Li,Kl({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var a=this,o=this.props,s=o.points,l=o.strokeDasharray,u=o.isAnimationActive,f=o.animationBegin,d=o.animationDuration,h=o.animationEasing,p=o.animationId,v=o.animateNewValues,m=o.width,y=o.height,b=this.state,g=b.prevPoints,x=b.totalLength;return _.createElement(xr,{begin:f,duration:d,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var w=S.t;if(g){var j=g.length/s.length,O=s.map(function(T,M){var R=Math.floor(M*j);if(g[R]){var D=g[R],L=ke(D.x,T.x),U=ke(D.y,T.y);return lr(lr({},T),{},{x:L(w),y:U(w)})}if(v){var C=ke(m*2,T.x),F=ke(y/2,T.y);return lr(lr({},T),{},{x:C(w),y:F(w)})}return lr(lr({},T),{},{x:T.x,y:T.y})});return a.renderCurveStatically(O,n,i)}var P=ke(0,x),A=P(w),E;if(l){var N="".concat(l).split(/[,\s]+/gim).map(function(T){return parseFloat(T)});E=a.getStrokeDasharray(A,x,N)}else E=a.generateSimpleStrokeDasharray(x,A);return a.renderCurveStatically(s,n,i,{strokeDasharray:E})})}},{key:"renderCurve",value:function(n,i){var a=this.props,o=a.points,s=a.isAnimationActive,l=this.state,u=l.prevPoints,f=l.totalLength;return s&&o&&o.length&&(!u&&f>0||!Gn(u,o))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(o,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.xAxis,f=i.yAxis,d=i.top,h=i.left,p=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,g=s.length===1,x=oe("recharts-line",l),S=u&&u.allowDataOverflow,w=f&&f.allowDataOverflow,j=S||w,O=re(y)?this.id:y,P=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=P.r,E=A===void 0?3:A,N=P.strokeWidth,T=N===void 0?2:N,M=IA(o)?o:{},R=M.clipDot,D=R===void 0?!0:R,L=E*2+T;return _.createElement(se,{className:x},S||w?_.createElement("defs",null,_.createElement("clipPath",{id:"clipPath-".concat(O)},_.createElement("rect",{x:S?h:h-p/2,y:w?d:d-v/2,width:S?p:p*2,height:w?v:v*2})),!D&&_.createElement("clipPath",{id:"clipPath-dots-".concat(O)},_.createElement("rect",{x:h-L/2,y:d-L/2,width:p+L,height:v+L}))):null,!g&&this.renderCurve(j,O),this.renderErrorBar(j,O),(g||o)&&this.renderDots(j,D,O),(!m||b)&&Mr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var a=n.length%2!==0?[].concat(oo(n),[0]):n,o=[],s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bie(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wa(){return wa=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!Gn(f,o)||!Gn(d,s))?this.renderAreaWithAnimation(n,i):this.renderAreaStatically(o,s,n,i)}},{key:"render",value:function(){var n,i=this.props,a=i.hide,o=i.dot,s=i.points,l=i.className,u=i.top,f=i.left,d=i.xAxis,h=i.yAxis,p=i.width,v=i.height,m=i.isAnimationActive,y=i.id;if(a||!s||!s.length)return null;var b=this.state.isAnimationFinished,g=s.length===1,x=oe("recharts-area",l),S=d&&d.allowDataOverflow,w=h&&h.allowDataOverflow,j=S||w,O=re(y)?this.id:y,P=(n=X(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},A=P.r,E=A===void 0?3:A,N=P.strokeWidth,T=N===void 0?2:N,M=IA(o)?o:{},R=M.clipDot,D=R===void 0?!0:R,L=E*2+T;return _.createElement(se,{className:x},S||w?_.createElement("defs",null,_.createElement("clipPath",{id:"clipPath-".concat(O)},_.createElement("rect",{x:S?f:f-p/2,y:w?u:u-v/2,width:S?p:p*2,height:w?v:v*2})),!D&&_.createElement("clipPath",{id:"clipPath-dots-".concat(O)},_.createElement("rect",{x:f-L/2,y:u-L/2,width:p+L,height:v+L}))):null,g?null:this.renderArea(j,O),(o||g)&&this.renderDots(j,D,O),(!m||b)&&Mr.renderCallByParent(this.props,s))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:i.curPoints,prevBaseLine:i.curBaseLine}:n.points!==i.curPoints||n.baseLine!==i.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(k.PureComponent);tT=wn;pn(wn,"displayName","Area");pn(wn,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!On.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});pn(wn,"getBaseValue",function(e,t,r,n){var i=e.layout,a=e.baseValue,o=t.props.baseValue,s=o??a;if(H(s)&&typeof s=="number")return s;var l=i==="horizontal"?n:r,u=l.scale.domain();if(l.type==="number"){var f=Math.max(u[0],u[1]),d=Math.min(u[0],u[1]);return s==="dataMin"?d:s==="dataMax"||f<0?f:Math.max(Math.min(u[0],u[1]),0)}return s==="dataMin"?u[0]:s==="dataMax"?u[1]:u[0]});pn(wn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,l=e.dataKey,u=e.stackedData,f=e.dataStartIndex,d=e.displayedData,h=e.offset,p=t.layout,v=u&&u.length,m=tT.getBaseValue(t,r,n,i),y=p==="horizontal",b=!1,g=d.map(function(S,w){var j;v?j=u[f+w]:(j=Ae(S,l),Array.isArray(j)?b=!0:j=[m,j]);var O=j[1]==null||v&&Ae(S,l)==null;return y?{x:cs({axis:n,ticks:a,bandSize:s,entry:S,index:w}),y:O?null:i.scale(j[1]),value:j,payload:S}:{x:O?null:n.scale(j[1]),y:cs({axis:i,ticks:o,bandSize:s,entry:S,index:w}),value:j,payload:S}}),x;return v||b?x=g.map(function(S){var w=Array.isArray(S.value)?S.value[0]:null;return y?{x:S.x,y:w!=null&&S.y!=null?i.scale(w):null}:{x:w!=null?n.scale(w):null,y:S.y}}):x=y?i.scale(m):n.scale(m),oi({points:g,baseLine:x,layout:p,isRange:b},h)});pn(wn,"renderDotItem",function(e,t){var r;if(_.isValidElement(e))r=_.cloneElement(e,t);else if(te(e))r=e(t);else{var n=oe("recharts-area-dot",typeof e!="boolean"?e.className:""),i=t.key,a=rT(t,Fie);r=_.createElement(Xs,wa({},a,{key:i,className:n}))}return r});function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function Gie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qie(e,t){for(var r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iae(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function aae(e){var t=e.option,r=e.isActive,n=nae(e,rae);return typeof t=="string"?k.createElement(Fd,Vl({option:k.createElement(ep,Vl({type:t},n)),isActive:r,shapeType:"symbols"},n)):k.createElement(Fd,Vl({option:t,isActive:r,shapeType:"symbols"},n))}function _s(e){"@babel/helpers - typeof";return _s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(e)}function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eoe(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function toe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function roe(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?o:t&&t.length&&H(i)&&H(a)?t.slice(i,a+1):[]};function jT(e){return e==="number"?[0,"auto"]:void 0}var Lg=function(t,r,n,i){var a=t.graphicalItems,o=t.tooltipAxis,s=Pp(r,t);return n<0||!a||!a.length||n>=s.length?null:a.reduce(function(l,u){var f,d=(f=u.props.data)!==null&&f!==void 0?f:r;d&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var p=d===void 0?s:d;h=Zf(p,o.dataKey,i)}else h=d&&d[n]||s[n];return h?[].concat(Ns(l),[QN(u,h)]):l},[])},GO=function(t,r,n,i){var a=i||{x:t.chartX,y:t.chartY},o=poe(a,n),s=t.orderedTooltipTicks,l=t.tooltipAxis,u=t.tooltipTicks,f=RQ(o,s,u,l);if(f>=0&&u){var d=u[f]&&u[f].value,h=Lg(t,r,f,d),p=moe(n,s,f,a);return{activeTooltipIndex:f,activeLabel:d,activePayload:h,activeCoordinate:p}}return null},voe=function(t,r){var n=r.axes,i=r.graphicalItems,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=t.stackOffset,p=qN(f,a);return n.reduce(function(v,m){var y,b=m.type.defaultProps!==void 0?B(B({},m.type.defaultProps),m.props):m.props,g=b.type,x=b.dataKey,S=b.allowDataOverflow,w=b.allowDuplicatedCategory,j=b.scale,O=b.ticks,P=b.includeHidden,A=b[o];if(v[A])return v;var E=Pp(t.data,{graphicalItems:i.filter(function(q){var ee,ce=o in q.props?q.props[o]:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee[o];return ce===A}),dataStartIndex:l,dataEndIndex:u}),N=E.length,T,M,R;Uae(b.domain,S,g)&&(T=Gy(b.domain,null,S),p&&(g==="number"||j!=="auto")&&(R=Ul(E,x,"category")));var D=jT(g);if(!T||T.length===0){var L,U=(L=b.domain)!==null&&L!==void 0?L:D;if(x){if(T=Ul(E,x,g),g==="category"&&p){var C=OF(T);w&&C?(M=T,T=qd(0,N)):w||(T=dj(U,T,m).reduce(function(q,ee){return q.indexOf(ee)>=0?q:[].concat(Ns(q),[ee])},[]))}else if(g==="category")w?T=T.filter(function(q){return q!==""&&!re(q)}):T=dj(U,T,m).reduce(function(q,ee){return q.indexOf(ee)>=0||ee===""||re(ee)?q:[].concat(Ns(q),[ee])},[]);else if(g==="number"){var F=BQ(E,i.filter(function(q){var ee,ce,V=o in q.props?q.props[o]:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee[o],ie="hide"in q.props?q.props.hide:(ce=q.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return V===A&&(P||!ie)}),x,a,f);F&&(T=F)}p&&(g==="number"||j!=="auto")&&(R=Ul(E,x,"category"))}else p?T=qd(0,N):s&&s[A]&&s[A].hasStack&&g==="number"?T=h==="expand"?[0,1]:GN(s[A].stackGroups,l,u):T=UN(E,i.filter(function(q){var ee=o in q.props?q.props[o]:q.type.defaultProps[o],ce="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return ee===A&&(P||!ce)}),g,f,!0);if(g==="number")T=Rg(d,T,A,a,O),U&&(T=Gy(U,T,S));else if(g==="category"&&U){var z=U,G=T.every(function(q){return z.indexOf(q)>=0});G&&(T=z)}}return B(B({},v),{},ae({},A,B(B({},b),{},{axisType:a,domain:T,categoricalDomain:R,duplicateDomain:M,originalDomain:(y=b.domain)!==null&&y!==void 0?y:D,isCategorical:p,layout:f})))},{})},yoe=function(t,r){var n=r.graphicalItems,i=r.Axis,a=r.axisType,o=r.axisIdKey,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.layout,d=t.children,h=Pp(t.data,{graphicalItems:n,dataStartIndex:l,dataEndIndex:u}),p=h.length,v=qN(f,a),m=-1;return n.reduce(function(y,b){var g=b.type.defaultProps!==void 0?B(B({},b.type.defaultProps),b.props):b.props,x=g[o],S=jT("number");if(!y[x]){m++;var w;return v?w=qd(0,p):s&&s[x]&&s[x].hasStack?(w=GN(s[x].stackGroups,l,u),w=Rg(d,w,x,a)):(w=Gy(S,UN(h,n.filter(function(j){var O,P,A=o in j.props?j.props[o]:(O=j.type.defaultProps)===null||O===void 0?void 0:O[o],E="hide"in j.props?j.props.hide:(P=j.type.defaultProps)===null||P===void 0?void 0:P.hide;return A===x&&!E}),"number",f),i.defaultProps.allowDataOverflow),w=Rg(d,w,x,a)),B(B({},y),{},ae({},x,B(B({axisType:a},i.defaultProps),{},{hide:!0,orientation:mr(doe,"".concat(a,".").concat(m%2),null),domain:w,originalDomain:S,isCategorical:v,layout:f})))}return y},{})},goe=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,a=r.AxisComp,o=r.graphicalItems,s=r.stackGroups,l=r.dataStartIndex,u=r.dataEndIndex,f=t.children,d="".concat(i,"Id"),h=Wt(f,a),p={};return h&&h.length?p=voe(t,{axes:h,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u}):o&&o.length&&(p=yoe(t,{Axis:a,graphicalItems:o,axisType:i,axisIdKey:d,stackGroups:s,dataStartIndex:l,dataEndIndex:u})),p},xoe=function(t){var r=di(t),n=In(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:vb(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:kd(r,n)}},QO=function(t){var r=t.children,n=t.defaultShowTooltip,i=fr(r,ys),a=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(a=i.props.startIndex),i.props.endIndex>=0&&(o=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},boe=function(t){return!t||!t.length?!1:t.some(function(r){var n=Fn(r&&r.type);return n&&n.indexOf("Bar")>=0})},YO=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},woe=function(t,r){var n=t.props,i=t.graphicalItems,a=t.xAxisMap,o=a===void 0?{}:a,s=t.yAxisMap,l=s===void 0?{}:s,u=n.width,f=n.height,d=n.children,h=n.margin||{},p=fr(d,ys),v=fr(d,ar),m=Object.keys(l).reduce(function(w,j){var O=l[j],P=O.orientation;return!O.mirror&&!O.hide?B(B({},w),{},ae({},P,w[P]+O.width)):w},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(w,j){var O=o[j],P=O.orientation;return!O.mirror&&!O.hide?B(B({},w),{},ae({},P,mr(w,"".concat(P))+O.height)):w},{top:h.top||0,bottom:h.bottom||0}),b=B(B({},y),m),g=b.bottom;p&&(b.bottom+=p.props.height||ys.defaultProps.height),v&&r&&(b=LQ(b,i,n,r));var x=u-b.left-b.right,S=f-b.top-b.bottom;return B(B({brushBottom:g},b),{},{width:Math.max(x,0),height:Math.max(S,0)})},Soe=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},rl=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,o=t.validateTooltipEventTypes,s=o===void 0?["axis"]:o,l=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,h=function(b,g){var x=g.graphicalItems,S=g.stackGroups,w=g.offset,j=g.updateId,O=g.dataStartIndex,P=g.dataEndIndex,A=b.barSize,E=b.layout,N=b.barGap,T=b.barCategoryGap,M=b.maxBarSize,R=YO(E),D=R.numericAxisName,L=R.cateAxisName,U=boe(x),C=[];return x.forEach(function(F,z){var G=Pp(b.data,{graphicalItems:[F],dataStartIndex:O,dataEndIndex:P}),q=F.type.defaultProps!==void 0?B(B({},F.type.defaultProps),F.props):F.props,ee=q.dataKey,ce=q.maxBarSize,V=q["".concat(D,"Id")],ie=q["".concat(L,"Id")],Le={},ot=l.reduce(function(ea,ta){var Ep=g["".concat(ta.axisType,"Map")],Jb=q["".concat(ta.axisType,"Id")];Ep&&Ep[Jb]||ta.axisType==="zAxis"||Ka();var e0=Ep[Jb];return B(B({},ea),{},ae(ae({},ta.axisType,e0),"".concat(ta.axisType,"Ticks"),In(e0)))},Le),Q=ot[L],le=ot["".concat(L,"Ticks")],fe=S&&S[V]&&S[V].hasStack&&QQ(F,S[V].stackGroups),W=Fn(F.type).indexOf("Bar")>=0,We=kd(Q,le),me=[],st=U&&DQ({barSize:A,stackGroups:S,totalSize:Soe(ot,L)});if(W){var lt,Gt,ti=re(ce)?M:ce,to=(lt=(Gt=kd(Q,le,!0))!==null&&Gt!==void 0?Gt:ti)!==null&<!==void 0?lt:0;me=IQ({barGap:N,barCategoryGap:T,bandSize:to!==We?to:We,sizeList:st[ie],maxBarSize:ti}),to!==We&&(me=me.map(function(ea){return B(B({},ea),{},{position:B(B({},ea.position),{},{offset:ea.position.offset-to/2})})}))}var Oc=F&&F.type&&F.type.getComposedData;Oc&&C.push({props:B(B({},Oc(B(B({},ot),{},{displayedData:G,props:b,dataKey:ee,item:F,bandSize:We,barPosition:me,offset:w,stackedData:fe,layout:E,dataStartIndex:O,dataEndIndex:P}))),{},ae(ae(ae({key:F.key||"item-".concat(z)},D,ot[D]),L,ot[L]),"animationId",j)),childIndex:IF(F,b.children),item:F})}),C},p=function(b,g){var x=b.props,S=b.dataStartIndex,w=b.dataEndIndex,j=b.updateId;if(!o1({props:x}))return null;var O=x.children,P=x.layout,A=x.stackOffset,E=x.data,N=x.reverseStackOrder,T=YO(P),M=T.numericAxisName,R=T.cateAxisName,D=Wt(O,n),L=VQ(E,D,"".concat(M,"Id"),"".concat(R,"Id"),A,N),U=l.reduce(function(q,ee){var ce="".concat(ee.axisType,"Map");return B(B({},q),{},ae({},ce,goe(x,B(B({},ee),{},{graphicalItems:D,stackGroups:ee.axisType===M&&L,dataStartIndex:S,dataEndIndex:w}))))},{}),C=woe(B(B({},U),{},{props:x,graphicalItems:D}),g==null?void 0:g.legendBBox);Object.keys(U).forEach(function(q){U[q]=f(x,U[q],C,q.replace("Map",""),r)});var F=U["".concat(R,"Map")],z=xoe(F),G=h(x,B(B({},U),{},{dataStartIndex:S,dataEndIndex:w,updateId:j,graphicalItems:D,stackGroups:L,offset:C}));return B(B({formattedGraphicalItems:G,graphicalItems:D,offset:C,stackGroups:L},z),U)},v=function(y){function b(g){var x,S,w;return toe(this,b),w=ioe(this,b,[g]),ae(w,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ae(w,"accessibilityManager",new zae),ae(w,"handleLegendBBoxUpdate",function(j){if(j){var O=w.state,P=O.dataStartIndex,A=O.dataEndIndex,E=O.updateId;w.setState(B({legendBBox:j},p({props:w.props,dataStartIndex:P,dataEndIndex:A,updateId:E},B(B({},w.state),{},{legendBBox:j}))))}}),ae(w,"handleReceiveSyncEvent",function(j,O,P){if(w.props.syncId===j){if(P===w.eventEmitterSymbol&&typeof w.props.syncMethod!="function")return;w.applySyncEvent(O)}}),ae(w,"handleBrushChange",function(j){var O=j.startIndex,P=j.endIndex;if(O!==w.state.dataStartIndex||P!==w.state.dataEndIndex){var A=w.state.updateId;w.setState(function(){return B({dataStartIndex:O,dataEndIndex:P},p({props:w.props,dataStartIndex:O,dataEndIndex:P,updateId:A},w.state))}),w.triggerSyncEvent({dataStartIndex:O,dataEndIndex:P})}}),ae(w,"handleMouseEnter",function(j){var O=w.getMouseInfo(j);if(O){var P=B(B({},O),{},{isTooltipActive:!0});w.setState(P),w.triggerSyncEvent(P);var A=w.props.onMouseEnter;te(A)&&A(P,j)}}),ae(w,"triggeredAfterMouseMove",function(j){var O=w.getMouseInfo(j),P=O?B(B({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};w.setState(P),w.triggerSyncEvent(P);var A=w.props.onMouseMove;te(A)&&A(P,j)}),ae(w,"handleItemMouseEnter",function(j){w.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),ae(w,"handleItemMouseLeave",function(){w.setState(function(){return{isTooltipActive:!1}})}),ae(w,"handleMouseMove",function(j){j.persist(),w.throttleTriggeredAfterMouseMove(j)}),ae(w,"handleMouseLeave",function(j){w.throttleTriggeredAfterMouseMove.cancel();var O={isTooltipActive:!1};w.setState(O),w.triggerSyncEvent(O);var P=w.props.onMouseLeave;te(P)&&P(O,j)}),ae(w,"handleOuterEvent",function(j){var O=DF(j),P=mr(w.props,"".concat(O));if(O&&te(P)){var A,E;/.*touch.*/i.test(O)?E=w.getMouseInfo(j.changedTouches[0]):E=w.getMouseInfo(j),P((A=E)!==null&&A!==void 0?A:{},j)}}),ae(w,"handleClick",function(j){var O=w.getMouseInfo(j);if(O){var P=B(B({},O),{},{isTooltipActive:!0});w.setState(P),w.triggerSyncEvent(P);var A=w.props.onClick;te(A)&&A(P,j)}}),ae(w,"handleMouseDown",function(j){var O=w.props.onMouseDown;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleMouseUp",function(j){var O=w.props.onMouseUp;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),ae(w,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseDown(j.changedTouches[0])}),ae(w,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&w.handleMouseUp(j.changedTouches[0])}),ae(w,"handleDoubleClick",function(j){var O=w.props.onDoubleClick;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"handleContextMenu",function(j){var O=w.props.onContextMenu;if(te(O)){var P=w.getMouseInfo(j);O(P,j)}}),ae(w,"triggerSyncEvent",function(j){w.props.syncId!==void 0&&Dm.emit(Im,w.props.syncId,j,w.eventEmitterSymbol)}),ae(w,"applySyncEvent",function(j){var O=w.props,P=O.layout,A=O.syncMethod,E=w.state.updateId,N=j.dataStartIndex,T=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)w.setState(B({dataStartIndex:N,dataEndIndex:T},p({props:w.props,dataStartIndex:N,dataEndIndex:T,updateId:E},w.state)));else if(j.activeTooltipIndex!==void 0){var M=j.chartX,R=j.chartY,D=j.activeTooltipIndex,L=w.state,U=L.offset,C=L.tooltipTicks;if(!U)return;if(typeof A=="function")D=A(C,j);else if(A==="value"){D=-1;for(var F=0;F=0){var fe,W;if(M.dataKey&&!M.allowDuplicatedCategory){var We=typeof M.dataKey=="function"?le:"payload.".concat(M.dataKey.toString());fe=Zf(F,We,D),W=z&&G&&Zf(G,We,D)}else fe=F==null?void 0:F[R],W=z&&G&&G[R];if(ie||V){var me=j.props.activeIndex!==void 0?j.props.activeIndex:R;return[k.cloneElement(j,B(B(B({},A.props),ot),{},{activeIndex:me})),null,null]}if(!re(fe))return[Q].concat(Ns(w.renderActivePoints({item:A,activePoint:fe,basePoint:W,childIndex:R,isRange:z})))}else{var st,lt=(st=w.getItemByXY(w.state.activeCoordinate))!==null&&st!==void 0?st:{graphicalItem:Q},Gt=lt.graphicalItem,ti=Gt.item,to=ti===void 0?j:ti,Oc=Gt.childIndex,ea=B(B(B({},A.props),ot),{},{activeIndex:Oc});return[k.cloneElement(to,ea),null,null]}return z?[Q,null,null]:[Q,null]}),ae(w,"renderCustomized",function(j,O,P){return k.cloneElement(j,B(B({key:"recharts-customized-".concat(P)},w.props),w.state))}),ae(w,"renderMap",{CartesianGrid:{handler:of,once:!0},ReferenceArea:{handler:w.renderReferenceElement},ReferenceLine:{handler:of},ReferenceDot:{handler:w.renderReferenceElement},XAxis:{handler:of},YAxis:{handler:of},Brush:{handler:w.renderBrush,once:!0},Bar:{handler:w.renderGraphicChild},Line:{handler:w.renderGraphicChild},Area:{handler:w.renderGraphicChild},Radar:{handler:w.renderGraphicChild},RadialBar:{handler:w.renderGraphicChild},Scatter:{handler:w.renderGraphicChild},Pie:{handler:w.renderGraphicChild},Funnel:{handler:w.renderGraphicChild},Tooltip:{handler:w.renderCursor,once:!0},PolarGrid:{handler:w.renderPolarGrid,once:!0},PolarAngleAxis:{handler:w.renderPolarAxis},PolarRadiusAxis:{handler:w.renderPolarAxis},Customized:{handler:w.renderCustomized}}),w.clipPathId="".concat((x=g.id)!==null&&x!==void 0?x:Qi("recharts"),"-clip"),w.throttleTriggeredAfterMouseMove=BE(w.triggeredAfterMouseMove,(S=g.throttleDelay)!==null&&S!==void 0?S:1e3/60),w.state={},w}return soe(b,y),noe(b,[{key:"componentDidMount",value:function(){var x,S;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(x=this.props.margin.left)!==null&&x!==void 0?x:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var x=this.props,S=x.children,w=x.data,j=x.height,O=x.layout,P=fr(S,$e);if(P){var A=P.props.defaultIndex;if(!(typeof A!="number"||A<0||A>this.state.tooltipTicks.length-1)){var E=this.state.tooltipTicks[A]&&this.state.tooltipTicks[A].value,N=Lg(this.state,w,A,E),T=this.state.tooltipTicks[A].coordinate,M=(this.state.offset.top+j)/2,R=O==="horizontal",D=R?{x:T,y:M}:{y:T,x:M},L=this.state.formattedGraphicalItems.find(function(C){var F=C.item;return F.type.name==="Scatter"});L&&(D=B(B({},D),L.props.points[A].tooltipPosition),N=L.props.points[A].tooltipPayload);var U={activeTooltipIndex:A,isTooltipActive:!0,activeLabel:E,activePayload:N,activeCoordinate:D};this.setState(U),this.renderCursor(P),this.accessibilityManager.setIndex(A)}}}},{key:"getSnapshotBeforeUpdate",value:function(x,S){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==S.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==x.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==x.margin){var w,j;this.accessibilityManager.setDetails({offset:{left:(w=this.props.margin.left)!==null&&w!==void 0?w:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(x){uy([fr(x.children,$e)],[fr(this.props.children,$e)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var x=fr(this.props.children,$e);if(x&&typeof x.props.shared=="boolean"){var S=x.props.shared?"axis":"item";return s.indexOf(S)>=0?S:a}return a}},{key:"getMouseInfo",value:function(x){if(!this.container)return null;var S=this.container,w=S.getBoundingClientRect(),j=uK(w),O={chartX:Math.round(x.pageX-j.left),chartY:Math.round(x.pageY-j.top)},P=w.width/S.offsetWidth||1,A=this.inRange(O.chartX,O.chartY,P);if(!A)return null;var E=this.state,N=E.xAxisMap,T=E.yAxisMap,M=this.getTooltipEventType(),R=GO(this.state,this.props.data,this.props.layout,A);if(M!=="axis"&&N&&T){var D=di(N).scale,L=di(T).scale,U=D&&D.invert?D.invert(O.chartX):null,C=L&&L.invert?L.invert(O.chartY):null;return B(B({},O),{},{xValue:U,yValue:C},R)}return R?B(B({},O),R):null}},{key:"inRange",value:function(x,S){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,O=x/w,P=S/w;if(j==="horizontal"||j==="vertical"){var A=this.state.offset,E=O>=A.left&&O<=A.left+A.width&&P>=A.top&&P<=A.top+A.height;return E?{x:O,y:P}:null}var N=this.state,T=N.angleAxisMap,M=N.radiusAxisMap;if(T&&M){var R=di(T);return mj({x:O,y:P},R)}return null}},{key:"parseEventsOfWrapper",value:function(){var x=this.props.children,S=this.getTooltipEventType(),w=fr(x,$e),j={};w&&S==="axis"&&(w.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var O=Jf(this.props,this.handleOuterEvent);return B(B({},O),j)}},{key:"addListener",value:function(){Dm.on(Im,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Dm.removeListener(Im,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(x,S,w){for(var j=this.state.formattedGraphicalItems,O=0,P=j.length;O{const u=e.reduce((f,d)=>(f[d.status]=(f[d.status]||0)+1,f),{});return Object.entries(u).map(([f,d])=>({name:f.charAt(0).toUpperCase()+f.slice(1),value:d,status:f,color:XO[f]||XO.default}))},[e]),i=u=>{u&&u.status&&(t?t(u.status):r(`/?status=${u.status}`))};if(n.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const a=n.reduce((u,f)=>u+f.value,0),o=n.length>1,s=u=>`${u.name}: ${u.value}`,l=({active:u,payload:f})=>{if(u&&f&&f.length){const d=f[0].payload,h=a>0?(d.value/a*100).toFixed(1):0;return c.jsxs("div",{className:"bg-dark-surface border border-dark-border rounded-lg p-3 shadow-lg",children:[c.jsx("p",{className:"text-white font-semibold",children:d.name}),c.jsxs("p",{className:"text-dark-text-muted text-sm",children:["Count: ",c.jsx("span",{className:"text-white font-medium",children:d.value})]}),c.jsxs("p",{className:"text-dark-text-muted text-sm",children:["Percentage: ",c.jsxs("span",{className:"text-white font-medium",children:[h,"%"]})]})]})}return null};return c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ql,{children:[c.jsx(yr,{data:n,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:o?2:0,dataKey:"value",onClick:i,style:{cursor:"pointer"},label:s,labelLine:!1,children:n.map((u,f)=>c.jsx(vr,{fill:u.color},`cell-${f}`))}),c.jsx($e,{content:c.jsx(l,{})}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"},iconType:"circle",formatter:(u,f)=>{const d=a>0?(f.payload.value/a*100).toFixed(1):0;return`${u} (${f.payload.value}, ${d}%)`}})]})})}function oh(e){"@babel/helpers - typeof";return oh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oh(e)}function Ui(e){if(e===null||e===!0||e===!1)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function At(e,t){if(t.length1?"s":"")+" required, but only "+t.length+" present")}function an(e){At(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||oh(e)==="object"&&t==="[object Date]"?new Date(e.getTime()):typeof e=="number"||t==="[object Number]"?new Date(e):((typeof e=="string"||t==="[object String]")&&typeof console<"u"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn(new Error().stack)),new Date(NaN))}function Poe(e,t){At(2,arguments);var r=an(e).getTime(),n=Ui(t);return new Date(r+n)}var _oe={};function kp(){return _oe}function koe(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function _T(e){At(1,arguments);var t=an(e);return t.setHours(0,0,0,0),t}var kT=6e4,AT=36e5;function Aoe(e){return At(1,arguments),e instanceof Date||oh(e)==="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Eoe(e){if(At(1,arguments),!Aoe(e)&&typeof e!="number")return!1;var t=an(e);return!isNaN(Number(t))}function Noe(e,t){At(2,arguments);var r=Ui(t);return Poe(e,-r)}var Toe=864e5;function $oe(e){At(1,arguments);var t=an(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=r-n;return Math.floor(i/Toe)+1}function sh(e){At(1,arguments);var t=1,r=an(e),n=r.getUTCDay(),i=(n=i.getTime()?r+1:t.getTime()>=o.getTime()?r:r-1}function Coe(e){At(1,arguments);var t=ET(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=sh(r);return n}var Moe=6048e5;function Roe(e){At(1,arguments);var t=an(e),r=sh(t).getTime()-Coe(t).getTime();return Math.round(r/Moe)+1}function lh(e,t){var r,n,i,a,o,s,l,u;At(1,arguments);var f=kp(),d=Ui((r=(n=(i=(a=t==null?void 0:t.weekStartsOn)!==null&&a!==void 0?a:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.weekStartsOn)!==null&&i!==void 0?i:f.weekStartsOn)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.weekStartsOn)!==null&&r!==void 0?r:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var h=an(e),p=h.getUTCDay(),v=(p=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var v=new Date(0);v.setUTCFullYear(d+1,0,p),v.setUTCHours(0,0,0,0);var m=lh(v,t),y=new Date(0);y.setUTCFullYear(d,0,p),y.setUTCHours(0,0,0,0);var b=lh(y,t);return f.getTime()>=m.getTime()?d+1:f.getTime()>=b.getTime()?d:d-1}function Doe(e,t){var r,n,i,a,o,s,l,u;At(1,arguments);var f=kp(),d=Ui((r=(n=(i=(a=t==null?void 0:t.firstWeekContainsDate)!==null&&a!==void 0?a:t==null||(o=t.locale)===null||o===void 0||(s=o.options)===null||s===void 0?void 0:s.firstWeekContainsDate)!==null&&i!==void 0?i:f.firstWeekContainsDate)!==null&&n!==void 0?n:(l=f.locale)===null||l===void 0||(u=l.options)===null||u===void 0?void 0:u.firstWeekContainsDate)!==null&&r!==void 0?r:1),h=NT(e,t),p=new Date(0);p.setUTCFullYear(h,0,d),p.setUTCHours(0,0,0,0);var v=lh(p,t);return v}var Ioe=6048e5;function Loe(e,t){At(1,arguments);var r=an(e),n=lh(r,t).getTime()-Doe(r,t).getTime();return Math.round(n/Ioe)+1}function je(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length0?n:1-n;return je(r==="yy"?i%100:i,r.length)},M:function(t,r){var n=t.getUTCMonth();return r==="M"?String(n+1):je(n+1,2)},d:function(t,r){return je(t.getUTCDate(),r.length)},a:function(t,r){var n=t.getUTCHours()/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h:function(t,r){return je(t.getUTCHours()%12||12,r.length)},H:function(t,r){return je(t.getUTCHours(),r.length)},m:function(t,r){return je(t.getUTCMinutes(),r.length)},s:function(t,r){return je(t.getUTCSeconds(),r.length)},S:function(t,r){var n=r.length,i=t.getUTCMilliseconds(),a=Math.floor(i*Math.pow(10,n-3));return je(a,r.length)}},so={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Foe={G:function(t,r,n){var i=t.getUTCFullYear()>0?1:0;switch(r){case"G":case"GG":case"GGG":return n.era(i,{width:"abbreviated"});case"GGGGG":return n.era(i,{width:"narrow"});case"GGGG":default:return n.era(i,{width:"wide"})}},y:function(t,r,n){if(r==="yo"){var i=t.getUTCFullYear(),a=i>0?i:1-i;return n.ordinalNumber(a,{unit:"year"})}return ii.y(t,r)},Y:function(t,r,n,i){var a=NT(t,i),o=a>0?a:1-a;if(r==="YY"){var s=o%100;return je(s,2)}return r==="Yo"?n.ordinalNumber(o,{unit:"year"}):je(o,r.length)},R:function(t,r){var n=ET(t);return je(n,r.length)},u:function(t,r){var n=t.getUTCFullYear();return je(n,r.length)},Q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"Q":return String(i);case"QQ":return je(i,2);case"Qo":return n.ordinalNumber(i,{unit:"quarter"});case"QQQ":return n.quarter(i,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(i,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(i,{width:"wide",context:"formatting"})}},q:function(t,r,n){var i=Math.ceil((t.getUTCMonth()+1)/3);switch(r){case"q":return String(i);case"qq":return je(i,2);case"qo":return n.ordinalNumber(i,{unit:"quarter"});case"qqq":return n.quarter(i,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(i,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(i,{width:"wide",context:"standalone"})}},M:function(t,r,n){var i=t.getUTCMonth();switch(r){case"M":case"MM":return ii.M(t,r);case"Mo":return n.ordinalNumber(i+1,{unit:"month"});case"MMM":return n.month(i,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(i,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(i,{width:"wide",context:"formatting"})}},L:function(t,r,n){var i=t.getUTCMonth();switch(r){case"L":return String(i+1);case"LL":return je(i+1,2);case"Lo":return n.ordinalNumber(i+1,{unit:"month"});case"LLL":return n.month(i,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(i,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(i,{width:"wide",context:"standalone"})}},w:function(t,r,n,i){var a=Loe(t,i);return r==="wo"?n.ordinalNumber(a,{unit:"week"}):je(a,r.length)},I:function(t,r,n){var i=Roe(t);return r==="Io"?n.ordinalNumber(i,{unit:"week"}):je(i,r.length)},d:function(t,r,n){return r==="do"?n.ordinalNumber(t.getUTCDate(),{unit:"date"}):ii.d(t,r)},D:function(t,r,n){var i=$oe(t);return r==="Do"?n.ordinalNumber(i,{unit:"dayOfYear"}):je(i,r.length)},E:function(t,r,n){var i=t.getUTCDay();switch(r){case"E":case"EE":case"EEE":return n.day(i,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(i,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(i,{width:"short",context:"formatting"});case"EEEE":default:return n.day(i,{width:"wide",context:"formatting"})}},e:function(t,r,n,i){var a=t.getUTCDay(),o=(a-i.weekStartsOn+8)%7||7;switch(r){case"e":return String(o);case"ee":return je(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,r,n,i){var a=t.getUTCDay(),o=(a-i.weekStartsOn+8)%7||7;switch(r){case"c":return String(o);case"cc":return je(o,r.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,r,n){var i=t.getUTCDay(),a=i===0?7:i;switch(r){case"i":return String(a);case"ii":return je(a,r.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(i,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(i,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(i,{width:"short",context:"formatting"});case"iiii":default:return n.day(i,{width:"wide",context:"formatting"})}},a:function(t,r,n){var i=t.getUTCHours(),a=i/12>=1?"pm":"am";switch(r){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,r,n){var i=t.getUTCHours(),a;switch(i===12?a=so.noon:i===0?a=so.midnight:a=i/12>=1?"pm":"am",r){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,r,n){var i=t.getUTCHours(),a;switch(i>=17?a=so.evening:i>=12?a=so.afternoon:i>=4?a=so.morning:a=so.night,r){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,r,n){if(r==="ho"){var i=t.getUTCHours()%12;return i===0&&(i=12),n.ordinalNumber(i,{unit:"hour"})}return ii.h(t,r)},H:function(t,r,n){return r==="Ho"?n.ordinalNumber(t.getUTCHours(),{unit:"hour"}):ii.H(t,r)},K:function(t,r,n){var i=t.getUTCHours()%12;return r==="Ko"?n.ordinalNumber(i,{unit:"hour"}):je(i,r.length)},k:function(t,r,n){var i=t.getUTCHours();return i===0&&(i=24),r==="ko"?n.ordinalNumber(i,{unit:"hour"}):je(i,r.length)},m:function(t,r,n){return r==="mo"?n.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):ii.m(t,r)},s:function(t,r,n){return r==="so"?n.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):ii.s(t,r)},S:function(t,r){return ii.S(t,r)},X:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();if(o===0)return"Z";switch(r){case"X":return JO(o);case"XXXX":case"XX":return ca(o);case"XXXXX":case"XXX":default:return ca(o,":")}},x:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"x":return JO(o);case"xxxx":case"xx":return ca(o);case"xxxxx":case"xxx":default:return ca(o,":")}},O:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"O":case"OO":case"OOO":return"GMT"+ZO(o,":");case"OOOO":default:return"GMT"+ca(o,":")}},z:function(t,r,n,i){var a=i._originalDate||t,o=a.getTimezoneOffset();switch(r){case"z":case"zz":case"zzz":return"GMT"+ZO(o,":");case"zzzz":default:return"GMT"+ca(o,":")}},t:function(t,r,n,i){var a=i._originalDate||t,o=Math.floor(a.getTime()/1e3);return je(o,r.length)},T:function(t,r,n,i){var a=i._originalDate||t,o=a.getTime();return je(o,r.length)}};function ZO(e,t){var r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),a=n%60;if(a===0)return r+String(i);var o=t;return r+String(i)+o+je(a,2)}function JO(e,t){if(e%60===0){var r=e>0?"-":"+";return r+je(Math.abs(e)/60,2)}return ca(e,t)}function ca(e,t){var r=t||"",n=e>0?"-":"+",i=Math.abs(e),a=je(Math.floor(i/60),2),o=je(i%60,2);return n+a+r+o}var eP=function(t,r){switch(t){case"P":return r.date({width:"short"});case"PP":return r.date({width:"medium"});case"PPP":return r.date({width:"long"});case"PPPP":default:return r.date({width:"full"})}},TT=function(t,r){switch(t){case"p":return r.time({width:"short"});case"pp":return r.time({width:"medium"});case"ppp":return r.time({width:"long"});case"pppp":default:return r.time({width:"full"})}},Boe=function(t,r){var n=t.match(/(P+)(p+)?/)||[],i=n[1],a=n[2];if(!a)return eP(t,r);var o;switch(i){case"P":o=r.dateTime({width:"short"});break;case"PP":o=r.dateTime({width:"medium"});break;case"PPP":o=r.dateTime({width:"long"});break;case"PPPP":default:o=r.dateTime({width:"full"});break}return o.replace("{{date}}",eP(i,r)).replace("{{time}}",TT(a,r))},zoe={p:TT,P:Boe},Uoe=["D","DD"],qoe=["YY","YYYY"];function Woe(e){return Uoe.indexOf(e)!==-1}function Hoe(e){return qoe.indexOf(e)!==-1}function tP(e,t,r){if(e==="YYYY")throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="YY")throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="D")throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if(e==="DD")throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var Koe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},Voe=function(t,r,n){var i,a=Koe[t];return typeof a=="string"?i=a:r===1?i=a.one:i=a.other.replace("{{count}}",r.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+i:i+" ago":i};function Fm(e){return function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var Goe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Qoe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Yoe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Xoe={date:Fm({formats:Goe,defaultWidth:"full"}),time:Fm({formats:Qoe,defaultWidth:"full"}),dateTime:Fm({formats:Yoe,defaultWidth:"full"})},Zoe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Joe=function(t,r,n,i){return Zoe[t]};function Sl(e){return function(t,r){var n=r!=null&&r.context?String(r.context):"standalone",i;if(n==="formatting"&&e.formattingValues){var a=e.defaultFormattingWidth||e.defaultWidth,o=r!=null&&r.width?String(r.width):a;i=e.formattingValues[o]||e.formattingValues[a]}else{var s=e.defaultWidth,l=r!=null&&r.width?String(r.width):e.defaultWidth;i=e.values[l]||e.values[s]}var u=e.argumentCallback?e.argumentCallback(t):t;return i[u]}}var ese={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tse={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rse={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},nse={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ise={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},ase={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},ose=function(t,r){var n=Number(t),i=n%100;if(i>20||i<10)switch(i%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},sse={ordinalNumber:ose,era:Sl({values:ese,defaultWidth:"wide"}),quarter:Sl({values:tse,defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:Sl({values:rse,defaultWidth:"wide"}),day:Sl({values:nse,defaultWidth:"wide"}),dayPeriod:Sl({values:ise,defaultWidth:"wide",formattingValues:ase,defaultFormattingWidth:"wide"})};function jl(e){return function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;var o=a[0],s=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?use(s,function(d){return d.test(o)}):lse(s,function(d){return d.test(o)}),u;u=e.valueCallback?e.valueCallback(l):l,u=r.valueCallback?r.valueCallback(u):u;var f=t.slice(o.length);return{value:u,rest:f}}}function lse(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function use(e,t){for(var r=0;r1&&arguments[1]!==void 0?arguments[1]:{},n=t.match(e.matchPattern);if(!n)return null;var i=n[0],a=t.match(e.parsePattern);if(!a)return null;var o=e.valueCallback?e.valueCallback(a[0]):a[0];o=r.valueCallback?r.valueCallback(o):o;var s=t.slice(i.length);return{value:o,rest:s}}}var fse=/^(\d+)(th|st|nd|rd)?/i,dse=/\d+/i,hse={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},pse={any:[/^b/i,/^(a|c)/i]},mse={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},vse={any:[/1/i,/2/i,/3/i,/4/i]},yse={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},gse={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},xse={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},bse={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},wse={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Sse={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},jse={ordinalNumber:cse({matchPattern:fse,parsePattern:dse,valueCallback:function(t){return parseInt(t,10)}}),era:jl({matchPatterns:hse,defaultMatchWidth:"wide",parsePatterns:pse,defaultParseWidth:"any"}),quarter:jl({matchPatterns:mse,defaultMatchWidth:"wide",parsePatterns:vse,defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:jl({matchPatterns:yse,defaultMatchWidth:"wide",parsePatterns:gse,defaultParseWidth:"any"}),day:jl({matchPatterns:xse,defaultMatchWidth:"wide",parsePatterns:bse,defaultParseWidth:"any"}),dayPeriod:jl({matchPatterns:wse,defaultMatchWidth:"any",parsePatterns:Sse,defaultParseWidth:"any"})},Ose={code:"en-US",formatDistance:Voe,formatLong:Xoe,formatRelative:Joe,localize:sse,match:jse,options:{weekStartsOn:0,firstWeekContainsDate:1}},Pse=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,_se=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,kse=/^'([^]*?)'?$/,Ase=/''/g,Ese=/[a-zA-Z]/;function Yn(e,t,r){var n,i,a,o,s,l,u,f,d,h,p,v,m,y;At(2,arguments);var b=String(t),g=kp(),x=(n=(i=void 0)!==null&&i!==void 0?i:g.locale)!==null&&n!==void 0?n:Ose,S=Ui((a=(o=(s=(l=void 0)!==null&&l!==void 0?l:void 0)!==null&&s!==void 0?s:g.firstWeekContainsDate)!==null&&o!==void 0?o:(u=g.locale)===null||u===void 0||(f=u.options)===null||f===void 0?void 0:f.firstWeekContainsDate)!==null&&a!==void 0?a:1);if(!(S>=1&&S<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var w=Ui((d=(h=(p=(v=void 0)!==null&&v!==void 0?v:void 0)!==null&&p!==void 0?p:g.weekStartsOn)!==null&&h!==void 0?h:(m=g.locale)===null||m===void 0||(y=m.options)===null||y===void 0?void 0:y.weekStartsOn)!==null&&d!==void 0?d:0);if(!(w>=0&&w<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!x.localize)throw new RangeError("locale must contain localize property");if(!x.formatLong)throw new RangeError("locale must contain formatLong property");var j=an(e);if(!Eoe(j))throw new RangeError("Invalid time value");var O=koe(j),P=Noe(j,O),A={firstWeekContainsDate:S,weekStartsOn:w,locale:x,_originalDate:j},E=b.match(_se).map(function(N){var T=N[0];if(T==="p"||T==="P"){var M=zoe[T];return M(N,x.formatLong)}return N}).join("").match(Pse).map(function(N){if(N==="''")return"'";var T=N[0];if(T==="'")return Nse(N);var M=Foe[T];if(M)return Hoe(N)&&tP(N,t,String(e)),Woe(N)&&tP(N,t,String(e)),M(P,N,x.localize,A);if(T.match(Ese))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");return N}).join("");return E}function Nse(e){var t=e.match(kse);return t?t[1].replace(Ase,"'"):e}function uh(e,t){var r;At(1,arguments);var n=Ui((r=void 0)!==null&&r!==void 0?r:2);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var i=Mse(e),a;if(i.date){var o=Rse(i.date,n);a=Dse(o.restDateString,o.year)}if(!a||isNaN(a.getTime()))return new Date(NaN);var s=a.getTime(),l=0,u;if(i.time&&(l=Ise(i.time),isNaN(l)))return new Date(NaN);if(i.timezone){if(u=Lse(i.timezone),isNaN(u))return new Date(NaN)}else{var f=new Date(s+l),d=new Date(0);return d.setFullYear(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate()),d.setHours(f.getUTCHours(),f.getUTCMinutes(),f.getUTCSeconds(),f.getUTCMilliseconds()),d}return new Date(s+l+u)}var sf={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},Tse=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,$se=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Cse=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Mse(e){var t={},r=e.split(sf.dateTimeDelimiter),n;if(r.length>2)return t;if(/:/.test(r[0])?n=r[0]:(t.date=r[0],n=r[1],sf.timeZoneDelimiter.test(t.date)&&(t.date=e.split(sf.timeZoneDelimiter)[0],n=e.substr(t.date.length,e.length))),n){var i=sf.timezone.exec(n);i?(t.time=n.replace(i[1],""),t.timezone=i[1]):t.time=n}return t}function Rse(e,t){var r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),n=e.match(r);if(!n)return{year:NaN,restDateString:""};var i=n[1]?parseInt(n[1]):null,a=n[2]?parseInt(n[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((n[1]||n[2]).length)}}function Dse(e,t){if(t===null)return new Date(NaN);var r=e.match(Tse);if(!r)return new Date(NaN);var n=!!r[4],i=Ol(r[1]),a=Ol(r[2])-1,o=Ol(r[3]),s=Ol(r[4]),l=Ol(r[5])-1;if(n)return qse(t,s,l)?Fse(t,s,l):new Date(NaN);var u=new Date(0);return!zse(t,a,o)||!Use(t,i)?new Date(NaN):(u.setUTCFullYear(t,a,Math.max(i,o)),u)}function Ol(e){return e?parseInt(e):1}function Ise(e){var t=e.match($se);if(!t)return NaN;var r=Bm(t[1]),n=Bm(t[2]),i=Bm(t[3]);return Wse(r,n,i)?r*AT+n*kT+i*1e3:NaN}function Bm(e){return e&&parseFloat(e.replace(",","."))||0}function Lse(e){if(e==="Z")return 0;var t=e.match(Cse);if(!t)return 0;var r=t[1]==="+"?-1:1,n=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return Hse(n,i)?r*(n*AT+i*kT):NaN}function Fse(e,t,r){var n=new Date(0);n.setUTCFullYear(e,0,4);var i=n.getUTCDay()||7,a=(t-1)*7+r+1-i;return n.setUTCDate(n.getUTCDate()+a),n}var Bse=[31,null,31,30,31,30,31,31,30,31,30,31];function $T(e){return e%400===0||e%4===0&&e%100!==0}function zse(e,t,r){return t>=0&&t<=11&&r>=1&&r<=(Bse[t]||($T(e)?29:28))}function Use(e,t){return t>=1&&t<=($T(e)?366:365)}function qse(e,t,r){return t>=1&&t<=53&&r>=0&&r<=6}function Wse(e,t,r){return e===24?t===0&&r===0:r>=0&&r<60&&t>=0&&t<60&&e>=0&&e<25}function Hse(e,t){return t>=0&&t<=59}function Ap({runId:e,truncate:t=!0,className:r="",showFullOnHover:n=!1}){const[i,a]=k.useState(!1),[o,s]=k.useState(!1),l=async f=>{f.stopPropagation();try{await navigator.clipboard.writeText(e),a(!0),setTimeout(()=>a(!1),2e3)}catch(d){console.error("Failed to copy:",d)}},u=t&&!o?`${e.substring(0,12)}...`:e;return c.jsxs("div",{className:`flex items-center gap-2 group ${r}`,onMouseEnter:()=>n&&s(!0),onMouseLeave:()=>n&&s(!1),children:[c.jsx("span",{className:"font-mono text-xs text-dark-text",title:e,children:u}),c.jsx("button",{onClick:l,className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 hover:bg-dark-bg rounded text-dark-text-muted hover:text-primary",title:"Copy run ID to clipboard",children:i?c.jsx(tD,{size:14,className:"text-success"}):c.jsx(nD,{size:14})})]})}function ch({runs:e,highlightShots:t=!1,title:r,showDownloadButton:n=!1}){const i=mt(),a=s=>{i(`/runs/${s}`)},o=()=>{const s=r?`qobserva-${r.toLowerCase().replace(/\s+/g,"-")}`:"qobserva-runs";Vx(e,s)};return c.jsxs("div",{children:[n&&c.jsx("div",{className:"flex justify-end mb-4",children:c.jsxs("button",{onClick:o,className:"btn-secondary flex items-center gap-2",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Run ID"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Time"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Project"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Status"}),c.jsx("th",{className:`text-left py-3 px-4 text-sm font-semibold ${t?"text-primary bg-primary/10":"text-dark-text-muted"}`,children:"Shots"})]})}),c.jsx("tbody",{children:e.slice(0,50).map(s=>c.jsxs("tr",{onClick:()=>a(s.run_id),className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 cursor-pointer transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:c.jsx(Ap,{runId:s.run_id})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:Yn(new Date(s.created_at),"MMM dd, HH:mm")}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.project}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:s.backend_name}),c.jsx("td",{className:"py-3 px-4",children:c.jsx("span",{className:`px-2 py-1 rounded text-xs font-semibold ${s.status==="success"?"bg-success/20 text-success":s.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:s.status})}),c.jsx("td",{className:`py-3 px-4 text-sm font-semibold ${t?"text-primary bg-primary/5":"text-dark-text"}`,children:s.shots.toLocaleString()})]},s.run_id))})]})})]})}function Fg({runs:e,title:t}){const r=()=>{const n=t?`qobserva-${t.toLowerCase().replace(/\s+/g,"-")}`:"qobserva-runs";Vx(e,n)};return c.jsxs("button",{onClick:r,className:"btn-secondary flex items-center gap-2 ml-auto",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}function Kse({runs:e}){const t=k.useMemo(()=>{const r=e.reduce((n,i)=>{const a=new Date(i.created_at).toLocaleDateString();return n[a]||(n[a]={date:a,success:0,failed:0,total:0}),n[a].total++,i.status==="success"?n[a].success++:i.status==="failed"&&n[a].failed++,n},{});return Object.values(r).map(n=>({date:n.date,successRate:n.total>0?n.success/n.total*100:0,failureRate:n.total>0?n.failed/n.total*100:0})).sort((n,i)=>new Date(n.date).getTime()-new Date(i.date).getTime())},[e]);return t.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"}):c.jsx(tt,{width:"100%",height:300,children:c.jsxs(PT,{data:t,children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"colorSuccess",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#10b981",stopOpacity:.3}),c.jsx("stop",{offset:"95%",stopColor:"#10b981",stopOpacity:0})]}),c.jsxs("linearGradient",{id:"colorFailed",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#ef4444",stopOpacity:.3}),c.jsx("stop",{offset:"95%",stopColor:"#ef4444",stopOpacity:0})]})]}),c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"date",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},domain:[0,100],label:{value:"Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},formatter:r=>[`${r.toFixed(1)}%`,""]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"},iconType:"circle"}),c.jsx(wn,{type:"monotone",dataKey:"successRate",name:"Success Rate",stroke:"#10b981",strokeWidth:2,fill:"url(#colorSuccess)"}),c.jsx(wn,{type:"monotone",dataKey:"failureRate",name:"Failure Rate",stroke:"#ef4444",strokeWidth:2,fill:"url(#colorFailed)"})]})})}function Vse({filters:e={}}){const t=mt(),[r,n]=k.useState(null),i=k.useMemo(()=>["runs",JSON.stringify(e)],[e]),{data:a=[],isLoading:o}=Qe({queryKey:i,queryFn:()=>Ye.getRuns({limit:1e3,...e}),staleTime:0,refetchOnWindowFocus:!1});if(o)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});const s=a.length,l=a.filter(m=>m.status==="success").length,u=s>0?l/s*100:0,f=a.reduce((m,y)=>m+y.shots,0),d=s>0?Math.round(f/s):0,h=new Set(a.map(m=>m.backend_name)).size,p=r?a.filter(m=>m.status===r):a,v=m=>{const y=new URLSearchParams({type:m});return e.project&&y.set("project",e.project),e.provider&&y.set("provider",e.provider),e.status&&y.set("status",e.status),e.startDate&&y.set("startDate",e.startDate),e.endDate&&y.set("endDate",e.endDate),`/runs-filtered?${y.toString()}`};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"grid grid-cols-5 gap-6",children:[c.jsx(be,{label:"Total Runs",value:s.toLocaleString(),clickable:!0,onClick:()=>t(v("all"))}),c.jsx(be,{label:"Success Rate",value:`${u.toFixed(1)}%`,clickable:!0,onClick:()=>t(v("success"))}),c.jsx(be,{label:"Avg Shots",value:d.toLocaleString(),clickable:!0,onClick:()=>t(v("shots"))}),c.jsx(be,{label:"Backends",value:h.toString(),clickable:!0,onClick:()=>t(v("backends"))}),c.jsx(be,{label:"Total Shots",value:f.toLocaleString(),clickable:!0,onClick:()=>t(v("shots"))})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Success Rate Trend"}),c.jsx(Kse,{runs:a})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runs by Status"}),c.jsx(Ooe,{runs:a,onSliceClick:m=>{n(m)}})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("h3",{className:"text-lg font-semibold text-white",children:[r?`${r.charAt(0).toUpperCase()+r.slice(1)} Runs`:"Recent Runs",r&&c.jsx("button",{onClick:()=>n(null),className:"ml-4 text-sm text-primary hover:underline",children:"Clear filter"})]}),c.jsx(Fg,{runs:p})]}),c.jsx(ch,{runs:p})]})]})}function Bg({counts:e}){const t=Object.entries(e).sort(([,r],[,n])=>n-r).slice(0,20).map(([r,n])=>({bitstring:r,count:n}));return t.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No counts available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Ts,{data:t,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"bitstring",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80,label:{value:"Bitstring (Measurement Outcome)",position:"insideBottom",offset:-5,fill:"#94a3b8",style:{textAnchor:"middle"}}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Count (Number of Observations)",angle:-90,position:"insideLeft",fill:"#94a3b8",style:{textAnchor:"middle"}}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0",fontWeight:"bold"},formatter:r=>[r.toLocaleString(),"Count"]}),c.jsx(or,{dataKey:"count",fill:"#3b82f6",radius:[8,8,0,0]})]})})}function Gse({queueTime:e,runtime:t}){const r=(e||0)+(t||0);return!e&&!t?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No timeline data"}):c.jsxs("div",{className:"space-y-4",children:[e&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("span",{className:"text-sm text-dark-text-muted",children:"Queue Time"}),c.jsxs("span",{className:"text-sm text-dark-text",children:[e,"ms"]})]}),c.jsx("div",{className:"h-4 bg-dark-bg rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-warning",style:{width:`${e/r*100}%`}})})]}),t&&c.jsxs("div",{children:[c.jsxs("div",{className:"flex justify-between mb-2",children:[c.jsx("span",{className:"text-sm text-dark-text-muted",children:"Runtime"}),c.jsxs("span",{className:"text-sm text-dark-text",children:[t,"ms"]})]}),c.jsx("div",{className:"h-4 bg-dark-bg rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-success",style:{width:`${t/r*100}%`}})})]})]})}function Qse({top1:e,top5:t,top10:r}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Top-K Dominance"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Probability mass in top states. High values indicate algorithm convergence; low values suggest noise-dominated output."}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(be,{label:"Top-1 Probability",value:`${(e*100).toFixed(3)}%`}),c.jsx(be,{label:"Top-5 Cumulative",value:`${(t*100).toFixed(3)}%`}),c.jsx(be,{label:"Top-10 Cumulative",value:`${(r*100).toFixed(3)}%`})]}),e<.01&&r<.05&&c.jsx("p",{className:"text-sm text-warning mt-4",children:"⚠️ Highly uniform distribution → likely noise-dominated"})]})}function Yse({effectiveSupportSize:e,totalStates:t}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Effective Support Size"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Number of states covering 95% of probability mass. More intuitive than entropy for understanding algorithm sharpness vs noise."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(be,{label:"Effective Support (95%)",value:e.toLocaleString()}),c.jsx(be,{label:"Total Unique States",value:t.toLocaleString()})]}),c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Coverage:"}),c.jsxs("span",{className:"text-dark-text",children:[t>0?(e/t*100).toFixed(1):0,"% of states"]})]}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-2",children:c.jsx("div",{className:"bg-primary h-2 rounded-full transition-all",style:{width:`${t>0?e/t*100:0}%`}})})]})]})}function Xse({entropy:e,idealEntropy:t,entropyRatio:r}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Entropy Analysis"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:'Measured entropy vs ideal (max) entropy. Ratio shows "how random" relative to expectation.'}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(be,{label:"Shannon Entropy",value:`${e.toFixed(4)} bits`}),t!==void 0&&c.jsx(be,{label:"Ideal Entropy (Max)",value:`${t.toFixed(4)} bits`}),r!==void 0&&c.jsx(be,{label:"Entropy Ratio",value:`${(r*100).toFixed(1)}%`,change:r>.9?"Highly random":r>.5?"Moderately random":"Concentrated"})]}),r!==void 0&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"flex items-center justify-between text-sm mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Randomness:"}),c.jsx("span",{className:`font-semibold ${r>.9?"text-warning":r>.5?"text-primary":"text-success"}`,children:r>.9?"Highly Random":r>.5?"Moderately Random":"Concentrated"})]}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-2",children:c.jsx("div",{className:`h-2 rounded-full transition-all ${r>.9?"bg-warning":r>.5?"bg-primary":"bg-success"}`,style:{width:`${r*100}%`}})})]})]})}function Zse({uniqueStates:e,shots:t,uniqueStatesRatio:r,collisionRate:n}){return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shot Efficiency & Sampling Quality"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Unique states vs total shots. High unique ratio indicates undersampling; low ratio with high collisions suggests concentration."}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[c.jsx(be,{label:"Unique States",value:e.toLocaleString()}),c.jsx(be,{label:"Total Shots",value:t.toLocaleString()})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(be,{label:"Unique/Shots Ratio",value:`${(r*100).toFixed(2)}%`,change:r>.9?"Undersampled":r<.1?"Oversampled":"Balanced"}),c.jsx(be,{label:"Collision Rate",value:`${(n*100).toFixed(2)}%`,change:n>.5?"High concentration":"Low concentration"})]}),r>.9&&c.jsxs("p",{className:"text-sm text-warning mt-4",children:["⚠️ High unique ratio (",r>.9?">90%":">50%",") - Additional shots unlikely to improve signal"]})]})}function Jse({runtimeMs:e,queueMs:t,runtimePerShot:r,classification:n}){const i=o=>{switch(o){case"queue-dominated":return"text-warning";case"execution-dominated":return"text-primary";case"cpu-bound":return"text-success";default:return"text-dark-text-muted"}},a=o=>{switch(o){case"queue-dominated":return"Queue-Dominated";case"execution-dominated":return"Execution-Dominated";case"cpu-bound":return"CPU-Bound";default:return"Unknown"}};return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runtime & Execution Behavior"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Runtime analysis helps identify if backend is slow or circuit is slow. Classification is heuristic."}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 mb-4",children:[c.jsx(be,{label:"Runtime",value:`${e.toLocaleString()}ms`}),c.jsx(be,{label:"Queue Time",value:`${t.toLocaleString()}ms`}),c.jsx(be,{label:"Runtime/Shot",value:`${r.toFixed(3)}ms`}),c.jsxs("div",{className:"metric-card",children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Classification"}),c.jsx("div",{className:`text-2xl font-bold ${i(n)}`,children:a(n)})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("div",{className:"flex items-center justify-between text-sm mb-2",children:c.jsx("span",{className:"text-dark-text-muted",children:"Time Distribution:"})}),c.jsx("div",{className:"w-full bg-dark-bg rounded-full h-4 flex overflow-hidden",children:e>0&&t>0&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"bg-primary h-4 transition-all",style:{width:`${e/(e+t)*100}%`},title:`Execution: ${e}ms`}),c.jsx("div",{className:"bg-warning h-4 transition-all",style:{width:`${t/(e+t)*100}%`},title:`Queue: ${t}ms`})]})}),c.jsxs("div",{className:"flex justify-between text-xs text-dark-text-muted mt-2",children:[c.jsxs("span",{children:["Execution: ",e,"ms"]}),c.jsxs("span",{children:["Queue: ",t,"ms"]})]})]}),n==="queue-dominated"&&c.jsx("p",{className:"text-sm text-warning mt-4",children:"⚠️ Queue time dominates - Backend may be heavily loaded"})]})}function ele({cpuTimeS:e,qpuTimeS:t,queueTimeS:r,postProcessingTimeS:n}){const i=a=>`${a.toFixed(2)} s`;return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Execution time breakdown"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Provider-reported time spent in CPU, QPU, queue, and post-processing. Shown when the backend supplies this metadata (e.g. IBM cloud/hardware)."}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[e!=null&&c.jsx(be,{label:"CPU",value:i(e)}),t!=null&&c.jsx(be,{label:"QPU",value:i(t)}),r!=null&&c.jsx(be,{label:"Queue (provider)",value:i(r)}),n!=null&&c.jsx(be,{label:"Post-processing",value:i(n)})]})]})}function ec(e,t){var v,m,y,b,g,x,S,w;const r={},n=((m=(v=e.artifacts)==null?void 0:v.counts)==null?void 0:m.histogram)||{},i=((y=e.execution)==null?void 0:y.shots)||0,a=((b=e.execution)==null?void 0:b.runtime_ms)||0,o=((g=e.execution)==null?void 0:g.queue_ms)||0,s=(S=(x=e.program)==null?void 0:x.circuit_metrics)==null?void 0:S.num_qubits;if(!n||i===0)return r;const l=Object.entries(n).map(([j,O])=>({state:j,count:parseInt(O,10),probability:parseInt(O,10)/i})).sort((j,O)=>O.probability-j.probability);if(l.length>0){r.top1Probability=l[0].probability;const j=l.slice(0,5).reduce((P,A)=>P+A.probability,0);r.top5Probability=j;const O=l.slice(0,10).reduce((P,A)=>P+A.probability,0);r.top10Probability=O}let u=0,f=0;for(const j of l)if(u+=j.probability,f++,u>=.95)break;r.effectiveSupportSize=f;const d=(w=t.metrics)==null?void 0:w["qc.quality.shannon_entropy_bits"];if(d!=null&&(r.entropy=d,s&&s>0)){const j=s;r.idealEntropy=j,r.entropyRatio=d/j}const h=Object.keys(n).length;r.uniqueStates=h,r.uniqueStatesRatio=i>0?h/i:0;let p=0;for(const j of Object.values(n)){const O=parseInt(String(j),10);O>1&&(p+=O-1)}if(r.collisionRate=i>0?p/i:0,a>0&&i>0&&(r.runtimePerShot=a/i),a>0){const j=a+o;if(j>0){const O=o/j,P=a/j;O>.5?r.runtimeClassification="queue-dominated":P>.7?r.runtimeClassification="execution-dominated":a<100&&o<100?r.runtimeClassification="cpu-bound":r.runtimeClassification="unknown"}else r.runtimeClassification="unknown"}else r.runtimeClassification="unknown";return r}function tle(e){var n,i,a,o,s;if(!e||Object.keys(e).length===0)return null;if(e.algorithm==="error_test"){const l=e.error_type||"error scenario";return{severity:"warn",message:`This run is tagged as an error test (${l}). Results may not represent normal execution and should be interpreted accordingly.`,tagContext:`algorithm: error_test, error_type: ${l}`}}if(e.error_type&&e.error_type!=="none"&&e.error_type!==""&&(e.algorithm==="error_test"||((n=e.test)==null?void 0:n.toLowerCase().includes("error"))||((i=e.purpose)==null?void 0:i.toLowerCase().includes("error"))||((a=e.scenario)==null?void 0:a.toLowerCase().includes("error"))))return{severity:"warn",message:`This run is tagged with error_type: "${e.error_type}". This appears to be an intentional error test scenario - results may not be meaningful for normal analysis.`,tagContext:`error_type: ${e.error_type}`};if(e.test&&e.test.toLowerCase().includes("error"))return{severity:"info",message:'This run is tagged as a test with "error" in the tag value. Results may be from an error handling test scenario.',tagContext:`test: ${e.test}`};const t=((o=e.purpose)==null?void 0:o.toLowerCase())||"",r=((s=e.scenario)==null?void 0:s.toLowerCase())||"";return(t.includes("error")||r.includes("error"))&&(t.includes("test")||r.includes("test"))?{severity:"info",message:"This run appears to be an error test scenario based on tags. Results should be interpreted in that context.",tagContext:t?`purpose: ${e.purpose}`:`scenario: ${e.scenario}`}:null}function zm(e){if(e==null||e==="")return"—";if(typeof e=="string"){const t=e.trim();return t.length>0?`v${t}`:"—"}return`v${String(e)}`}function rle(){var g,x,S,w,j,O,P,A,E,N,T,M,R,D,L,U,C;const{runId:e}=bR(),[t,r]=k.useState({rawMetadata:!1,rawEvent:!1,rawAnalysis:!1}),{data:n=[]}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3})}),i=n.find(F=>F.run_id===e),a=(i==null?void 0:i.project)||"default",{data:o,isLoading:s,error:l}=Qe({queryKey:["run",e],queryFn:()=>Ye.getRun(a,e),enabled:!!e,retry:2}),u=k.useMemo(()=>o?ec(o.event,o.analysis):{},[o]),f=o==null?void 0:o.event,d=o==null?void 0:o.analysis,h=(d==null?void 0:d.metrics)||{},p=h["qc.quality.shannon_entropy_bits"],v=((x=(g=f==null?void 0:f.artifacts)==null?void 0:g.counts)==null?void 0:x.histogram)||{},m=Object.keys(v).length,y=k.useMemo(()=>f!=null&&f.tags?tle(f.tags):null,[f==null?void 0:f.tags]);if(s)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});if(l||!o||!f||!d)return c.jsxs("div",{className:"text-center py-12",children:[c.jsx("p",{className:"text-dark-text-muted mb-4",children:"Run not found"}),c.jsxs("p",{className:"text-sm text-dark-text-muted",children:["Run ID: ",e]})]});const b=F=>{r(z=>({...z,[F]:!z[F]}))};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:"Run Details"}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Run ID:"}),c.jsx(Ap,{runId:e||"",truncate:!1})]})]}),y&&c.jsx("div",{className:`card border-l-4 ${y.severity==="warn"?"border-warning bg-warning/10":"border-primary bg-primary/10"}`,children:c.jsxs("div",{className:"flex items-start gap-3",children:[y.severity==="warn"?c.jsx(XR,{className:"text-warning mt-0.5 flex-shrink-0",size:20}):c.jsx(Xk,{className:"text-primary mt-0.5 flex-shrink-0",size:20}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h4",{className:`font-semibold mb-1 ${y.severity==="warn"?"text-warning":"text-primary"}`,children:y.severity==="warn"?"Test Scenario Warning":"Tag Information"}),c.jsx("p",{className:"text-sm text-dark-text",children:y.message}),y.tagContext&&c.jsxs("p",{className:"text-xs text-dark-text-muted mt-2",children:["Tag context: ",y.tagContext]})]})]})}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Run Information"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Project"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.project})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Provider"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.backend.provider})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Backend"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.backend.name})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Status"}),c.jsx("span",{className:`font-medium ${f.execution.status==="success"?"text-success":f.execution.status==="failed"?"text-error":"text-dark-text-muted"}`,children:f.execution.status})]})]}),c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("h4",{className:"text-sm font-semibold text-white mb-1",children:"QObserva components (this run)"}),c.jsx("p",{className:"text-xs text-dark-text-muted mb-3",children:"Versions stored with this run's telemetry. Missing values show as — (e.g. runs recorded before this field existed, or not present in the payload)."}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"QObserva (meta)"}),c.jsx("span",{className:"text-dark-text font-medium",children:zm((S=f.software)==null?void 0:S.qobserva_version)})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"QObserva Agent"}),c.jsx("span",{className:"text-dark-text font-medium",children:zm((w=f.software)==null?void 0:w.agent_version)})]}),c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"QObserva Collector"}),c.jsx("span",{className:"text-dark-text font-medium",children:zm((j=f.software)==null?void 0:j.collector_version)})]})]})]}),(((O=f.software)==null?void 0:O.sdk)||((P=f.software)==null?void 0:P.python_version))&&c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("h4",{className:"text-sm font-semibold text-white mb-3",children:"Software environment"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[((A=f.software.sdk)==null?void 0:A.name)&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"SDK"}),c.jsxs("span",{className:"text-dark-text font-medium",children:[f.software.sdk.name,f.software.sdk.version&&c.jsxs("span",{className:"text-dark-text-muted ml-1",children:["v",f.software.sdk.version]})]})]}),f.software.python_version&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Python"}),c.jsx("span",{className:"text-dark-text font-medium",children:f.software.python_version})]})]})]}),f.event_id&&c.jsx("div",{className:"mt-4 pt-4 border-t border-dark-border",children:c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted text-sm mb-1",children:"Event ID"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.event_id})]})})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-6",children:[h["qc.quality.success_probability"]!==void 0?c.jsx(be,{label:"Success Rate",value:`${(h["qc.quality.success_probability"]*100).toFixed(1)}%`}):h["qc.optimization.energy"]!==void 0?c.jsx(be,{label:"Energy",value:h["qc.optimization.energy"].toFixed(4)}):c.jsx(be,{label:"Success Rate",value:"N/A"}),c.jsx(be,{label:"Shots",value:f.execution.shots.toLocaleString()}),c.jsx(be,{label:"Runtime",value:f.execution.runtime_ms?`${f.execution.runtime_ms}ms`:"N/A"}),c.jsx(be,{label:"Cost",value:h["qc.cost.estimated_usd"]?`$${h["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]}),h["qc.optimization.energy"]!==void 0&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Optimization Results"}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Energy"}),c.jsx("span",{className:"text-dark-text font-medium text-lg",children:h["qc.optimization.energy"].toFixed(6)})]}),h["qc.optimization.energy_stderr"]!==void 0&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Energy Std Error"}),c.jsx("span",{className:"text-dark-text font-medium",children:h["qc.optimization.energy_stderr"].toFixed(6)})]}),h["qc.optimization.approximation_ratio"]!==void 0&&c.jsxs("div",{className:"flex flex-col",children:[c.jsx("span",{className:"text-dark-text-muted mb-1",children:"Approximation Ratio"}),c.jsxs("span",{className:`font-medium ${h["qc.optimization.approximation_ratio"]<=1.1?"text-success":h["qc.optimization.approximation_ratio"]<=2?"text-warning":"text-error"}`,children:[h["qc.optimization.approximation_ratio"].toFixed(4),"x"]}),c.jsx("span",{className:"text-xs text-dark-text-muted mt-1",children:h["qc.optimization.approximation_ratio"]<=1.1?"Excellent (near ground state)":h["qc.optimization.approximation_ratio"]<=2?"Good":"Needs improvement"})]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Measurement Results"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Distribution of measurement outcomes (bitstrings) and how many times each was observed. Shows the top 20 most frequent outcomes."}),c.jsx(Bg,{counts:((N=(E=f.artifacts)==null?void 0:E.counts)==null?void 0:N.histogram)||{}})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Execution Timeline"}),c.jsx(Gse,{queueTime:f.execution.queue_ms,runtime:f.execution.runtime_ms})]})]}),u.top1Probability!==void 0&&c.jsx(Qse,{top1:u.top1Probability,top5:u.top5Probability||0,top10:u.top10Probability||0}),u.effectiveSupportSize!==void 0&&c.jsx(Yse,{effectiveSupportSize:u.effectiveSupportSize,totalStates:m}),p!=null&&c.jsx(Xse,{entropy:p,idealEntropy:u.idealEntropy,entropyRatio:u.entropyRatio}),u.uniqueStates!==void 0&&((T=f.execution)==null?void 0:T.shots)&&c.jsx(Zse,{uniqueStates:u.uniqueStates,shots:f.execution.shots,uniqueStatesRatio:u.uniqueStatesRatio||0,collisionRate:u.collisionRate||0}),u.runtimePerShot!==void 0&&((M=f.execution)==null?void 0:M.runtime_ms)!==void 0&&c.jsx(Jse,{runtimeMs:f.execution.runtime_ms||0,queueMs:f.execution.queue_ms||0,shots:f.execution.shots||0,runtimePerShot:u.runtimePerShot,classification:u.runtimeClassification||"unknown"}),(h["qc.time.cpu_s"]!=null||h["qc.time.qpu_s"]!=null||h["qc.time.queue_s"]!=null||h["qc.time.post_processing_s"]!=null)&&c.jsx(ele,{cpuTimeS:h["qc.time.cpu_s"],qpuTimeS:h["qc.time.qpu_s"],queueTimeS:h["qc.time.queue_s"],postProcessingTimeS:h["qc.time.post_processing_s"]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawMetadata"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Detailed Metadata"}),t.rawMetadata?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawMetadata&&c.jsxs("div",{className:"mt-4 space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Run ID:"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.run_id})]}),f.event_id&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Event ID:"}),c.jsx("span",{className:"text-dark-text font-mono text-xs",children:f.event_id})]}),f.created_at&&c.jsxs("div",{className:"flex justify-between",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Created At:"}),c.jsx("span",{className:"text-dark-text",children:new Date(f.created_at).toLocaleString()})]})]}),c.jsxs("div",{className:"mt-4",children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Raw Metadata (JSON)"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-96",children:JSON.stringify({project:f.project,backend:f.backend,run_id:f.run_id,event_id:f.event_id||void 0,created_at:f.created_at||void 0,execution:{status:f.execution.status,shots:f.execution.shots,runtime_ms:f.execution.runtime_ms,queue_ms:f.execution.queue_ms}},null,2)})]})]})]}),d.insights&&d.insights.length>0&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Insights"}),c.jsx("div",{className:"space-y-2",children:d.insights.map((F,z)=>c.jsx("div",{className:`p-3 rounded-lg ${F.severity==="critical"?"bg-error/20 border border-error/30 text-error":F.severity==="warn"?"bg-warning/20 border border-warning/30 text-warning":"bg-primary/20 border border-primary/30 text-primary"}`,children:F.summary},z))})]}),((R=f.artifacts)==null?void 0:R.energies)&&c.jsxs("div",{className:"card border-l-4 border-primary",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Energy Artifacts (Debug)"}),c.jsxs("div",{className:"text-sm",children:[c.jsxs("div",{className:"mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Energy Value:"}),c.jsx("span",{className:"text-dark-text font-mono ml-2",children:((D=f.artifacts.energies)==null?void 0:D.value)!==null&&((L=f.artifacts.energies)==null?void 0:L.value)!==void 0?String(f.artifacts.energies.value):"null/undefined"})]}),c.jsxs("div",{className:"mb-2",children:[c.jsx("span",{className:"text-dark-text-muted",children:"Energy Std Error:"}),c.jsx("span",{className:"text-dark-text font-mono ml-2",children:((U=f.artifacts.energies)==null?void 0:U.stderr)!==null&&((C=f.artifacts.energies)==null?void 0:C.stderr)!==void 0?String(f.artifacts.energies.stderr):"null/undefined"})]}),c.jsx("div",{className:"text-xs text-dark-text-muted mt-2",children:"If energy value is null/undefined, the adapter didn't extract it. If it has a value but metrics don't show it, the analysis needs to be re-run."})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawEvent"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Raw Event Data"}),t.rawEvent?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawEvent&&c.jsx("div",{className:"mt-4",children:c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-96",children:JSON.stringify(f,null,2)})})]}),c.jsxs("div",{className:"card",children:[c.jsxs("button",{onClick:()=>b("rawAnalysis"),className:"w-full flex items-center justify-between text-left",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Raw Analytics Data"}),t.rawAnalysis?c.jsx(om,{className:"text-dark-text-muted"}):c.jsx(am,{className:"text-dark-text-muted"})]}),t.rawAnalysis&&c.jsxs("div",{className:"mt-4",children:[c.jsxs("div",{className:"mb-4",children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Metrics"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-64",children:JSON.stringify(h,null,2)})]}),d.insights&&d.insights.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-semibold text-dark-text-muted mb-2",children:"Insights"}),c.jsx("pre",{className:"bg-dark-bg border border-dark-border rounded-lg p-4 text-xs text-dark-text overflow-auto max-h-64",children:JSON.stringify(d.insights,null,2)})]})]})]})]})}function rP({runs:e,value:t,onChange:r,label:n,placeholder:i="Search by run ID, project, backend..."}){const[a,o]=k.useState(!1),[s,l]=k.useState(""),u=e.find(p=>p.run_id===t),f=k.useMemo(()=>{if(!s.trim())return e.slice(0,50);const p=s.toLowerCase();return e.filter(v=>v.run_id.toLowerCase().includes(p)||v.project.toLowerCase().includes(p)||v.provider.toLowerCase().includes(p)||v.backend_name.toLowerCase().includes(p)||v.status.toLowerCase().includes(p)).slice(0,50)},[e,s]),d=p=>{r(p),o(!1),l("")},h=()=>{r(""),l("")};return c.jsxs("div",{className:"relative",children:[c.jsx("label",{className:"block text-sm font-medium text-dark-text-muted mb-2",children:n}),c.jsxs("div",{className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>o(!a),className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm flex items-center justify-between hover:border-primary/50 transition-colors",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[c.jsx(Yf,{size:16,className:"text-dark-text-muted flex-shrink-0"}),u?c.jsxs("span",{className:"truncate",children:[c.jsxs("span",{className:"font-mono text-xs text-primary",children:[u.run_id.substring(0,12),"..."]})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{children:u.project})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{children:u.backend_name})," ",c.jsx("span",{className:"text-dark-text-muted",children:"•"})," ",c.jsx("span",{className:"text-xs",children:Yn(new Date(u.created_at),"MMM dd, HH:mm")})]}):c.jsx("span",{className:"text-dark-text-muted",children:i})]}),u&&c.jsx("div",{onClick:p=>{p.stopPropagation(),h()},className:"ml-2 text-dark-text-muted hover:text-dark-text transition-colors cursor-pointer flex items-center",role:"button",tabIndex:0,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.stopPropagation(),h())},children:c.jsx(Zk,{size:16})})]}),a&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>o(!1)}),c.jsxs("div",{className:"absolute z-20 w-full mt-1 bg-dark-surface border border-dark-border rounded-lg shadow-xl max-h-96 overflow-hidden",children:[c.jsx("div",{className:"p-2 border-b border-dark-border",children:c.jsxs("div",{className:"relative",children:[c.jsx(Yf,{size:16,className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-dark-text-muted"}),c.jsx("input",{type:"text",value:s,onChange:p=>l(p.target.value),placeholder:"Type to search...",className:"w-full bg-dark-bg border border-dark-border rounded-lg pl-10 pr-3 py-2 text-dark-text text-sm focus:outline-none focus:border-primary/50",autoFocus:!0,onClick:p=>p.stopPropagation()})]})}),c.jsx("div",{className:"overflow-y-auto max-h-80",children:f.length===0?c.jsx("div",{className:"p-4 text-center text-dark-text-muted text-sm",children:"No runs found"}):c.jsx("div",{className:"p-1",children:f.map(p=>c.jsx("button",{onClick:()=>d(p.run_id),className:`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${p.run_id===t?"bg-primary/20 text-primary border border-primary/30":"text-dark-text hover:bg-dark-bg"}`,children:c.jsx("div",{className:"flex items-center justify-between gap-2",children:c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsxs("span",{className:"font-mono text-xs text-primary font-semibold",children:[p.run_id.substring(0,12),"..."]}),c.jsx("span",{className:`px-2 py-0.5 rounded text-xs font-semibold ${p.status==="success"?"bg-success/20 text-success":p.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:p.status})]}),c.jsxs("div",{className:"text-xs text-dark-text-muted space-x-2",children:[c.jsx("span",{children:p.project}),c.jsx("span",{children:"•"}),c.jsx("span",{children:p.provider}),c.jsx("span",{children:"•"}),c.jsx("span",{children:p.backend_name}),c.jsx("span",{children:"•"}),c.jsx("span",{children:Yn(new Date(p.created_at),"MMM dd, HH:mm")})]})]})})},p.run_id))})})]})]})]})]})}function nP({event:e,runId:t,label:r}){const n=mt();return c.jsx("div",{className:"card",children:c.jsx("div",{className:"flex items-center justify-between",children:c.jsxs("div",{className:"flex-1",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:r}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ap,{runId:t}),c.jsx("button",{onClick:()=>n(`/runs/${t}`),className:"flex items-center gap-1 text-primary hover:text-primary/80 text-sm transition-colors",title:"View run details",children:c.jsx(iD,{size:14})})]})]}),c.jsxs("div",{className:"grid grid-cols-4 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Project:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.project})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Provider:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.backend.provider})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Backend:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.backend.name})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-dark-text-muted",children:"Time:"}),c.jsx("span",{className:"text-dark-text ml-2 font-medium",children:e.created_at?Yn(new Date(e.created_at),"MMM dd, HH:mm"):"N/A"})]})]})]})})})}function nle({runA:e,runB:t}){var l,u,f,d,h,p,v,m,y,b;const r=k.useMemo(()=>ec(e.event,e.analysis),[e]),n=k.useMemo(()=>ec(t.event,t.analysis),[t]),i=e.analysis.metrics||{},a=t.analysis.metrics||{},o=(g,x,S="number")=>{if(g===void 0||x===void 0)return"N/A";const w=x-g,j=w>=0?"+":"";return S==="percent"?`${j}${(w*100).toFixed(1)}%`:S==="ms"?`${j}${w.toFixed(0)}ms`:S==="usd"?`${j}$${w.toFixed(4)}`:S==="s"?`${j}${w.toFixed(2)} s`:`${j}${w.toLocaleString()}`},s=(g,x,S=!1)=>{if(g===void 0||x===void 0)return"text-dark-text-muted";const w=x-g;return w===0?"text-dark-text-muted":S?w<0?"text-success":"text-error":w>0?"text-success":"text-error"};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Basic Execution Metrics"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Comparing Run A vs Run B. Delta shows change from Run A to Run B (positive = Run B is higher, negative = Run B is lower)."}),c.jsxs("div",{className:"grid grid-cols-4 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Shots"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:e.event.execution.shots.toLocaleString()})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:t.event.execution.shots.toLocaleString()})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.shots,t.event.execution.shots)}`,children:["Δ: ",o(e.event.execution.shots,t.event.execution.shots)]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Success Rate"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:i["qc.quality.success_probability"]?`${(i["qc.quality.success_probability"]*100).toFixed(1)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:a["qc.quality.success_probability"]?`${(a["qc.quality.success_probability"]*100).toFixed(1)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.quality.success_probability"],a["qc.quality.success_probability"])}`,children:["Δ: ",o(i["qc.quality.success_probability"],a["qc.quality.success_probability"],"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Runtime"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:e.event.execution.runtime_ms?`${e.event.execution.runtime_ms.toLocaleString()}ms`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:t.event.execution.runtime_ms?`${t.event.execution.runtime_ms.toLocaleString()}ms`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.runtime_ms,t.event.execution.runtime_ms,!0)}`,children:["Δ: ",o(e.event.execution.runtime_ms,t.event.execution.runtime_ms,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Cost"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:i["qc.cost.estimated_usd"]?`$${i["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-xl font-bold text-white",children:a["qc.cost.estimated_usd"]?`$${a["qc.cost.estimated_usd"].toFixed(4)}`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.cost.estimated_usd"],a["qc.cost.estimated_usd"],!0)}`,children:["Δ: ",o(i["qc.cost.estimated_usd"],a["qc.cost.estimated_usd"],"usd")]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Quality Metrics"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Entropy"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((l=i["qc.quality.shannon_entropy_bits"])==null?void 0:l.toFixed(4))||"N/A"," bits"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((u=a["qc.quality.shannon_entropy_bits"])==null?void 0:u.toFixed(4))||"N/A"," bits"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.quality.shannon_entropy_bits"],a["qc.quality.shannon_entropy_bits"])}`,children:["Δ: ",o(i["qc.quality.shannon_entropy_bits"],a["qc.quality.shannon_entropy_bits"])]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Top-1 Probability"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.top1Probability?`${(r.top1Probability*100).toFixed(3)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.top1Probability?`${(n.top1Probability*100).toFixed(3)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.top1Probability,n.top1Probability)}`,children:["Δ: ",o(r.top1Probability,n.top1Probability,"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Effective Support"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((f=r.effectiveSupportSize)==null?void 0:f.toLocaleString())||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((d=n.effectiveSupportSize)==null?void 0:d.toLocaleString())||"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.effectiveSupportSize,n.effectiveSupportSize)}`,children:["Δ: ",o(r.effectiveSupportSize,n.effectiveSupportSize)]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shot Efficiency"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Unique States"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((h=r.uniqueStates)==null?void 0:h.toLocaleString())||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:((p=n.uniqueStates)==null?void 0:p.toLocaleString())||"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.uniqueStates,n.uniqueStates)}`,children:["Δ: ",o(r.uniqueStates,n.uniqueStates)]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Unique/Shots Ratio"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.uniqueStatesRatio?`${(r.uniqueStatesRatio*100).toFixed(2)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.uniqueStatesRatio?`${(n.uniqueStatesRatio*100).toFixed(2)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.uniqueStatesRatio,n.uniqueStatesRatio)}`,children:["Δ: ",o(r.uniqueStatesRatio,n.uniqueStatesRatio,"percent")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Collision Rate"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:r.collisionRate?`${(r.collisionRate*100).toFixed(2)}%`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:n.collisionRate?`${(n.collisionRate*100).toFixed(2)}%`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.collisionRate,n.collisionRate,!0)}`,children:["Δ: ",o(r.collisionRate,n.collisionRate,"percent")]})})]})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Runtime Analysis"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Runtime/Shot"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((v=r.runtimePerShot)==null?void 0:v.toFixed(3))||"N/A"," ms"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((m=n.runtimePerShot)==null?void 0:m.toFixed(3))||"N/A"," ms"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(r.runtimePerShot,n.runtimePerShot,!0)}`,children:["Δ: ",o(r.runtimePerShot,n.runtimePerShot,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Queue Time"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((y=e.event.execution.queue_ms)==null?void 0:y.toLocaleString())||"N/A"," ms"]})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsxs("span",{className:"text-lg font-bold text-white",children:[((b=t.event.execution.queue_ms)==null?void 0:b.toLocaleString())||"N/A"," ms"]})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(e.event.execution.queue_ms,t.event.execution.queue_ms,!0)}`,children:["Δ: ",o(e.event.execution.queue_ms,t.event.execution.queue_ms,"ms")]})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Classification"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white capitalize",children:r.runtimeClassification||"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white capitalize",children:n.runtimeClassification||"N/A"})]})]})]})]})]}),(i["qc.time.cpu_s"]!=null||a["qc.time.cpu_s"]!=null||i["qc.time.qpu_s"]!=null||a["qc.time.qpu_s"]!=null||i["qc.time.queue_s"]!=null||a["qc.time.queue_s"]!=null||i["qc.time.post_processing_s"]!=null||a["qc.time.post_processing_s"]!=null)&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2 text-white",children:"Execution time breakdown"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Provider-reported CPU, QPU, queue, and post-processing time (seconds). Shown when the backend supplies this metadata."}),c.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[(i["qc.time.cpu_s"]!=null||a["qc.time.cpu_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"CPU"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.cpu_s"]!=null?`${Number(i["qc.time.cpu_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.cpu_s"]!=null?`${Number(a["qc.time.cpu_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.cpu_s"],a["qc.time.cpu_s"],!0)}`,children:["Δ: ",o(i["qc.time.cpu_s"],a["qc.time.cpu_s"],"s")]})})]}),(i["qc.time.qpu_s"]!=null||a["qc.time.qpu_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"QPU"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.qpu_s"]!=null?`${Number(i["qc.time.qpu_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.qpu_s"]!=null?`${Number(a["qc.time.qpu_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.qpu_s"],a["qc.time.qpu_s"],!0)}`,children:["Δ: ",o(i["qc.time.qpu_s"],a["qc.time.qpu_s"],"s")]})})]}),(i["qc.time.queue_s"]!=null||a["qc.time.queue_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Queue (provider)"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.queue_s"]!=null?`${Number(i["qc.time.queue_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.queue_s"]!=null?`${Number(a["qc.time.queue_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.queue_s"],a["qc.time.queue_s"],!0)}`,children:["Δ: ",o(i["qc.time.queue_s"],a["qc.time.queue_s"],"s")]})})]}),(i["qc.time.post_processing_s"]!=null||a["qc.time.post_processing_s"]!=null)&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold text-dark-text-muted uppercase tracking-wide mb-2",children:"Post-processing"}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-primary font-medium",children:"Run A:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:i["qc.time.post_processing_s"]!=null?`${Number(i["qc.time.post_processing_s"]).toFixed(2)} s`:"N/A"})]}),c.jsxs("div",{className:"flex items-baseline gap-2",children:[c.jsx("span",{className:"text-xs text-success font-medium",children:"Run B:"}),c.jsx("span",{className:"text-lg font-bold text-white",children:a["qc.time.post_processing_s"]!=null?`${Number(a["qc.time.post_processing_s"]).toFixed(2)} s`:"N/A"})]})]}),c.jsx("div",{className:"mt-2 pt-2 border-t border-dark-border",children:c.jsxs("div",{className:`text-sm font-semibold ${s(i["qc.time.post_processing_s"],a["qc.time.post_processing_s"],!0)}`,children:["Δ: ",o(i["qc.time.post_processing_s"],a["qc.time.post_processing_s"],"s")]})})]})]})]})]})}function ile({runA:e,runB:t}){var r,n,i,a;return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Measurement Results Comparison"}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:e.label}),c.jsx(Bg,{counts:((n=(r=e.event.artifacts)==null?void 0:r.counts)==null?void 0:n.histogram)||{}})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:t.label}),c.jsx(Bg,{counts:((a=(i=t.event.artifacts)==null?void 0:i.counts)==null?void 0:a.histogram)||{}})]})]})]})}function ale({runA:e,runB:t}){const r=k.useMemo(()=>ec(e.event,e.analysis),[e]),n=k.useMemo(()=>ec(t.event,t.analysis),[t]),i=[{category:"Top-1",[e.label]:r.top1Probability?r.top1Probability*100:0,[t.label]:n.top1Probability?n.top1Probability*100:0},{category:"Top-5",[e.label]:r.top5Probability?r.top5Probability*100:0,[t.label]:n.top5Probability?n.top5Probability*100:0},{category:"Top-10",[e.label]:r.top10Probability?r.top10Probability*100:0,[t.label]:n.top10Probability?n.top10Probability*100:0}];return!r.top1Probability&&!n.top1Probability?null:c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Top-K Dominance Comparison"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Probability mass in top states. Higher values indicate better algorithm convergence."}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:i,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"category",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Probability (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"},formatter:a=>[`${a.toFixed(3)}%`,"Probability"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(or,{dataKey:e.label,fill:"#3b82f6",radius:[8,8,0,0]}),c.jsx(or,{dataKey:t.label,fill:"#10b981",radius:[8,8,0,0]})]})})]})}function ole({runA:e,runB:t}){const r=k.useMemo(()=>{var a;return{entropy:(a=e.analysis.metrics)==null?void 0:a["qc.quality.shannon_entropy_bits"],entropyRatio:void 0}},[e]),n=k.useMemo(()=>{var a;return{entropy:(a=t.analysis.metrics)==null?void 0:a["qc.quality.shannon_entropy_bits"],entropyRatio:void 0}},[t]);if(r.entropy===void 0&&n.entropy===void 0)return null;const i=[{metric:"Shannon Entropy",[e.label]:r.entropy||0,[t.label]:n.entropy||0}];return c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Entropy Comparison"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Shannon entropy measures the randomness/uniformity of measurement distributions."}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:i,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"metric",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Entropy (bits)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"},formatter:a=>[`${a.toFixed(4)} bits`,"Entropy"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(or,{dataKey:e.label,fill:"#3b82f6",radius:[8,8,0,0]}),c.jsx(or,{dataKey:t.label,fill:"#10b981",radius:[8,8,0,0]})]})})]})}function sle(){const[e,t]=Ah(),{data:r=[],isLoading:n}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e3}),staleTime:5e3}),[i,a]=k.useState(()=>e.get("runA")||""),[o,s]=k.useState(()=>e.get("runB")||"");k.useEffect(()=>{var g,x;if(r.length>0&&!i&&!o&&!e.get("runA")&&!e.get("runB")){const S=((g=r[0])==null?void 0:g.run_id)||"",w=r.length>1?((x=r[1])==null?void 0:x.run_id)||"":S;a(S),s(w),t({runA:S,runB:w},{replace:!0})}},[r,i,o,e,t]),k.useEffect(()=>{const g=new URLSearchParams;i&&g.set("runA",i),o&&g.set("runB",o),t(g,{replace:!0})},[i,o,t]);const l=r.find(g=>g.run_id===i),u=r.find(g=>g.run_id===o),f=(l==null?void 0:l.project)||"default",d=(u==null?void 0:u.project)||"default",{data:h,isLoading:p}=Qe({queryKey:["run",i],queryFn:()=>Ye.getRun(f,i),enabled:!!i,retry:2}),{data:v,isLoading:m}=Qe({queryKey:["run",o],queryFn:()=>Ye.getRun(d,o),enabled:!!o,retry:2});if(n)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading runs..."});const y=p||m,b=h&&v;return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Compare Runs"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Select two runs to compare metrics, quality, and performance"})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx(rP,{runs:r,value:i,onChange:a,label:"Run A",placeholder:"Search for first run..."}),c.jsx(rP,{runs:r,value:o,onChange:s,label:"Run B",placeholder:"Search for second run..."})]}),y&&c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading run data..."}),!y&&b&&i&&o&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsx(nP,{event:h.event,runId:i,label:"Run A"}),c.jsx(nP,{event:v.event,runId:o,label:"Run B"})]}),c.jsx(nle,{runA:h,runB:v}),c.jsx(ale,{runA:{event:h.event,analysis:h.analysis,runId:i,label:"Run A"},runB:{event:v.event,analysis:v.analysis,runId:o,label:"Run B"}}),c.jsx(ole,{runA:{analysis:h.analysis,runId:i,label:"Run A"},runB:{analysis:v.analysis,runId:o,label:"Run B"}}),c.jsx(ile,{runA:{event:h.event,runId:i,label:"Run A"},runB:{event:v.event,runId:o,label:"Run B"}})]}),!y&&!b&&(i||o)&&c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Please select both runs to compare"})]})}function lle({runs:e}){var i;const t=mt(),n=((i=Qe({queryKey:["runs-analyses",e.map(a=>a.run_id)],queryFn:async()=>(await Promise.all(e.slice(0,50).map(async o=>{const s=await Ye.getRun(o.project,o.run_id).catch(()=>null);return s?{run:o,res:s}:null}))).filter(Boolean)}).data)==null?void 0:i.map(({run:a,res:o})=>{var u,f,d,h;const s=(f=(u=o==null?void 0:o.analysis)==null?void 0:u.metrics)==null?void 0:f["qc.circuit.depth.post"],l=(h=(d=o==null?void 0:o.analysis)==null?void 0:d.metrics)==null?void 0:h["qc.quality.success_probability"];return s&&l!==void 0?{depth:s,success:l*100,backend:a.backend_name,runId:a.run_id,project:a.project}:null}).filter(Boolean))||[];return n.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(OT,{data:n,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"depth",name:"Circuit Depth",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Circuit Depth",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"success",name:"Success Rate",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Success Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{cursor:{strokeDasharray:"3 3"},contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"}}),c.jsx(tl,{dataKey:"success",fill:"#3b82f6",onClick:a=>{const o=a==null?void 0:a.payload;o!=null&&o.runId&&t(`/runs/${o.runId}`)},style:{cursor:"pointer"},children:n.map((a,o)=>c.jsx(vr,{fill:"#3b82f6"},`cell-${o}`))})]})})}function ule({runs:e}){var i;const t=mt(),n=((i=Qe({queryKey:["runs-analyses-cost",e.map(a=>a.run_id)],queryFn:async()=>(await Promise.all(e.slice(0,50).map(async o=>{const s=await Ye.getRun(o.project,o.run_id).catch(()=>null);return s?{run:o,res:s}:null}))).filter(Boolean)}).data)==null?void 0:i.map(({run:a,res:o})=>{var u,f,d,h;const s=(f=(u=o==null?void 0:o.analysis)==null?void 0:u.metrics)==null?void 0:f["qc.cost.estimated_usd"],l=(h=(d=o==null?void 0:o.analysis)==null?void 0:d.metrics)==null?void 0:h["qc.quality.success_probability"];return s&&s>0&&l!==void 0?{cost:s,success:l*100,backend:a.backend_name,runId:a.run_id,project:a.project}:null}).filter(Boolean))||[];return n.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No cost data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(OT,{data:n,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"cost",name:"Cost (USD)",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Cost (USD)",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"success",name:"Success Rate",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Success Rate (%)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{cursor:{strokeDasharray:"3 3"},contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"}}),c.jsx(tl,{dataKey:"success",fill:"#8b5cf6",onClick:a=>{const o=a==null?void 0:a.payload;o!=null&&o.runId&&t(`/runs/${o.runId}`)},style:{cursor:"pointer"},children:n.map((a,o)=>c.jsx(vr,{fill:"#8b5cf6"},`cell-${o}`))})]})})}function cle({runs:e}){const t=k.useMemo(()=>{const n=e.reduce((i,a)=>(i[a.backend_name]||(i[a.backend_name]={success:0,total:0}),i[a.backend_name].total++,a.status==="success"&&i[a.backend_name].success++,i),{});return Object.entries(n).map(([i,a])=>({backend:i,successRate:a.total>0?a.success/a.total*100:0,totalRuns:a.total}))},[e]);if(t.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const r=Math.max(...t.map(n=>n.successRate));return c.jsx("div",{className:"space-y-4",children:t.map(n=>c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("div",{className:"w-32 text-sm text-dark-text",children:n.backend}),c.jsxs("div",{className:"flex-1 h-8 bg-dark-bg rounded-full overflow-hidden relative",children:[c.jsx("div",{className:"h-full transition-all",style:{width:`${n.successRate/r*100}%`,backgroundColor:n.successRate>70?"#10b981":n.successRate>40?"#f59e0b":"#ef4444"}}),c.jsxs("div",{className:"absolute inset-0 flex items-center justify-center text-xs font-semibold text-dark-text",children:[n.successRate.toFixed(1),"% (",n.totalRuns," runs)"]})]})]},n.backend))})}function Um({value:e,label:t,max:r=100}){const n=Math.min(e/r*100,100),i=2*Math.PI*90,a=i,o=i-n/100*i,s=()=>n>=70?"#10b981":n>=40?"#f59e0b":"#ef4444";return c.jsx("div",{className:"flex flex-col items-center justify-center",children:c.jsxs("div",{className:"relative",children:[c.jsxs("svg",{width:"200",height:"200",className:"transform -rotate-90",children:[c.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:"#334155",strokeWidth:"12"}),c.jsx("circle",{cx:"100",cy:"100",r:"90",fill:"none",stroke:s(),strokeWidth:"12",strokeDasharray:a,strokeDashoffset:o,strokeLinecap:"round",className:"transition-all duration-500"})]}),c.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[c.jsx("div",{className:"text-4xl font-bold text-white",children:e.toFixed(1)}),c.jsx("div",{className:"text-sm text-dark-text-muted",children:t})]})]})})}function fle(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function dle({runs:e,baseFilters:t}){const r=mt(),n=k.useMemo(()=>{const o=new Map;e.forEach(u=>{if(!u.created_at)return;const f=Yn(_T(uh(u.created_at)),"yyyy-MM-dd"),d=u.provider;o.has(f)||o.set(f,new Map);const h=o.get(f);h.has(d)||h.set(d,{total:0,count:0});const p=h.get(d);p.count+=1});const s=Array.from(o.keys()).sort(),l=Array.from(new Set(e.map(u=>u.provider))).filter(Boolean);return s.map(u=>{const f={dateLabel:Yn(uh(u),"MMM dd"),dateIso:u},d=o.get(u);return l.forEach(h=>{const p=d==null?void 0:d.get(h);p&&p.count>0&&(f[h]=p.count)}),f})},[e]);if(n.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const i=Array.from(new Set(e.map(o=>o.provider))).filter(Boolean),a=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#14b8a6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(_p,{data:n,onClick:o=>{var f,d,h;const s=o==null?void 0:o.activePayload;if(!s||s.length===0)return;const l=(f=s[0])==null?void 0:f.dataKey,u=(h=(d=s[0])==null?void 0:d.payload)==null?void 0:h.dateIso;!l||!u||r(`/runs-filtered${fle(t,{provider:String(l),startDate:`${u}T00:00:00Z`,endDate:`${u}T23:59:59Z`})}`)},children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"dateLabel",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Runs per Day",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"}}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),i.map((o,s)=>c.jsx(Ji,{type:"monotone",dataKey:o,stroke:a[s%a.length],strokeWidth:2,dot:{r:4},activeDot:{r:6},style:{cursor:"pointer"}},o))]})})}function hle(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function ple({runs:e,baseFilters:t}){const r=mt(),n=e.slice(0,50),i=Qe({queryKey:["run-details-analytics",n.map(o=>o.run_id)],queryFn:async()=>(await Promise.all(n.map(async s=>{try{const l=await Ye.getRun(s.project,s.run_id);return{run_id:s.run_id,created_at:s.created_at,runtime_ms:l.event.execution.runtime_ms||0,provider:s.provider}}catch{return null}}))).filter(Boolean),enabled:n.length>0}),a=k.useMemo(()=>{if(!i.data)return[];const o=new Map;return i.data.forEach(s=>{if(!s)return;const l=Yn(_T(uh(s.created_at)),"yyyy-MM-dd");o.has(l)||o.set(l,{total:0,count:0});const u=o.get(l);u.total+=s.runtime_ms||0,u.count+=1}),Array.from(o.entries()).map(([s,l])=>({dateLabel:Yn(uh(s),"MMM dd"),dateIso:s,avgRuntime:l.count>0?l.total/l.count:0})).sort((s,l)=>s.dateIso.localeCompare(l.dateIso))},[i.data]);return i.isLoading?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading runtime data..."}):a.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No runtime data available"}):c.jsx(tt,{width:"100%",height:400,children:c.jsxs(PT,{data:a,onClick:o=>{var u,f;const s=o==null?void 0:o.activePayload;if(!s||s.length===0)return;const l=(f=(u=s[0])==null?void 0:u.payload)==null?void 0:f.dateIso;l&&r(`/runs-filtered${hle(t,{startDate:`${l}T00:00:00Z`,endDate:`${l}T23:59:59Z`})}`)},children:[c.jsx("defs",{children:c.jsxs("linearGradient",{id:"colorRuntime",x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"5%",stopColor:"#3b82f6",stopOpacity:.8}),c.jsx("stop",{offset:"95%",stopColor:"#3b82f6",stopOpacity:.1})]})}),c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{dataKey:"dateLabel",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Avg Runtime (ms)",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},formatter:o=>[`${o.toFixed(0)} ms`,"Average Runtime"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}}),c.jsx(wn,{type:"monotone",dataKey:"avgRuntime",stroke:"#3b82f6",strokeWidth:2,fillOpacity:1,fill:"url(#colorRuntime)",style:{cursor:"pointer"}})]})})}function iP(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function mle({runs:e,baseFilters:t}){const r=mt(),{chartData:n,backends:i}=k.useMemo(()=>{const o=new Map;e.forEach(p=>{const v=p.backend_name;o.has(v)||o.set(v,{total:0,success:0,totalShots:0});const m=o.get(v);m.total+=1,p.status==="success"&&(m.success+=1),m.totalShots+=p.shots||0});const s=Array.from(o.entries()).sort((p,v)=>v[1].total-p[1].total).slice(0,5),l=Math.max(...s.map(([p,v])=>v.total),1),u=Math.max(...s.map(([p,v])=>v.totalShots/v.total),1),f=s.map(([p,v])=>({backend:p.length>15?p.substring(0,15)+"...":p,"Success Rate":v.total>0?v.success/v.total*100:0,"Total Runs":v.total/l*100,"Avg Shots":v.total>0?Math.min(v.totalShots/v.total/u*100,100):0}));return{chartData:["Success Rate","Total Runs","Avg Shots"].map(p=>{const v={metric:p};return f.forEach(m=>{v[m.backend]=m[p]}),v}),backends:f.map(p=>p.backend)}},[e]);if(n.length===0||i.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const a=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(joe,{data:n,children:[c.jsx(m2,{stroke:"#334155"}),c.jsx(Js,{dataKey:"metric",tick:{fill:"#94a3b8",fontSize:12}}),c.jsx(Zs,{angle:90,domain:[0,100],tick:{fill:"#94a3b8",fontSize:10}}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px"},labelStyle:{color:"#e2e8f0"}}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0",cursor:"pointer"},onClick:()=>r(`/runs-filtered${iP(t,{type:"backends"})}`)}),i.map((o,s)=>c.jsx(jc,{name:o,dataKey:o,stroke:a[s%a.length],fill:a[s%a.length],fillOpacity:.3,style:{cursor:"pointer"},onClick:()=>r(`/runs-filtered${iP(t,{type:"backends"})}`)},o))]})})}function vle({runs:e}){const t=k.useMemo(()=>{const n={"0-100":0,"101-1K":0,"1K-10K":0,"10K-100K":0,"100K+":0};return e.forEach(i=>{const a=i.shots||0;a<=100?n["0-100"]++:a<=1e3?n["101-1K"]++:a<=1e4?n["1K-10K"]++:a<=1e5?n["10K-100K"]++:n["100K+"]++}),Object.entries(n).filter(([i,a])=>a>0).map(([i,a])=>({name:i,value:a}))},[e]);if(t.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No data available"});const r=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6"];return c.jsx(tt,{width:"100%",height:400,children:c.jsxs(Ql,{children:[c.jsx(yr,{data:t,cx:"50%",cy:"50%",labelLine:!1,label:({name:n,percent:i})=>`${n}: ${(i*100).toFixed(0)}%`,outerRadius:120,fill:"#8884d8",dataKey:"value",children:t.map((n,i)=>c.jsx(vr,{fill:r[i%r.length]},`cell-${i}`))}),c.jsx($e,{contentStyle:{backgroundColor:"#1e293b",border:"1px solid #334155",borderRadius:"8px",color:"#e2e8f0"},labelStyle:{color:"#e2e8f0"},itemStyle:{color:"#e2e8f0"},formatter:n=>[n,"Runs"]}),c.jsx(ar,{wrapperStyle:{color:"#e2e8f0"}})]})})}function qm(e,t){const r=new URLSearchParams,n={...e||{},...t||{}};Object.entries(n).forEach(([a,o])=>{o&&r.set(a,o)});const i=r.toString();return i?`?${i}`:""}function yle({filters:e}){const t=mt(),{data:r=[],isLoading:n}=Qe({queryKey:["runs",e],queryFn:()=>Ye.getRuns({limit:1e3,...e||{}}),staleTime:5e3});if(n)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."});const i=s=>{s==="success"?t(`/runs-filtered${qm(e,{type:"success"})}`):s==="backends"?t(`/runs-filtered${qm(e,{type:"backends"})}`):s==="runs"&&t(`/runs-filtered${qm(e)}`)},a=r.length>0?r.filter(s=>s.status==="success").length/r.length*100:0,o=new Set(r.map(s=>s.backend_name)).size;return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Run Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Comprehensive analysis and trends of quantum run performance"})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-6",children:[c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("success"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Overall Success Rate"}),c.jsx(Um,{value:a,label:"Success Rate"}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view successful runs"})]}),c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("backends"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Active Backends"}),c.jsx(Um,{value:o,label:"Backends",max:Math.max(o,10)}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view backend statistics"})]}),c.jsxs("div",{className:"card cursor-pointer hover:border-primary/50 transition-colors",onClick:()=>i("runs"),children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Total Runs"}),c.jsx(Um,{value:r.length,label:"Runs",max:Math.max(r.length,1e3)}),c.jsx("p",{className:"text-xs text-dark-text-muted mt-2 text-center",children:"Click to view all runs"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Provider Performance Over Time"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Track run volume across different providers over time"}),c.jsx(dle,{runs:r,baseFilters:e})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Average Runtime Trend"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Monitor average execution time trends over time"}),c.jsx(ple,{runs:r,baseFilters:e})]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Backend Multi-Dimensional Analysis"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Compare backends across multiple performance dimensions"}),c.jsx(mle,{runs:r,baseFilters:e})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Circuit Depth vs Success"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Relationship between circuit complexity and success rate"}),c.jsx(lle,{runs:r})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Cost vs Quality Trade-off"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Analyze the balance between execution cost and result quality"}),c.jsx(ule,{runs:r})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shots Distribution"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Distribution of runs by shots range"}),c.jsx(vle,{runs:r})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Backend Performance Heatmap"}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Heatmap showing backend performance patterns"}),c.jsx(cle,{runs:r})]})]})]})}function gle({filters:e}){const t=mt(),[r,n]=k.useState(""),{data:i=[],isLoading:a}=Qe({queryKey:["algorithms"],queryFn:()=>Ye.getAlgorithms()});k.useEffect(()=>{i.length>0&&!r&&n(i[0].name)},[i,r]);const{data:o=[],isLoading:s}=Qe({queryKey:["runs",e,r],queryFn:()=>Ye.getRuns({limit:1e3,...e||{},algorithm:r||void 0}),enabled:!!r}),{data:l=[]}=Qe({queryKey:["runs",e],queryFn:()=>Ye.getRuns({limit:1e3,...e||{}})}),u=o,f=k.useMemo(()=>u.map(x=>x.run_id),[u]),{data:d}=Qe({queryKey:["run-events",f],queryFn:async()=>{const x=new Map,S=u.slice(0,100);return await Promise.all(S.map(async w=>{try{const j=await Ye.getRun(w.project,w.run_id);x.set(w.run_id,j.event)}catch(j){console.error(`Error loading event for ${w.run_id}:`,j)}})),x},enabled:u.length>0&&u.length<=100}),h=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{var O,P,A,E;let w=S.provider;if(d){const N=d.get(S.run_id);(P=(O=N==null?void 0:N.software)==null?void 0:O.sdk)!=null&&P.name?w=N.software.sdk.name:(A=N==null?void 0:N.tags)!=null&&A.sdk&&(w=N.tags.sdk)}x.has(w)||x.set(w,{success:0,total:0,totalRuntime:0,totalShots:0});const j=x.get(w);if(j.total++,S.status==="success"&&j.success++,j.totalShots+=S.shots,d){const N=d.get(S.run_id);(E=N==null?void 0:N.execution)!=null&&E.runtime_ms&&(j.totalRuntime+=N.execution.runtime_ms)}}),Array.from(x.entries()).map(([S,w])=>({sdk:S,successRate:w.total>0?w.success/w.total*100:0,avgShots:w.total>0?w.totalShots/w.total:0,avgRuntime:w.total>0&&w.totalRuntime>0?w.totalRuntime/w.total:0,totalRuns:w.total})).sort((S,w)=>w.totalRuns-S.totalRuns)},[u,d]),p=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{const w=new Date(S.created_at).toISOString().split("T")[0];x.has(w)||x.set(w,{success:0,total:0});const j=x.get(w);j.total++,S.status==="success"&&j.success++}),Array.from(x.entries()).map(([S,w])=>({date:S,successRate:w.total>0?w.success/w.total*100:0,totalRuns:w.total})).sort((S,w)=>S.date.localeCompare(w.date)).slice(-30)},[u]),v=k.useMemo(()=>{const x=new Map;return u.forEach(S=>{const w=`${S.provider}/${S.backend_name}`;x.has(w)||x.set(w,{success:0,total:0});const j=x.get(w);j.total++,S.status==="success"&&j.success++}),Array.from(x.entries()).map(([S,w])=>({backend:S,successRate:w.total>0?w.success/w.total*100:0,totalRuns:w.total})).sort((S,w)=>w.totalRuns-S.totalRuns).slice(0,10)},[u]),m=k.useMemo(()=>{if(!d||u.length===0)return null;const x={vqe:{energies:[]},grover:{targetSuccessRates:[]},optimization:{approximationRatios:[]}};return u.slice(0,50).forEach(w=>{var A;const j=d.get(w.run_id);if(!((A=j==null?void 0:j.program)!=null&&A.benchmark_params))return;const O=j.program.benchmark_params,P=r.toLowerCase();P.includes("vqe")&&O.energy!==void 0&&x.vqe.energies.push(O.energy),P.includes("grover")&&O.expected_success_rate!==void 0&&x.grover.targetSuccessRates.push(O.expected_success_rate),(P.includes("optimization")||P.includes("qubo")||P.includes("ising"))&&O.approximation_ratio!==void 0&&x.optimization.approximationRatios.push(O.approximation_ratio)}),x.vqe.energies.length>0||x.grover.targetSuccessRates.length>0||x.optimization.approximationRatios.length>0?x:null},[u,d,r]),y=l.length>0?l.filter(x=>x.status==="success").length/l.length*100:0,b=u.length>0?u.filter(x=>x.status==="success").length/u.length*100:0,g=["#3b82f6","#8b5cf6","#10b981","#f59e0b","#ef4444","#06b6d4"];return a?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading algorithms..."}):i.length===0?c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Algorithm Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:h-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Algorithm-specific performance analysis and benchmarking"})]}),c.jsxs("div",{className:"card text-center py-12",children:[c.jsx("h2",{className:"text-xl font-semibold text-white mb-4",children:"No Algorithm-Tagged Runs Found"}),c.jsxs("p",{className:"text-dark-text-muted mb-4",children:["Tag your runs with an ",c.jsx("code",{className:"bg-dark-bg px-2 py-1 rounded text-primary",children:"algorithm"})," tag to see algorithm-specific metrics."]}),c.jsx("p",{className:"text-sm text-dark-text-muted",children:"Example:"}),c.jsx("pre",{className:"bg-dark-bg p-4 rounded-lg text-left text-sm text-dark-text overflow-x-auto mt-4",children:`@observe_run( project="my_project", tags={ "sdk": "qiskit", "algorithm": "vqe" # Add this tag } -)`})]})]}):c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Algorithm Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:h-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Algorithm-specific performance analysis and cross-SDK comparison"})]}),c.jsxs("div",{className:"card",children:[c.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Select Algorithm"}),c.jsx("select",{value:r,onChange:x=>n(x.target.value),className:"bg-dark-bg border border-dark-border rounded-lg px-4 py-2 text-dark-text w-full max-w-md",children:i.map(x=>c.jsxs("option",{value:x.name,children:[x.name," (",x.count," runs)"]},x.name))})]}),r?s?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading algorithm data..."}):u.length===0?c.jsx("div",{className:"card text-center py-12",children:c.jsx("p",{className:"text-dark-text-muted",children:"No runs found for selected algorithm with current filters."})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Total Runs"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:u.length})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Success Rate"}),c.jsxs("p",{className:"text-3xl font-bold text-white",children:[b.toFixed(1),"%"]}),c.jsxs("p",{className:"text-xs text-dark-text-muted mt-1",children:["Overall: ",y.toFixed(1),"%"]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Avg Shots"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:u.length>0?Math.round(u.reduce((x,S)=>x+S.shots,0)/u.length):0})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"SDKs Used"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:h.length})]})]}),h.length>0&&c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Success Rate by SDK/Provider"}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"sdk",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(or,{dataKey:"successRate",fill:"#3b82f6",radius:[4,4,0,0],children:h.map((x,S)=>c.jsx(vr,{fill:g[S%g.length]},`cell-${S}`))})]})})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Average Shots by SDK/Provider"}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"sdk",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(or,{dataKey:"avgShots",fill:"#8b5cf6",radius:[4,4,0,0],children:h.map((x,S)=>c.jsx(vr,{fill:g[S%g.length]},`cell-${S}`))})]})})]})]}),h.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:["Best Performing SDK for ",r]}),c.jsx("div",{className:"flex items-center gap-6",children:h.sort((x,S)=>S.successRate-x.successRate).slice(0,3).map((x,S)=>c.jsx("div",{className:"flex-1",children:c.jsxs("div",{className:`p-4 rounded-lg border-2 ${S===0?"border-primary bg-primary/10":"border-dark-border bg-dark-bg"}`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"text-sm font-medium text-dark-text-muted",children:S===0?"🥇 Best":S===1?"🥈 2nd":"🥉 3rd"}),c.jsxs("span",{className:"text-xs text-dark-text-muted",children:[x.totalRuns," runs"]})]}),c.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:x.sdk}),c.jsxs("div",{className:"text-sm text-dark-text-muted",children:[x.successRate.toFixed(1),"% success rate"]})]})},x.sdk))})]}),p.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:[r," Performance Over Time"]}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(_p,{data:p,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"date",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(Ji,{type:"monotone",dataKey:"successRate",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",r:4},activeDot:{r:6}})]})})]}),v.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:["Backend Performance for ",r]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Runs"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Success Rate"})]})}),c.jsx("tbody",{children:v.map(x=>c.jsxs("tr",{className:"border-b border-dark-border hover:bg-dark-bg/50 cursor-pointer",onClick:()=>t(`/runs-filtered?algorithm=${r}&provider=${x.backend.split("/")[0]}`),children:[c.jsx("td",{className:"py-3 px-4 text-dark-text",children:x.backend}),c.jsx("td",{className:"py-3 px-4 text-right text-dark-text",children:x.totalRuns}),c.jsxs("td",{className:"py-3 px-4 text-right text-dark-text",children:[x.successRate.toFixed(1),"%"]})]},x.backend))})]})})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Algorithm-Specific Metrics"}),m?c.jsxs("div",{className:"space-y-4",children:[r.toLowerCase().includes("vqe")&&m.vqe.energies.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"VQE Energy Values"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Min:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:Math.min(...m.vqe.energies).toFixed(4)})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Max:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:Math.max(...m.vqe.energies).toFixed(4)})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:(m.vqe.energies.reduce((x,S)=>x+S,0)/m.vqe.energies.length).toFixed(4)})]})]})]}),r.toLowerCase().includes("grover")&&m.grover.targetSuccessRates.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Grover's Target Success Rates"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg Expected:"}),c.jsxs("span",{className:"ml-2 text-white font-semibold",children:[(m.grover.targetSuccessRates.reduce((x,S)=>x+S,0)/m.grover.targetSuccessRates.length*100).toFixed(1),"%"]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Actual:"}),c.jsxs("span",{className:"ml-2 text-white font-semibold",children:[b.toFixed(1),"%"]})]})]})]}),(r.toLowerCase().includes("optimization")||r.toLowerCase().includes("qubo")||r.toLowerCase().includes("ising"))&&m.optimization.approximationRatios.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Approximation Ratios"}),c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:(m.optimization.approximationRatios.reduce((x,S)=>x+S,0)/m.optimization.approximationRatios.length).toFixed(3)})]})})]})]}):c.jsxs("div",{className:"text-center py-8 text-dark-text-muted",children:[c.jsxs("p",{className:"mb-2",children:["Add ",c.jsx("code",{className:"bg-dark-bg px-2 py-1 rounded text-primary",children:"benchmark_params"})," to your runs to see algorithm-specific metrics."]}),c.jsx("p",{className:"text-sm",children:"Example: For VQE, include energy values; for Grover's, include target bitstrings."})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:[r," Runs"]}),c.jsx(ch,{runs:u})]})]}):c.jsx("div",{className:"card text-center py-12",children:c.jsx("p",{className:"text-dark-text-muted",children:"Select an algorithm to view metrics."})})]})}function gle(){const{data:e,isLoading:t}=Qe({queryKey:["settings"],queryFn:()=>Ye.getSettings()});return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Settings"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white flex items-center gap-2",children:[c.jsx(aD,{className:"w-5 h-5"}),"Data Directory"]}),t?c.jsx("p",{className:"text-dark-text-muted",children:"Loading..."}):e?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-dark-text-muted mb-2",children:"Current Data Directory:"}),c.jsx("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-3 font-mono text-sm text-dark-text break-all",children:e.data_dir}),e.data_dir==="/data"&&c.jsxs("p",{className:"text-xs text-primary mt-2",children:["🐳 Running in ",c.jsx("strong",{children:"Docker mode"})," - data stored in Docker volume"]})]}),c.jsx("div",{className:"bg-dark-bg/50 border border-dark-border rounded-lg p-4",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Yk,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"space-y-2 text-sm text-dark-text-muted",children:[e.data_dir==="/data"?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-dark-text font-medium",children:"Docker Mode: Data in Docker Volume"}),c.jsxs("p",{className:"text-xs",children:["Data is stored in a Docker volume named ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker_qobserva_data"}),"."]}),c.jsx("p",{className:"text-dark-text font-medium mt-3",children:"How to Access Data:"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["View volume location: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker volume inspect docker_qobserva_data"})]}),c.jsxs("li",{children:["Access from container: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker exec -it docker-collector-1 ls -la /data"})]}),c.jsxs("li",{children:["Copy files out: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker cp docker-collector-1:/data/qobserva.sqlite3 ./"})]})]}),c.jsx("p",{className:"text-dark-text font-medium mt-3",children:"How to Change Data Directory (Docker):"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["Edit ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker/docker-compose.yml"})," and update the volume mount"]}),c.jsxs("li",{children:["Or set ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"QOBSERVA_DATA_DIR"})," in the environment section"]}),c.jsxs("li",{children:["Restart: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"make docker-down && make docker-up"})]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-dark-text font-medium",children:"How to Change Data Directory:"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["Set the ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"QOBSERVA_DATA_DIR"})," environment variable to your desired path"]}),c.jsxs("li",{children:["Stop QObserva: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"qobserva down"})]}),c.jsxs("li",{children:["Start QObserva: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"qobserva up"})]})]})]}),c.jsxs("p",{className:"text-xs mt-3 pt-3 border-t border-dark-border",children:[c.jsx("strong",{children:"Note:"})," The data directory cannot be changed at runtime. All runs, database, and artifacts are stored in this directory."]})]})]})}),c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("p",{className:"text-xs text-dark-text-muted mb-2",children:"Data Structure:"}),c.jsxs("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-3 font-mono text-xs text-dark-text",children:[c.jsxs("div",{children:[e.data_dir,"/"]}),c.jsxs("div",{className:"ml-4",children:["├── qobserva.sqlite3 ",c.jsx("span",{className:"text-dark-text-muted",children:"(database)"})]}),c.jsx("div",{className:"ml-4",children:"└── artifacts/"}),c.jsxs("div",{className:"ml-8",children:["├── ","{project}/"]}),c.jsxs("div",{className:"ml-12",children:["└── ","{run_id}/"]}),c.jsx("div",{className:"ml-16",children:"├── event.json"}),c.jsx("div",{className:"ml-16",children:"└── analysis.json"})]})]})]}):c.jsx("p",{className:"text-dark-text-muted",children:"Unable to load settings."})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"About"}),c.jsxs("div",{className:"space-y-2 text-sm text-dark-text-muted",children:[c.jsx("p",{children:c.jsxs("strong",{className:"text-dark-text",children:["QObserva v",(e==null?void 0:e.qobserva_version)||"unknown"]})}),c.jsx("p",{children:"Local-first observability and benchmarking for quantum program executions."}),c.jsxs("p",{className:"text-xs",children:["Components: agent v",(e==null?void 0:e.qobserva_agent_version)||"unknown"," | collector v",(e==null?void 0:e.qobserva_collector_version)||"unknown"," | local v",(e==null?void 0:e.qobserva_local_version)||"unknown"]}),c.jsxs("ul",{className:"list-disc list-inside space-y-1 mt-4",children:[c.jsx("li",{children:"Standardized run telemetry"}),c.jsx("li",{children:"Metrics and insights generation"}),c.jsx("li",{children:"Multi-SDK support (Qiskit, Braket, Cirq, PennyLane, pyQuil, D-Wave)"})]})]})]})]})}function xle({runs:e}){const t=mt(),r=k.useMemo(()=>{const i=new Map;return e.forEach(a=>{const o=a.backend_name;i.has(o)||i.set(o,{backend_name:a.backend_name,provider:a.provider,total:0,success:0,failed:0,cancelled:0});const s=i.get(o);s.total++,a.status==="success"?s.success++:a.status==="failed"?s.failed++:a.status==="cancelled"&&s.cancelled++}),Array.from(i.values()).sort((a,o)=>o.total-a.total)},[e]),n=i=>{t(`/?provider=${encodeURIComponent(i)}`)};return r.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No backend data available"}):c.jsx("div",{children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend Name"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Total Runs"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Success"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Failed"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Cancelled"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Success Rate"})]})}),c.jsx("tbody",{children:r.map(i=>{const a=i.total>0?i.success/i.total*100:0;return c.jsxs("tr",{onClick:()=>n(i.provider),className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 cursor-pointer transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text font-medium",children:i.backend_name}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:i.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text text-right",children:i.total.toLocaleString()}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-success font-medium",children:i.success.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-error font-medium",children:i.failed.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-dark-text-muted font-medium",children:i.cancelled.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsxs("span",{className:`text-sm font-semibold ${a>=80?"text-success":a>=50?"text-warning":"text-error"}`,children:[a.toFixed(1),"%"]})})]},i.backend_name)})})]})})})}function ble({backendStats:e}){const t=()=>{BI(e,"qobserva-backends")};return c.jsxs("button",{onClick:t,className:"btn-secondary flex items-center gap-2 ml-auto",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}const iP={success:"#10b981",failed:"#ef4444",cancelled:"#6b7280",default:"#3b82f6"};function wle({runs:e}){const t=mt(),r=k.useMemo(()=>e.sort((o,s)=>new Date(o.created_at).getTime()-new Date(s.created_at).getTime()).map(o=>({x:new Date(o.created_at).getTime(),y:o.shots,shots:o.shots,runId:o.run_id,status:o.status,project:o.project,backend:o.backend_name,createdAt:o.created_at,formattedDate:new Date(o.created_at).toLocaleString()})),[e]),n=o=>{o&&o.runId&&t(`/runs/${o.runId}`)},i=({active:o,payload:s})=>{if(o&&s&&s.length){const l=s[0].payload;return c.jsxs("div",{className:"bg-dark-surface border border-primary/30 rounded-lg p-3 shadow-xl z-50 min-w-[200px]",children:[c.jsx("p",{className:"text-white font-semibold mb-2",children:l.formattedDate||new Date(l.createdAt).toLocaleString()}),c.jsxs("div",{className:"space-y-1 text-sm",children:[c.jsxs("p",{className:"text-dark-text-muted",children:["Shots: ",c.jsx("span",{className:"text-primary font-semibold",children:l.shots.toLocaleString()})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Status: ",c.jsx("span",{className:"text-white font-medium capitalize",children:l.status})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Backend: ",c.jsx("span",{className:"text-white font-medium",children:l.backend})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Project: ",c.jsx("span",{className:"text-white font-medium",children:l.project})]}),c.jsx("p",{className:"text-xs text-primary/70 mt-2 pt-2 border-t border-dark-border cursor-pointer",children:"Click dot to view details"})]})]})}return null};if(r.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No shots data available"});const a=o=>{const{cx:s,cy:l,payload:u}=o,f=iP[u==null?void 0:u.status]||iP.default;return c.jsxs("g",{onClick:()=>n(u),style:{cursor:"pointer"},children:[c.jsx("circle",{cx:s||0,cy:l||0,r:10,fill:"transparent",pointerEvents:"all"}),c.jsx("circle",{cx:s||0,cy:l||0,r:6,fill:f,stroke:"#1e293b",strokeWidth:2,className:"hover:r-7 hover:stroke-primary transition-all duration-150"})]})};return c.jsx(tt,{width:"100%",height:500,children:c.jsxs(_p,{data:r,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"x",name:"Time",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},domain:["dataMin","dataMax"],scale:"time",tickFormatter:o=>new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),label:{value:"Time",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"y",name:"Shots",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Shots",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{content:c.jsx(i,{}),cursor:{strokeDasharray:"3 3",stroke:"#3b82f6"}}),c.jsx(Ji,{type:"monotone",dataKey:"shots",stroke:"#3b82f6",strokeWidth:2,strokeOpacity:.5,dot:a,activeDot:{r:8,fill:"#3b82f6",stroke:"#1e293b",strokeWidth:2,style:{cursor:"pointer"}},onClick:o=>{o&&o.payload&&n(o.payload)},style:{cursor:"pointer"}})]})})}function Sle(){const[e]=Ah(),t=mt(),r=e.get("type")||"all",n=k.useMemo(()=>{const l={limit:1e4},u=e.get("project"),f=e.get("provider"),d=e.get("status"),h=e.get("startDate"),p=e.get("endDate");return u&&(l.project=u),f&&(l.provider=f),h&&(l.startDate=h),p&&(l.endDate=p),d?l.status=d:r==="success"?l.status="success":r==="failed"&&(l.status="failed"),l},[e,r]),{data:i=[],isLoading:a}=Qe({queryKey:["runs",n],queryFn:()=>Ye.getRuns(n),staleTime:0}),o=k.useMemo(()=>{const l=new Map;return i.forEach(u=>{const f=u.backend_name;l.has(f)||l.set(f,{backend_name:u.backend_name,provider:u.provider,total:0,success:0,failed:0,cancelled:0});const d=l.get(f);d.total++,u.status==="success"?d.success++:u.status==="failed"?d.failed++:u.status==="cancelled"&&d.cancelled++}),Array.from(l.values()).sort((u,f)=>f.total-u.total)},[i]);let s="All Runs";return r==="success"?s="Successful Runs":r==="failed"?s="Failed Runs":r==="shots"?s="Runs by Shots":r==="backends"?s="Runs by Backend":status&&(s=`${status.charAt(0).toUpperCase()+status.slice(1)} Runs`),a?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."}):r==="shots"?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs)"]})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shots Distribution"}),c.jsx(wle,{runs:i})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Runs List"}),c.jsx(Lg,{runs:i,title:"shots-runs"})]}),c.jsx(ch,{runs:i,highlightShots:!0,title:"shots-runs"})]})]}):r==="backends"?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs across ",new Set(i.map(l=>l.backend_name)).size," backends)"]})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Backend Statistics"}),c.jsx(ble,{backendStats:o})]}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Click on a backend row to filter by provider on the Home dashboard"}),c.jsx(xle,{runs:i})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs)"]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:s}),c.jsx(Lg,{runs:i,title:s.toLowerCase().replace(/\s+/g,"-")})]}),c.jsx(ch,{runs:i,title:s.toLowerCase().replace(/\s+/g,"-")})]})]})}function jle(){const[e,t]=k.useState(""),r=mt(),{data:n=[],isLoading:i}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e4}),staleTime:5e3}),a=n.filter(l=>{if(!e.trim())return!1;const u=e.toLowerCase();return l.run_id.toLowerCase().includes(u)||l.project.toLowerCase().includes(u)||l.provider.toLowerCase().includes(u)||l.backend_name.toLowerCase().includes(u)||l.status.toLowerCase().includes(u)}),o=l=>{r(`/runs/${l}`)},s=l=>{l.key==="Enter"&&a.length===1&&o(a[0].run_id)};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Search Runs"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Search for runs by ID, project, provider, backend, or status"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"relative",children:[c.jsx(Yf,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-dark-text-muted",size:20}),c.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value),onKeyPress:s,placeholder:"Enter run ID, project, provider, backend, or status...",className:"w-full bg-dark-bg border border-dark-border rounded-lg pl-12 pr-4 py-3 text-dark-text text-lg focus:outline-none focus:border-primary/50",autoFocus:!0})]}),e&&c.jsxs("p",{className:"text-sm text-dark-text-muted mt-3",children:[i?"Searching...":`${a.length} run${a.length!==1?"s":""} found`,a.length===1&&" (Press Enter to view)"]})]}),e&&c.jsx("div",{className:"card",children:i?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Searching..."}):a.length===0?c.jsxs("div",{className:"text-center py-12",children:[c.jsx("p",{className:"text-dark-text-muted mb-2",children:"No runs found"}),c.jsx("p",{className:"text-sm text-dark-text-muted",children:"Try a different search term"})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"Results"}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Run ID"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Time"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Project"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Status"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Shots"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Action"})]})}),c.jsx("tbody",{children:a.slice(0,100).map(l=>c.jsxs("tr",{className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",onClick:u=>u.stopPropagation(),children:c.jsx(Ap,{runId:l.run_id})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:Yn(new Date(l.created_at),"MMM dd, HH:mm")}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.project}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.backend_name}),c.jsx("td",{className:"py-3 px-4",children:c.jsx("span",{className:`px-2 py-1 rounded text-xs font-semibold ${l.status==="success"?"bg-success/20 text-success":l.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:l.status})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.shots.toLocaleString()}),c.jsx("td",{className:"py-3 px-4",children:c.jsxs("button",{onClick:()=>o(l.run_id),className:"flex items-center gap-1 text-primary hover:text-primary/80 text-sm transition-colors",title:"View run details",children:["View",c.jsx(XR,{size:14})]})})]},l.run_id))})]})}),a.length>100&&c.jsx("p",{className:"text-sm text-dark-text-muted mt-4 text-center",children:"Showing first 100 results. Refine your search to see more."})]})}),!e&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"How to Search"}),c.jsxs("ul",{className:"space-y-2 text-sm text-dark-text-muted",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Run ID:"})," Enter the full or partial run ID"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Project:"})," Search by project name"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Provider:"}),' Filter by provider (e.g., "ibm", "aws")']}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Backend:"})," Search by backend name"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Status:"}),' Filter by status (e.g., "success", "failed")']})]})]})]})}function Ole(e,t){const r=new URLSearchParams;return r.set("type",e),t.project&&r.set("project",t.project),t.startDate&&r.set("startDate",t.startDate),t.endDate&&r.set("endDate",t.endDate),`/report?${r.toString()}`}function Ple(){const e=mt(),[t,r]=k.useState("executive"),[n,i]=k.useState(""),[a,o]=k.useState(""),[s,l]=k.useState(""),u=k.useMemo(()=>({required:["Date range (start + end)"],optional:["Project"],notUsed:["Provider","Status (reports are intentionally general)"]}),[]),f=!!(a&&s),d=()=>{const h=Ole(t,{project:n||void 0,startDate:a?new Date(a+"T00:00:00Z").toISOString().replace(/\.\d{3}Z$/,"Z"):void 0,endDate:s?new Date(s+"T23:59:59Z").toISOString().replace(/\.\d{3}Z$/,"Z"):void 0});window.open(h,"_blank","noopener,noreferrer")};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Generate Report"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Generate a PDF via browser print. Choose a report type, set filters, then print/save as PDF."})]}),c.jsxs("div",{className:"card space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Report Type"}),c.jsxs("select",{value:t,onChange:h=>r(h.target.value),className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm",children:[c.jsx("option",{value:"executive",children:"Executive Summary"}),c.jsx("option",{value:"provider_backend",children:"Provider/Backend Performance"}),c.jsx("option",{value:"quality_anomaly",children:"Run Quality / Anomaly"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Project (optional)"}),c.jsx("input",{value:n,onChange:h=>i(h.target.value),placeholder:"e.g. pennylane_test",className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Start Date (required)"}),c.jsx("input",{type:"date",value:a,onChange:h=>o(h.target.value),style:{colorScheme:"light"},className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm qobserva-date-input"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"End Date (required)"}),c.jsx("input",{type:"date",value:s,onChange:h=>l(h.target.value),style:{colorScheme:"light"},className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm qobserva-date-input"})]})]}),c.jsxs("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-4",children:[c.jsx("div",{className:"text-sm font-semibold text-white mb-2",children:"Requirements"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Required"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.required.map(h=>c.jsxs("li",{children:["- ",h]},h))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Optional"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.optional.map(h=>c.jsxs("li",{children:["- ",h]},h))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Not used"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.notUsed.map(h=>c.jsxs("li",{children:["- ",h]},h))})]})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:()=>e(-1),className:"btn-secondary",children:"Back"}),c.jsx("button",{onClick:d,disabled:!f,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Open Report (Print/PDF)"}),!f&&c.jsx("div",{className:"text-sm text-dark-text-muted",children:"Select start + end date to enable report generation."})]})]})]})}function _le(e){const t=e.get("project")||void 0,r=e.get("startDate")||void 0,n=e.get("endDate")||void 0;return{project:t,startDate:r,endDate:n}}function aP(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function qm(e,t){const r=new Map;return e.forEach(n=>{const i=t(n)||"unknown";r.set(i,(r.get(i)||0)+1)}),Array.from(r.entries()).sort((n,i)=>i[1]-n[1])}const ct={blue:"#2563eb",green:"#10b981",red:"#ef4444",amber:"#f59e0b",violet:"#8b5cf6",slate:"#64748b"};function kle(e,t){return t?`${Math.round(e/t*100)}%`:"0%"}function Wm({items:e,total:t}){return c.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:6,marginTop:8},children:e.map(r=>c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:12},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("span",{style:{width:10,height:10,borderRadius:999,background:r.color,display:"inline-block"}}),c.jsx("span",{style:{color:"#111827",textTransform:"capitalize"},children:r.name})]}),c.jsxs("div",{style:{color:"#111827"},children:[c.jsx("span",{style:{fontWeight:800},children:r.value.toLocaleString()})," ",c.jsxs("span",{style:{color:"#6b7280"},children:["(",kle(r.value,t),")"]})]})]},r.name))})}function Ur({title:e,children:t}){return c.jsxs("div",{style:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"white"},children:[c.jsx("div",{style:{fontSize:13,fontWeight:800,color:"#111827",marginBottom:10},children:e}),t]})}function Ale(){const[e]=Ah(),t=e.get("type")||"executive",r=k.useMemo(()=>_le(e),[e]),{data:n=[],isLoading:i}=Qe({queryKey:["runs-report",t,r],queryFn:()=>Ye.getRuns({limit:1e4,project:r.project,startDate:r.startDate,endDate:r.endDate}),staleTime:0});k.useEffect(()=>{const m=setTimeout(()=>{try{window.print()}catch{}},300);return()=>clearTimeout(m)},[]);const a=k.useMemo(()=>{const m=n.length,y=n.filter(S=>S.status==="success").length,b=n.filter(S=>S.status==="failed").length,g=n.filter(S=>S.status==="cancelled").length,x=n.reduce((S,w)=>S+(w.shots||0),0);return{total:m,success:y,failed:b,cancelled:g,shots:x}},[n]),o=k.useMemo(()=>qm(n,m=>m.project),[n]),s=k.useMemo(()=>qm(n,m=>m.provider),[n]),l=k.useMemo(()=>qm(n,m=>m.backend_name),[n]),u=k.useMemo(()=>{const m=s.slice(0,6),y=m.reduce((S,[,w])=>S+w,0),b=Math.max(a.total-y,0),g=[ct.blue,ct.violet,ct.green,ct.amber,ct.red,ct.slate],x=m.map(([S,w],j)=>({name:S,value:w,color:g[j%g.length]}));return b>0&&x.push({name:"other",value:b,color:"#9ca3af"}),x.filter(S=>S.value>0)},[s,a.total]),f=k.useMemo(()=>{const m=a.success,y=a.failed,b=a.cancelled,g=Math.max(a.total-m-y-b,0);return[{name:"success",value:m,color:ct.green},{name:"failed",value:y,color:ct.red},{name:"cancelled",value:b,color:ct.slate},...g?[{name:"other",value:g,color:ct.amber}]:[]].filter(x=>x.value>0)},[a]),d=k.useMemo(()=>{const m=[{label:"0-10",min:0,max:10,value:0},{label:"11-100",min:11,max:100,value:0},{label:"101-1K",min:101,max:1e3,value:0},{label:"1K-10K",min:1001,max:1e4,value:0},{label:"10K+",min:10001,max:Number.POSITIVE_INFINITY,value:0}];return n.forEach(y=>{const b=y.shots||0,g=m.find(x=>b>=x.min&&b<=x.max);g&&(g.value+=1)}),m.filter(y=>y.value>0)},[n]),h=k.useMemo(()=>{const m=new Map;return n.forEach(y=>{const b=new Date(y.created_at),g=`${b.getUTCFullYear()}-${String(b.getUTCMonth()+1).padStart(2,"0")}-${String(b.getUTCDate()).padStart(2,"0")}`;m.has(g)||m.set(g,{date:g,runs:0}),m.get(g).runs+=1}),Array.from(m.values()).sort((y,b)=>y.date.localeCompare(b.date)).map(y=>({...y,label:y.date.slice(5)}))},[n]),p=k.useMemo(()=>{const m=g=>g.provider==="unknown"||g.backend_name==="unknown",y=g=>(g.shots||0)<=10,b=g=>g.status==="failed";return n.filter(g=>m(g)||y(g)||b(g)).sort((g,x)=>new Date(x.created_at).getTime()-new Date(g.created_at).getTime()).slice(0,40)},[n]),v=t==="home"?"Home Dashboard Export":t==="analytics"?"Run Analytics Dashboard Export":t==="executive"?"Executive Summary Report":t==="provider_backend"?"Provider/Backend Performance Report":"Run Quality / Anomaly Report";return c.jsxs("div",{style:{padding:24,fontFamily:"system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif"},children:[c.jsx("style",{children:` +)`})]})]}):c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Algorithm Analytics"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:h-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Algorithm-specific performance analysis and cross-SDK comparison"})]}),c.jsxs("div",{className:"card",children:[c.jsx("label",{className:"block text-sm font-medium text-white mb-2",children:"Select Algorithm"}),c.jsx("select",{value:r,onChange:x=>n(x.target.value),className:"bg-dark-bg border border-dark-border rounded-lg px-4 py-2 text-dark-text w-full max-w-md",children:i.map(x=>c.jsxs("option",{value:x.name,children:[x.name," (",x.count," runs)"]},x.name))})]}),r?s?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading algorithm data..."}):u.length===0?c.jsx("div",{className:"card text-center py-12",children:c.jsx("p",{className:"text-dark-text-muted",children:"No runs found for selected algorithm with current filters."})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Total Runs"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:u.length})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Success Rate"}),c.jsxs("p",{className:"text-3xl font-bold text-white",children:[b.toFixed(1),"%"]}),c.jsxs("p",{className:"text-xs text-dark-text-muted mt-1",children:["Overall: ",y.toFixed(1),"%"]})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Avg Shots"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:u.length>0?Math.round(u.reduce((x,S)=>x+S.shots,0)/u.length):0})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"SDKs Used"}),c.jsx("p",{className:"text-3xl font-bold text-white",children:h.length})]})]}),h.length>0&&c.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Success Rate by SDK/Provider"}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"sdk",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(or,{dataKey:"successRate",fill:"#3b82f6",radius:[4,4,0,0],children:h.map((x,S)=>c.jsx(vr,{fill:g[S%g.length]},`cell-${S}`))})]})})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Average Shots by SDK/Provider"}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(Ts,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"sdk",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(or,{dataKey:"avgShots",fill:"#8b5cf6",radius:[4,4,0,0],children:h.map((x,S)=>c.jsx(vr,{fill:g[S%g.length]},`cell-${S}`))})]})})]})]}),h.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:["Best Performing SDK for ",r]}),c.jsx("div",{className:"flex items-center gap-6",children:h.sort((x,S)=>S.successRate-x.successRate).slice(0,3).map((x,S)=>c.jsx("div",{className:"flex-1",children:c.jsxs("div",{className:`p-4 rounded-lg border-2 ${S===0?"border-primary bg-primary/10":"border-dark-border bg-dark-bg"}`,children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"text-sm font-medium text-dark-text-muted",children:S===0?"🥇 Best":S===1?"🥈 2nd":"🥉 3rd"}),c.jsxs("span",{className:"text-xs text-dark-text-muted",children:[x.totalRuns," runs"]})]}),c.jsx("div",{className:"text-2xl font-bold text-white mb-1",children:x.sdk}),c.jsxs("div",{className:"text-sm text-dark-text-muted",children:[x.successRate.toFixed(1),"% success rate"]})]})},x.sdk))})]}),p.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:[r," Performance Over Time"]}),c.jsx(tt,{width:"100%",height:300,children:c.jsxs(_p,{data:p,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#374151"}),c.jsx(it,{dataKey:"date",stroke:"#9ca3af",angle:-45,textAnchor:"end",height:80}),c.jsx(at,{stroke:"#9ca3af"}),c.jsx($e,{contentStyle:{backgroundColor:"#1f2937",border:"1px solid #374151",color:"#f3f4f6"}}),c.jsx(Ji,{type:"monotone",dataKey:"successRate",stroke:"#3b82f6",strokeWidth:2,dot:{fill:"#3b82f6",r:4},activeDot:{r:6}})]})})]}),v.length>0&&c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:["Backend Performance for ",r]}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Runs"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-medium text-dark-text-muted",children:"Success Rate"})]})}),c.jsx("tbody",{children:v.map(x=>c.jsxs("tr",{className:"border-b border-dark-border hover:bg-dark-bg/50 cursor-pointer",onClick:()=>t(`/runs-filtered?algorithm=${r}&provider=${x.backend.split("/")[0]}`),children:[c.jsx("td",{className:"py-3 px-4 text-dark-text",children:x.backend}),c.jsx("td",{className:"py-3 px-4 text-right text-dark-text",children:x.totalRuns}),c.jsxs("td",{className:"py-3 px-4 text-right text-dark-text",children:[x.successRate.toFixed(1),"%"]})]},x.backend))})]})})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Algorithm-Specific Metrics"}),m?c.jsxs("div",{className:"space-y-4",children:[r.toLowerCase().includes("vqe")&&m.vqe.energies.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"VQE Energy Values"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Min:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:Math.min(...m.vqe.energies).toFixed(4)})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Max:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:Math.max(...m.vqe.energies).toFixed(4)})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:(m.vqe.energies.reduce((x,S)=>x+S,0)/m.vqe.energies.length).toFixed(4)})]})]})]}),r.toLowerCase().includes("grover")&&m.grover.targetSuccessRates.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Grover's Target Success Rates"}),c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg Expected:"}),c.jsxs("span",{className:"ml-2 text-white font-semibold",children:[(m.grover.targetSuccessRates.reduce((x,S)=>x+S,0)/m.grover.targetSuccessRates.length*100).toFixed(1),"%"]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Actual:"}),c.jsxs("span",{className:"ml-2 text-white font-semibold",children:[b.toFixed(1),"%"]})]})]})]}),(r.toLowerCase().includes("optimization")||r.toLowerCase().includes("qubo")||r.toLowerCase().includes("ising"))&&m.optimization.approximationRatios.length>0&&c.jsxs("div",{children:[c.jsx("h4",{className:"text-sm font-medium text-dark-text-muted mb-2",children:"Approximation Ratios"}),c.jsx("div",{className:"flex items-center gap-4",children:c.jsxs("div",{children:[c.jsx("span",{className:"text-xs text-dark-text-muted",children:"Avg:"}),c.jsx("span",{className:"ml-2 text-white font-semibold",children:(m.optimization.approximationRatios.reduce((x,S)=>x+S,0)/m.optimization.approximationRatios.length).toFixed(3)})]})})]})]}):c.jsxs("div",{className:"text-center py-8 text-dark-text-muted",children:[c.jsxs("p",{className:"mb-2",children:["Add ",c.jsx("code",{className:"bg-dark-bg px-2 py-1 rounded text-primary",children:"benchmark_params"})," to your runs to see algorithm-specific metrics."]}),c.jsx("p",{className:"text-sm",children:"Example: For VQE, include energy values; for Grover's, include target bitstrings."})]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white",children:[r," Runs"]}),c.jsx(ch,{runs:u})]})]}):c.jsx("div",{className:"card text-center py-12",children:c.jsx("p",{className:"text-dark-text-muted",children:"Select an algorithm to view metrics."})})]})}function xle(){const{data:e,isLoading:t}=Qe({queryKey:["settings"],queryFn:()=>Ye.getSettings()});return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Settings"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4 text-white flex items-center gap-2",children:[c.jsx(oD,{className:"w-5 h-5"}),"Data Directory"]}),t?c.jsx("p",{className:"text-dark-text-muted",children:"Loading..."}):e?c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("p",{className:"text-sm text-dark-text-muted mb-2",children:"Current Data Directory:"}),c.jsx("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-3 font-mono text-sm text-dark-text break-all",children:e.data_dir}),e.data_dir==="/data"&&c.jsxs("p",{className:"text-xs text-primary mt-2",children:["🐳 Running in ",c.jsx("strong",{children:"Docker mode"})," - data stored in Docker volume"]})]}),c.jsx("div",{className:"bg-dark-bg/50 border border-dark-border rounded-lg p-4",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Xk,{className:"w-5 h-5 text-primary mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"space-y-2 text-sm text-dark-text-muted",children:[e.data_dir==="/data"?c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-dark-text font-medium",children:"Docker Mode: Data in Docker Volume"}),c.jsxs("p",{className:"text-xs",children:["Data is stored in a Docker volume named ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker_qobserva_data"}),"."]}),c.jsx("p",{className:"text-dark-text font-medium mt-3",children:"How to Access Data:"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["View volume location: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker volume inspect docker_qobserva_data"})]}),c.jsxs("li",{children:["Access from container: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker exec -it docker-collector-1 ls -la /data"})]}),c.jsxs("li",{children:["Copy files out: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker cp docker-collector-1:/data/qobserva.sqlite3 ./"})]})]}),c.jsx("p",{className:"text-dark-text font-medium mt-3",children:"How to Change Data Directory (Docker):"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["Edit ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"docker/docker-compose.yml"})," and update the volume mount"]}),c.jsxs("li",{children:["Or set ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"QOBSERVA_DATA_DIR"})," in the environment section"]}),c.jsxs("li",{children:["Restart: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"make docker-down && make docker-up"})]})]})]}):c.jsxs(c.Fragment,{children:[c.jsx("p",{className:"text-dark-text font-medium",children:"How to Change Data Directory:"}),c.jsxs("ol",{className:"list-decimal list-inside space-y-1 ml-2",children:[c.jsxs("li",{children:["Set the ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"QOBSERVA_DATA_DIR"})," environment variable to your desired path"]}),c.jsxs("li",{children:["Stop QObserva: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"qobserva down"})]}),c.jsxs("li",{children:["Start QObserva: ",c.jsx("code",{className:"bg-dark-bg px-1.5 py-0.5 rounded text-primary",children:"qobserva up"})]})]})]}),c.jsxs("p",{className:"text-xs mt-3 pt-3 border-t border-dark-border",children:[c.jsx("strong",{children:"Note:"})," The data directory cannot be changed at runtime. All runs, database, and artifacts are stored in this directory."]})]})]})}),c.jsxs("div",{className:"mt-4 pt-4 border-t border-dark-border",children:[c.jsx("p",{className:"text-xs text-dark-text-muted mb-2",children:"Data Structure:"}),c.jsxs("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-3 font-mono text-xs text-dark-text",children:[c.jsxs("div",{children:[e.data_dir,"/"]}),c.jsxs("div",{className:"ml-4",children:["├── qobserva.sqlite3 ",c.jsx("span",{className:"text-dark-text-muted",children:"(database)"})]}),c.jsx("div",{className:"ml-4",children:"└── artifacts/"}),c.jsxs("div",{className:"ml-8",children:["├── ","{project}/"]}),c.jsxs("div",{className:"ml-12",children:["└── ","{run_id}/"]}),c.jsx("div",{className:"ml-16",children:"├── event.json"}),c.jsx("div",{className:"ml-16",children:"└── analysis.json"})]})]})]}):c.jsx("p",{className:"text-dark-text-muted",children:"Unable to load settings."})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"About"}),c.jsxs("div",{className:"space-y-2 text-sm text-dark-text-muted",children:[c.jsx("p",{children:c.jsxs("strong",{className:"text-dark-text",children:["QObserva v",(e==null?void 0:e.qobserva_version)||"unknown"]})}),c.jsx("p",{children:"Local-first observability and benchmarking for quantum program executions."}),c.jsxs("p",{className:"text-xs",children:["Components: agent v",(e==null?void 0:e.qobserva_agent_version)||"unknown"," | collector v",(e==null?void 0:e.qobserva_collector_version)||"unknown"," | local v",(e==null?void 0:e.qobserva_local_version)||"unknown"]}),c.jsxs("ul",{className:"list-disc list-inside space-y-1 mt-4",children:[c.jsx("li",{children:"Standardized run telemetry"}),c.jsx("li",{children:"Metrics and insights generation"}),c.jsx("li",{children:"Multi-SDK support (Qiskit, Braket, Cirq, PennyLane, pyQuil, D-Wave)"})]})]})]})]})}function ble({runs:e}){const t=mt(),r=k.useMemo(()=>{const i=new Map;return e.forEach(a=>{const o=a.backend_name;i.has(o)||i.set(o,{backend_name:a.backend_name,provider:a.provider,total:0,success:0,failed:0,cancelled:0});const s=i.get(o);s.total++,a.status==="success"?s.success++:a.status==="failed"?s.failed++:a.status==="cancelled"&&s.cancelled++}),Array.from(i.values()).sort((a,o)=>o.total-a.total)},[e]),n=i=>{t(`/?provider=${encodeURIComponent(i)}`)};return r.length===0?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No backend data available"}):c.jsx("div",{children:c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend Name"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Total Runs"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Success"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Failed"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Cancelled"}),c.jsx("th",{className:"text-right py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Success Rate"})]})}),c.jsx("tbody",{children:r.map(i=>{const a=i.total>0?i.success/i.total*100:0;return c.jsxs("tr",{onClick:()=>n(i.provider),className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 cursor-pointer transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text font-medium",children:i.backend_name}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:i.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text text-right",children:i.total.toLocaleString()}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-success font-medium",children:i.success.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-error font-medium",children:i.failed.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsx("span",{className:"text-sm text-dark-text-muted font-medium",children:i.cancelled.toLocaleString()})}),c.jsx("td",{className:"py-3 px-4 text-right",children:c.jsxs("span",{className:`text-sm font-semibold ${a>=80?"text-success":a>=50?"text-warning":"text-error"}`,children:[a.toFixed(1),"%"]})})]},i.backend_name)})})]})})})}function wle({backendStats:e}){const t=()=>{zI(e,"qobserva-backends")};return c.jsxs("button",{onClick:t,className:"btn-secondary flex items-center gap-2 ml-auto",title:"Download as CSV",children:[c.jsx(Eh,{size:16}),"Download CSV"]})}const aP={success:"#10b981",failed:"#ef4444",cancelled:"#6b7280",default:"#3b82f6"};function Sle({runs:e}){const t=mt(),r=k.useMemo(()=>e.sort((o,s)=>new Date(o.created_at).getTime()-new Date(s.created_at).getTime()).map(o=>({x:new Date(o.created_at).getTime(),y:o.shots,shots:o.shots,runId:o.run_id,status:o.status,project:o.project,backend:o.backend_name,createdAt:o.created_at,formattedDate:new Date(o.created_at).toLocaleString()})),[e]),n=o=>{o&&o.runId&&t(`/runs/${o.runId}`)},i=({active:o,payload:s})=>{if(o&&s&&s.length){const l=s[0].payload;return c.jsxs("div",{className:"bg-dark-surface border border-primary/30 rounded-lg p-3 shadow-xl z-50 min-w-[200px]",children:[c.jsx("p",{className:"text-white font-semibold mb-2",children:l.formattedDate||new Date(l.createdAt).toLocaleString()}),c.jsxs("div",{className:"space-y-1 text-sm",children:[c.jsxs("p",{className:"text-dark-text-muted",children:["Shots: ",c.jsx("span",{className:"text-primary font-semibold",children:l.shots.toLocaleString()})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Status: ",c.jsx("span",{className:"text-white font-medium capitalize",children:l.status})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Backend: ",c.jsx("span",{className:"text-white font-medium",children:l.backend})]}),c.jsxs("p",{className:"text-dark-text-muted",children:["Project: ",c.jsx("span",{className:"text-white font-medium",children:l.project})]}),c.jsx("p",{className:"text-xs text-primary/70 mt-2 pt-2 border-t border-dark-border cursor-pointer",children:"Click dot to view details"})]})]})}return null};if(r.length===0)return c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"No shots data available"});const a=o=>{const{cx:s,cy:l,payload:u}=o,f=aP[u==null?void 0:u.status]||aP.default;return c.jsxs("g",{onClick:()=>n(u),style:{cursor:"pointer"},children:[c.jsx("circle",{cx:s||0,cy:l||0,r:10,fill:"transparent",pointerEvents:"all"}),c.jsx("circle",{cx:s||0,cy:l||0,r:6,fill:f,stroke:"#1e293b",strokeWidth:2,className:"hover:r-7 hover:stroke-primary transition-all duration-150"})]})};return c.jsx(tt,{width:"100%",height:500,children:c.jsxs(_p,{data:r,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#334155"}),c.jsx(it,{type:"number",dataKey:"x",name:"Time",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},domain:["dataMin","dataMax"],scale:"time",tickFormatter:o=>new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),label:{value:"Time",position:"insideBottom",offset:-5,fill:"#94a3b8"}}),c.jsx(at,{type:"number",dataKey:"y",name:"Shots",stroke:"#94a3b8",tick:{fill:"#94a3b8",fontSize:12},label:{value:"Shots",angle:-90,position:"insideLeft",fill:"#94a3b8"}}),c.jsx($e,{content:c.jsx(i,{}),cursor:{strokeDasharray:"3 3",stroke:"#3b82f6"}}),c.jsx(Ji,{type:"monotone",dataKey:"shots",stroke:"#3b82f6",strokeWidth:2,strokeOpacity:.5,dot:a,activeDot:{r:8,fill:"#3b82f6",stroke:"#1e293b",strokeWidth:2,style:{cursor:"pointer"}},onClick:o=>{o&&o.payload&&n(o.payload)},style:{cursor:"pointer"}})]})})}function jle(){const[e]=Ah(),t=mt(),r=e.get("type")||"all",n=k.useMemo(()=>{const l={limit:1e4},u=e.get("project"),f=e.get("provider"),d=e.get("status"),h=e.get("startDate"),p=e.get("endDate");return u&&(l.project=u),f&&(l.provider=f),h&&(l.startDate=h),p&&(l.endDate=p),d?l.status=d:r==="success"?l.status="success":r==="failed"&&(l.status="failed"),l},[e,r]),{data:i=[],isLoading:a}=Qe({queryKey:["runs",n],queryFn:()=>Ye.getRuns(n),staleTime:0}),o=k.useMemo(()=>{const l=new Map;return i.forEach(u=>{const f=u.backend_name;l.has(f)||l.set(f,{backend_name:u.backend_name,provider:u.provider,total:0,success:0,failed:0,cancelled:0});const d=l.get(f);d.total++,u.status==="success"?d.success++:u.status==="failed"?d.failed++:u.status==="cancelled"&&d.cancelled++}),Array.from(l.values()).sort((u,f)=>f.total-u.total)},[i]);let s="All Runs";return r==="success"?s="Successful Runs":r==="failed"?s="Failed Runs":r==="shots"?s="Runs by Shots":r==="backends"?s="Runs by Backend":status&&(s=`${status.charAt(0).toUpperCase()+status.slice(1)} Runs`),a?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Loading..."}):r==="shots"?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs)"]})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"Shots Distribution"}),c.jsx(Sle,{runs:i})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Runs List"}),c.jsx(Fg,{runs:i,title:"shots-runs"})]}),c.jsx(ch,{runs:i,highlightShots:!0,title:"shots-runs"})]})]}):r==="backends"?c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs across ",new Set(i.map(l=>l.backend_name)).size," backends)"]})]}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:"Backend Statistics"}),c.jsx(wle,{backendStats:o})]}),c.jsx("p",{className:"text-sm text-dark-text-muted mb-4",children:"Click on a backend row to filter by provider on the Home dashboard"}),c.jsx(ble,{runs:i})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsx("button",{onClick:()=>t(-1),className:"p-2 hover:bg-dark-surface rounded-lg transition-colors",children:c.jsx(im,{size:20,className:"text-dark-text-muted"})}),c.jsx("h1",{className:"text-3xl font-bold text-white",children:s}),c.jsxs("span",{className:"text-dark-text-muted",children:["(",i.length," runs)"]})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsx("h3",{className:"text-lg font-semibold text-white",children:s}),c.jsx(Fg,{runs:i,title:s.toLowerCase().replace(/\s+/g,"-")})]}),c.jsx(ch,{runs:i,title:s.toLowerCase().replace(/\s+/g,"-")})]})]})}function Ole(){const[e,t]=k.useState(""),r=mt(),{data:n=[],isLoading:i}=Qe({queryKey:["runs"],queryFn:()=>Ye.getRuns({limit:1e4}),staleTime:5e3}),a=n.filter(l=>{if(!e.trim())return!1;const u=e.toLowerCase();return l.run_id.toLowerCase().includes(u)||l.project.toLowerCase().includes(u)||l.provider.toLowerCase().includes(u)||l.backend_name.toLowerCase().includes(u)||l.status.toLowerCase().includes(u)}),o=l=>{r(`/runs/${l}`)},s=l=>{l.key==="Enter"&&a.length===1&&o(a[0].run_id)};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Search Runs"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Search for runs by ID, project, provider, backend, or status"})]}),c.jsxs("div",{className:"card",children:[c.jsxs("div",{className:"relative",children:[c.jsx(Yf,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-dark-text-muted",size:20}),c.jsx("input",{type:"text",value:e,onChange:l=>t(l.target.value),onKeyPress:s,placeholder:"Enter run ID, project, provider, backend, or status...",className:"w-full bg-dark-bg border border-dark-border rounded-lg pl-12 pr-4 py-3 text-dark-text text-lg focus:outline-none focus:border-primary/50",autoFocus:!0})]}),e&&c.jsxs("p",{className:"text-sm text-dark-text-muted mt-3",children:[i?"Searching...":`${a.length} run${a.length!==1?"s":""} found`,a.length===1&&" (Press Enter to view)"]})]}),e&&c.jsx("div",{className:"card",children:i?c.jsx("div",{className:"text-center py-12 text-dark-text-muted",children:"Searching..."}):a.length===0?c.jsxs("div",{className:"text-center py-12",children:[c.jsx("p",{className:"text-dark-text-muted mb-2",children:"No runs found"}),c.jsx("p",{className:"text-sm text-dark-text-muted",children:"Try a different search term"})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"Results"}),c.jsx("div",{className:"overflow-x-auto",children:c.jsxs("table",{className:"w-full",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"border-b border-dark-border",children:[c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Run ID"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Time"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Project"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Provider"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Backend"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Status"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Shots"}),c.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-dark-text-muted",children:"Action"})]})}),c.jsx("tbody",{children:a.slice(0,100).map(l=>c.jsxs("tr",{className:"border-b border-dark-border hover:bg-primary/10 hover:border-primary/30 transition-all duration-150",children:[c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",onClick:u=>u.stopPropagation(),children:c.jsx(Ap,{runId:l.run_id})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:Yn(new Date(l.created_at),"MMM dd, HH:mm")}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.project}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.provider}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.backend_name}),c.jsx("td",{className:"py-3 px-4",children:c.jsx("span",{className:`px-2 py-1 rounded text-xs font-semibold ${l.status==="success"?"bg-success/20 text-success":l.status==="failed"?"bg-error/20 text-error":"bg-dark-text-muted/20 text-dark-text-muted"}`,children:l.status})}),c.jsx("td",{className:"py-3 px-4 text-sm text-dark-text",children:l.shots.toLocaleString()}),c.jsx("td",{className:"py-3 px-4",children:c.jsxs("button",{onClick:()=>o(l.run_id),className:"flex items-center gap-1 text-primary hover:text-primary/80 text-sm transition-colors",title:"View run details",children:["View",c.jsx(ZR,{size:14})]})})]},l.run_id))})]})}),a.length>100&&c.jsx("p",{className:"text-sm text-dark-text-muted mt-4 text-center",children:"Showing first 100 results. Refine your search to see more."})]})}),!e&&c.jsxs("div",{className:"card",children:[c.jsx("h3",{className:"text-lg font-semibold text-white mb-4",children:"How to Search"}),c.jsxs("ul",{className:"space-y-2 text-sm text-dark-text-muted",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Run ID:"})," Enter the full or partial run ID"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Project:"})," Search by project name"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Provider:"}),' Filter by provider (e.g., "ibm", "aws")']}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Backend:"})," Search by backend name"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{className:"text-dark-text",children:"By Status:"}),' Filter by status (e.g., "success", "failed")']})]})]})]})}function Ple(e,t){const r=new URLSearchParams;return r.set("type",e),t.project&&r.set("project",t.project),t.startDate&&r.set("startDate",t.startDate),t.endDate&&r.set("endDate",t.endDate),`/report?${r.toString()}`}function _le(){const e=mt(),[t,r]=k.useState("executive"),[n,i]=k.useState(""),[a,o]=k.useState(""),[s,l]=k.useState(""),u=k.useMemo(()=>({required:["Date range (start + end)"],optional:["Project"],notUsed:["Provider","Status (reports are intentionally general)"]}),[]),f=!!(a&&s),d=()=>{const h=Ple(t,{project:n||void 0,startDate:a?new Date(a+"T00:00:00Z").toISOString().replace(/\.\d{3}Z$/,"Z"):void 0,endDate:s?new Date(s+"T23:59:59Z").toISOString().replace(/\.\d{3}Z$/,"Z"):void 0});window.open(h,"_blank","noopener,noreferrer")};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h1",{className:"text-3xl font-bold text-white",children:"Generate Report"}),c.jsx("img",{src:xn,alt:"QObserva Logo",className:"h-20 w-20 sm:h-24 sm:w-24 md:h-28 md:w-28 lg:h-32 lg:w-32 xl:h-36 xl:w-36 object-contain flex-shrink-0"})]}),c.jsx("p",{className:"text-dark-text-muted",children:"Generate a PDF via browser print. Choose a report type, set filters, then print/save as PDF."})]}),c.jsxs("div",{className:"card space-y-6",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Report Type"}),c.jsxs("select",{value:t,onChange:h=>r(h.target.value),className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm",children:[c.jsx("option",{value:"executive",children:"Executive Summary"}),c.jsx("option",{value:"provider_backend",children:"Provider/Backend Performance"}),c.jsx("option",{value:"quality_anomaly",children:"Run Quality / Anomaly"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Project (optional)"}),c.jsx("input",{value:n,onChange:h=>i(h.target.value),placeholder:"e.g. pennylane_test",className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm"})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"Start Date (required)"}),c.jsx("input",{type:"date",value:a,onChange:h=>o(h.target.value),style:{colorScheme:"light"},className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm qobserva-date-input"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"block text-sm font-semibold text-dark-text-muted mb-2",children:"End Date (required)"}),c.jsx("input",{type:"date",value:s,onChange:h=>l(h.target.value),style:{colorScheme:"light"},className:"w-full bg-dark-bg border border-dark-border rounded-lg px-3 py-2 text-dark-text text-sm qobserva-date-input"})]})]}),c.jsxs("div",{className:"bg-dark-bg border border-dark-border rounded-lg p-4",children:[c.jsx("div",{className:"text-sm font-semibold text-white mb-2",children:"Requirements"}),c.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Required"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.required.map(h=>c.jsxs("li",{children:["- ",h]},h))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Optional"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.optional.map(h=>c.jsxs("li",{children:["- ",h]},h))})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-dark-text-muted mb-1",children:"Not used"}),c.jsx("ul",{className:"space-y-1 text-dark-text",children:u.notUsed.map(h=>c.jsxs("li",{children:["- ",h]},h))})]})]})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{onClick:()=>e(-1),className:"btn-secondary",children:"Back"}),c.jsx("button",{onClick:d,disabled:!f,className:"btn-primary disabled:opacity-50 disabled:cursor-not-allowed",children:"Open Report (Print/PDF)"}),!f&&c.jsx("div",{className:"text-sm text-dark-text-muted",children:"Select start + end date to enable report generation."})]})]})]})}function kle(e){const t=e.get("project")||void 0,r=e.get("startDate")||void 0,n=e.get("endDate")||void 0;return{project:t,startDate:r,endDate:n}}function oP(e){if(!e)return"—";try{return new Date(e).toLocaleString()}catch{return e}}function Wm(e,t){const r=new Map;return e.forEach(n=>{const i=t(n)||"unknown";r.set(i,(r.get(i)||0)+1)}),Array.from(r.entries()).sort((n,i)=>i[1]-n[1])}const ct={blue:"#2563eb",green:"#10b981",red:"#ef4444",amber:"#f59e0b",violet:"#8b5cf6",slate:"#64748b"};function Ale(e,t){return t?`${Math.round(e/t*100)}%`:"0%"}function Hm({items:e,total:t}){return c.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr",gap:6,marginTop:8},children:e.map(r=>c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:12},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[c.jsx("span",{style:{width:10,height:10,borderRadius:999,background:r.color,display:"inline-block"}}),c.jsx("span",{style:{color:"#111827",textTransform:"capitalize"},children:r.name})]}),c.jsxs("div",{style:{color:"#111827"},children:[c.jsx("span",{style:{fontWeight:800},children:r.value.toLocaleString()})," ",c.jsxs("span",{style:{color:"#6b7280"},children:["(",Ale(r.value,t),")"]})]})]},r.name))})}function Ur({title:e,children:t}){return c.jsxs("div",{style:{border:"1px solid #e5e7eb",borderRadius:12,padding:12,background:"white"},children:[c.jsx("div",{style:{fontSize:13,fontWeight:800,color:"#111827",marginBottom:10},children:e}),t]})}function Ele(){const[e]=Ah(),t=e.get("type")||"executive",r=k.useMemo(()=>kle(e),[e]),{data:n=[],isLoading:i}=Qe({queryKey:["runs-report",t,r],queryFn:()=>Ye.getRuns({limit:1e4,project:r.project,startDate:r.startDate,endDate:r.endDate}),staleTime:0});k.useEffect(()=>{const m=setTimeout(()=>{try{window.print()}catch{}},300);return()=>clearTimeout(m)},[]);const a=k.useMemo(()=>{const m=n.length,y=n.filter(S=>S.status==="success").length,b=n.filter(S=>S.status==="failed").length,g=n.filter(S=>S.status==="cancelled").length,x=n.reduce((S,w)=>S+(w.shots||0),0);return{total:m,success:y,failed:b,cancelled:g,shots:x}},[n]),o=k.useMemo(()=>Wm(n,m=>m.project),[n]),s=k.useMemo(()=>Wm(n,m=>m.provider),[n]),l=k.useMemo(()=>Wm(n,m=>m.backend_name),[n]),u=k.useMemo(()=>{const m=s.slice(0,6),y=m.reduce((S,[,w])=>S+w,0),b=Math.max(a.total-y,0),g=[ct.blue,ct.violet,ct.green,ct.amber,ct.red,ct.slate],x=m.map(([S,w],j)=>({name:S,value:w,color:g[j%g.length]}));return b>0&&x.push({name:"other",value:b,color:"#9ca3af"}),x.filter(S=>S.value>0)},[s,a.total]),f=k.useMemo(()=>{const m=a.success,y=a.failed,b=a.cancelled,g=Math.max(a.total-m-y-b,0);return[{name:"success",value:m,color:ct.green},{name:"failed",value:y,color:ct.red},{name:"cancelled",value:b,color:ct.slate},...g?[{name:"other",value:g,color:ct.amber}]:[]].filter(x=>x.value>0)},[a]),d=k.useMemo(()=>{const m=[{label:"0-10",min:0,max:10,value:0},{label:"11-100",min:11,max:100,value:0},{label:"101-1K",min:101,max:1e3,value:0},{label:"1K-10K",min:1001,max:1e4,value:0},{label:"10K+",min:10001,max:Number.POSITIVE_INFINITY,value:0}];return n.forEach(y=>{const b=y.shots||0,g=m.find(x=>b>=x.min&&b<=x.max);g&&(g.value+=1)}),m.filter(y=>y.value>0)},[n]),h=k.useMemo(()=>{const m=new Map;return n.forEach(y=>{const b=new Date(y.created_at),g=`${b.getUTCFullYear()}-${String(b.getUTCMonth()+1).padStart(2,"0")}-${String(b.getUTCDate()).padStart(2,"0")}`;m.has(g)||m.set(g,{date:g,runs:0}),m.get(g).runs+=1}),Array.from(m.values()).sort((y,b)=>y.date.localeCompare(b.date)).map(y=>({...y,label:y.date.slice(5)}))},[n]),p=k.useMemo(()=>{const m=g=>g.provider==="unknown"||g.backend_name==="unknown",y=g=>(g.shots||0)<=10,b=g=>g.status==="failed";return n.filter(g=>m(g)||y(g)||b(g)).sort((g,x)=>new Date(x.created_at).getTime()-new Date(g.created_at).getTime()).slice(0,40)},[n]),v=t==="home"?"Home Dashboard Export":t==="analytics"?"Run Analytics Dashboard Export":t==="executive"?"Executive Summary Report":t==="provider_backend"?"Provider/Backend Performance Report":"Run Quality / Anomaly Report";return c.jsxs("div",{style:{padding:24,fontFamily:"system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif"},children:[c.jsx("style",{children:` @media print { @page { margin: 12mm; } .no-print { display: none !important; } @@ -277,4 +277,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .kpi { border: 1px solid #e5e7eb; border-radius: 12px; padding: 10px; background: white; } .kpi-title { font-size: 12px; color: #6b7280; margin-bottom: 4px; } .kpi-val { font-size: 18px; font-weight: 700; color: #111827; } - `}),c.jsxs("div",{className:"no-print",style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[c.jsx("div",{className:"muted",style:{fontSize:12},children:"Tip: Use browser “Save as PDF”. If the print dialog didn’t open, press Ctrl+P."}),c.jsx("button",{onClick:()=>window.print(),style:{padding:"8px 12px",border:"1px solid #e5e7eb",borderRadius:8,background:"white"},children:"Print / Save PDF"})]}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:22,fontWeight:800,color:"#111827"},children:v}),c.jsxs("div",{className:"muted",style:{fontSize:12,marginTop:4},children:["Generated: ",new Date().toLocaleString()]})]}),c.jsxs("div",{className:"muted",style:{fontSize:12,textAlign:"right"},children:[c.jsxs("div",{children:["Project: ",r.project||"All"]}),c.jsxs("div",{children:["Start: ",aP(r.startDate)]}),c.jsxs("div",{children:["End: ",aP(r.endDate)]})]})]}),c.jsx("div",{style:{height:4,borderRadius:999,background:"linear-gradient(90deg, #2563eb, #8b5cf6, #10b981)",marginTop:10}}),i?c.jsx("div",{style:{marginTop:24},className:"muted",children:"Loading report data…"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:10,marginTop:18},children:[c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Total Runs"}),c.jsx("div",{className:"kpi-val",children:a.total.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Success"}),c.jsx("div",{className:"kpi-val",children:a.success.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Failed"}),c.jsx("div",{className:"kpi-val",children:a.failed.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Cancelled"}),c.jsx("div",{className:"kpi-val",children:a.cancelled.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Total Shots"}),c.jsx("div",{className:"kpi-val",children:a.shots.toLocaleString()})]})]}),(t==="executive"||t==="home"||t==="analytics")&&c.jsxs("div",{style:{marginTop:18,display:"grid",gridTemplateColumns:"1.4fr 1fr",gap:14},children:[c.jsx(Ur,{title:"Run Volume Over Time",children:c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsxs(_p,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),c.jsx(it,{dataKey:"label",tick:{fill:"#374151",fontSize:11}}),c.jsx(at,{tick:{fill:"#374151",fontSize:11}}),c.jsx($e,{}),c.jsx(Ji,{type:"monotone",dataKey:"runs",stroke:ct.blue,strokeWidth:2,dot:{r:2}})]})})})}),c.jsxs(Ur,{title:"Status Distribution",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:f,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,label:({name:m,percent:y})=>`${String(m)} ${(y*100).toFixed(0)}%`,children:f.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Wm,{items:f,total:a.total})]})]}),t==="provider_backend"&&c.jsxs("div",{style:{marginTop:18,display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[c.jsx(Ur,{title:"Top Providers (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:s.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})}),c.jsx(Ur,{title:"Top Backends (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:l.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})}),c.jsxs(Ur,{title:"Provider Share (donut)",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:u,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,children:u.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Wm,{items:u,total:a.total})]}),c.jsx(Ur,{title:"Shots Distribution (buckets)",children:c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsxs(Ts,{data:d,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),c.jsx(it,{dataKey:"label",tick:{fill:"#374151",fontSize:11}}),c.jsx(at,{tick:{fill:"#374151",fontSize:11}}),c.jsx($e,{}),c.jsx(or,{dataKey:"value",fill:ct.violet})]})})})}),c.jsx(Ur,{title:"Projects (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:o.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})})]}),t==="quality_anomaly"&&c.jsxs("div",{style:{marginTop:18},children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[c.jsxs(Ur,{title:"Anomaly Counters",children:[c.jsxs("div",{style:{fontSize:12,color:"#111827",lineHeight:1.6},children:[c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.amber},children:n.filter(m=>m.provider==="unknown"||m.backend_name==="unknown").length.toLocaleString()})," ","runs with unknown provider/backend"]}),c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.violet},children:n.filter(m=>(m.shots||0)<=10).length.toLocaleString()})," ","low-shot runs (≤ 10)"]}),c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.red},children:a.failed.toLocaleString()})," failed runs"]})]}),c.jsx("div",{className:"muted",style:{marginTop:8,fontSize:12},children:"The table below lists a sample of runs that match these conditions."})]}),c.jsxs(Ur,{title:"Status Distribution",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:f,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,label:({name:m,percent:y})=>`${String(m)} ${(y*100).toFixed(0)}%`,children:f.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Wm,{items:f,total:a.total})]})]}),c.jsx("div",{style:{marginTop:14},children:c.jsx(Ur,{title:"Anomalous Runs (sample)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Run ID"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Shots"})]})}),c.jsx("tbody",{children:p.map(m=>c.jsxs("tr",{children:[c.jsx("td",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m.run_id}),c.jsx("td",{children:new Date(m.created_at).toLocaleString()}),c.jsx("td",{children:m.project}),c.jsx("td",{style:{color:m.provider==="unknown"?ct.amber:"#111827"},children:m.provider}),c.jsx("td",{style:{color:m.backend_name==="unknown"?ct.amber:"#111827"},children:m.backend_name}),c.jsx("td",{style:{color:m.status==="failed"?ct.red:"#111827"},children:m.status}),c.jsx("td",{style:{color:(m.shots||0)<=10?ct.violet:"#111827"},children:(m.shots||0).toLocaleString()})]},m.run_id))})]})})})]}),c.jsx("div",{className:"page-break",style:{marginTop:22},children:c.jsx(Ur,{title:"Recent Runs (sample)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Run ID"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Shots"})]})}),c.jsx("tbody",{children:n.slice().sort((m,y)=>new Date(y.created_at).getTime()-new Date(m.created_at).getTime()).slice(0,35).map(m=>c.jsxs("tr",{children:[c.jsx("td",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m.run_id}),c.jsx("td",{children:new Date(m.created_at).toLocaleString()}),c.jsx("td",{children:m.project}),c.jsx("td",{children:m.provider}),c.jsx("td",{children:m.backend_name}),c.jsx("td",{children:m.status}),c.jsx("td",{children:(m.shots||0).toLocaleString()})]},m.run_id))})]})})})]})]})}function Ele(){const[e,t]=k.useState({}),r=n=>{console.log("App: Filters changed to",n),t(n)};return c.jsx(qR,{children:c.jsx(WI,{onFilterChange:r,children:c.jsxs(RR,{children:[c.jsx(qr,{path:"/",element:c.jsx(Kse,{filters:e})}),c.jsx(qr,{path:"/search",element:c.jsx(jle,{})}),c.jsx(qr,{path:"/runs/:runId",element:c.jsx(tle,{})}),c.jsx(qr,{path:"/runs-filtered",element:c.jsx(Sle,{})}),c.jsx(qr,{path:"/compare",element:c.jsx(ole,{})}),c.jsx(qr,{path:"/analytics",element:c.jsx(vle,{filters:e})}),c.jsx(qr,{path:"/algorithms",element:c.jsx(yle,{filters:e})}),c.jsx(qr,{path:"/reports",element:c.jsx(Ple,{})}),c.jsx(qr,{path:"/report",element:c.jsx(Ale,{})}),c.jsx(qr,{path:"/settings",element:c.jsx(gle,{})})]})})})}const Nle=new EM({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});Hm.createRoot(document.getElementById("root")).render(c.jsx(_.StrictMode,{children:c.jsx(TM,{client:Nle,children:c.jsx(Ele,{})})})); + `}),c.jsxs("div",{className:"no-print",style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[c.jsx("div",{className:"muted",style:{fontSize:12},children:"Tip: Use browser “Save as PDF”. If the print dialog didn’t open, press Ctrl+P."}),c.jsx("button",{onClick:()=>window.print(),style:{padding:"8px 12px",border:"1px solid #e5e7eb",borderRadius:8,background:"white"},children:"Print / Save PDF"})]}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:12},children:[c.jsxs("div",{children:[c.jsx("div",{style:{fontSize:22,fontWeight:800,color:"#111827"},children:v}),c.jsxs("div",{className:"muted",style:{fontSize:12,marginTop:4},children:["Generated: ",new Date().toLocaleString()]})]}),c.jsxs("div",{className:"muted",style:{fontSize:12,textAlign:"right"},children:[c.jsxs("div",{children:["Project: ",r.project||"All"]}),c.jsxs("div",{children:["Start: ",oP(r.startDate)]}),c.jsxs("div",{children:["End: ",oP(r.endDate)]})]})]}),c.jsx("div",{style:{height:4,borderRadius:999,background:"linear-gradient(90deg, #2563eb, #8b5cf6, #10b981)",marginTop:10}}),i?c.jsx("div",{style:{marginTop:24},className:"muted",children:"Loading report data…"}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:10,marginTop:18},children:[c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Total Runs"}),c.jsx("div",{className:"kpi-val",children:a.total.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Success"}),c.jsx("div",{className:"kpi-val",children:a.success.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Failed"}),c.jsx("div",{className:"kpi-val",children:a.failed.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Cancelled"}),c.jsx("div",{className:"kpi-val",children:a.cancelled.toLocaleString()})]}),c.jsxs("div",{className:"kpi",children:[c.jsx("div",{className:"kpi-title",children:"Total Shots"}),c.jsx("div",{className:"kpi-val",children:a.shots.toLocaleString()})]})]}),(t==="executive"||t==="home"||t==="analytics")&&c.jsxs("div",{style:{marginTop:18,display:"grid",gridTemplateColumns:"1.4fr 1fr",gap:14},children:[c.jsx(Ur,{title:"Run Volume Over Time",children:c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsxs(_p,{data:h,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),c.jsx(it,{dataKey:"label",tick:{fill:"#374151",fontSize:11}}),c.jsx(at,{tick:{fill:"#374151",fontSize:11}}),c.jsx($e,{}),c.jsx(Ji,{type:"monotone",dataKey:"runs",stroke:ct.blue,strokeWidth:2,dot:{r:2}})]})})})}),c.jsxs(Ur,{title:"Status Distribution",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:f,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,label:({name:m,percent:y})=>`${String(m)} ${(y*100).toFixed(0)}%`,children:f.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Hm,{items:f,total:a.total})]})]}),t==="provider_backend"&&c.jsxs("div",{style:{marginTop:18,display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[c.jsx(Ur,{title:"Top Providers (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:s.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})}),c.jsx(Ur,{title:"Top Backends (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:l.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})}),c.jsxs(Ur,{title:"Provider Share (donut)",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:u,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,children:u.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Hm,{items:u,total:a.total})]}),c.jsx(Ur,{title:"Shots Distribution (buckets)",children:c.jsx("div",{style:{width:"100%",height:220},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsxs(Ts,{data:d,children:[c.jsx(Ht,{strokeDasharray:"3 3",stroke:"#e5e7eb"}),c.jsx(it,{dataKey:"label",tick:{fill:"#374151",fontSize:11}}),c.jsx(at,{tick:{fill:"#374151",fontSize:11}}),c.jsx($e,{}),c.jsx(or,{dataKey:"value",fill:ct.violet})]})})})}),c.jsx(Ur,{title:"Projects (by run count)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Runs"})]})}),c.jsx("tbody",{children:o.slice(0,12).map(([m,y])=>c.jsxs("tr",{children:[c.jsx("td",{children:m}),c.jsx("td",{children:y.toLocaleString()})]},m))})]})})]}),t==="quality_anomaly"&&c.jsxs("div",{style:{marginTop:18},children:[c.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:14},children:[c.jsxs(Ur,{title:"Anomaly Counters",children:[c.jsxs("div",{style:{fontSize:12,color:"#111827",lineHeight:1.6},children:[c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.amber},children:n.filter(m=>m.provider==="unknown"||m.backend_name==="unknown").length.toLocaleString()})," ","runs with unknown provider/backend"]}),c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.violet},children:n.filter(m=>(m.shots||0)<=10).length.toLocaleString()})," ","low-shot runs (≤ 10)"]}),c.jsxs("div",{children:[c.jsx("span",{style:{fontWeight:800,color:ct.red},children:a.failed.toLocaleString()})," failed runs"]})]}),c.jsx("div",{className:"muted",style:{marginTop:8,fontSize:12},children:"The table below lists a sample of runs that match these conditions."})]}),c.jsxs(Ur,{title:"Status Distribution",children:[c.jsx("div",{style:{width:"100%",height:200},children:c.jsx(tt,{width:"100%",height:"100%",children:c.jsx(Ql,{children:c.jsx(yr,{data:f,dataKey:"value",nameKey:"name",innerRadius:48,outerRadius:78,labelLine:!1,label:({name:m,percent:y})=>`${String(m)} ${(y*100).toFixed(0)}%`,children:f.map(m=>c.jsx(vr,{fill:m.color},m.name))})})})}),c.jsx(Hm,{items:f,total:a.total})]})]}),c.jsx("div",{style:{marginTop:14},children:c.jsx(Ur,{title:"Anomalous Runs (sample)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Run ID"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Shots"})]})}),c.jsx("tbody",{children:p.map(m=>c.jsxs("tr",{children:[c.jsx("td",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m.run_id}),c.jsx("td",{children:new Date(m.created_at).toLocaleString()}),c.jsx("td",{children:m.project}),c.jsx("td",{style:{color:m.provider==="unknown"?ct.amber:"#111827"},children:m.provider}),c.jsx("td",{style:{color:m.backend_name==="unknown"?ct.amber:"#111827"},children:m.backend_name}),c.jsx("td",{style:{color:m.status==="failed"?ct.red:"#111827"},children:m.status}),c.jsx("td",{style:{color:(m.shots||0)<=10?ct.violet:"#111827"},children:(m.shots||0).toLocaleString()})]},m.run_id))})]})})})]}),c.jsx("div",{className:"page-break",style:{marginTop:22},children:c.jsx(Ur,{title:"Recent Runs (sample)",children:c.jsxs("table",{children:[c.jsx("thead",{children:c.jsxs("tr",{children:[c.jsx("th",{children:"Run ID"}),c.jsx("th",{children:"Time"}),c.jsx("th",{children:"Project"}),c.jsx("th",{children:"Provider"}),c.jsx("th",{children:"Backend"}),c.jsx("th",{children:"Status"}),c.jsx("th",{children:"Shots"})]})}),c.jsx("tbody",{children:n.slice().sort((m,y)=>new Date(y.created_at).getTime()-new Date(m.created_at).getTime()).slice(0,35).map(m=>c.jsxs("tr",{children:[c.jsx("td",{style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace"},children:m.run_id}),c.jsx("td",{children:new Date(m.created_at).toLocaleString()}),c.jsx("td",{children:m.project}),c.jsx("td",{children:m.provider}),c.jsx("td",{children:m.backend_name}),c.jsx("td",{children:m.status}),c.jsx("td",{children:(m.shots||0).toLocaleString()})]},m.run_id))})]})})})]})]})}function Nle(){const[e,t]=k.useState({}),r=n=>{t(n)};return c.jsx(WR,{children:c.jsx(HI,{onFilterChange:r,children:c.jsxs(DR,{children:[c.jsx(qr,{path:"/",element:c.jsx(Vse,{filters:e})}),c.jsx(qr,{path:"/search",element:c.jsx(Ole,{})}),c.jsx(qr,{path:"/runs/:runId",element:c.jsx(rle,{})}),c.jsx(qr,{path:"/runs-filtered",element:c.jsx(jle,{})}),c.jsx(qr,{path:"/compare",element:c.jsx(sle,{})}),c.jsx(qr,{path:"/analytics",element:c.jsx(yle,{filters:e})}),c.jsx(qr,{path:"/algorithms",element:c.jsx(gle,{filters:e})}),c.jsx(qr,{path:"/reports",element:c.jsx(_le,{})}),c.jsx(qr,{path:"/report",element:c.jsx(Ele,{})}),c.jsx(qr,{path:"/settings",element:c.jsx(xle,{})})]})})})}const Tle=new NM({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}});Km.createRoot(document.getElementById("root")).render(c.jsx(_.StrictMode,{children:c.jsx($M,{client:Tle,children:c.jsx(Nle,{})})})); diff --git a/packages/qobserva_ui_react/dist/index.html b/packages/qobserva_ui_react/dist/index.html index ecd1d577..f889e629 100644 --- a/packages/qobserva_ui_react/dist/index.html +++ b/packages/qobserva_ui_react/dist/index.html @@ -17,8 +17,8 @@ QObserva Dashboard - - + +
diff --git a/packages/qobserva_ui_react/node_modules/@babel/generator/lib/generators/deprecated.js b/packages/qobserva_ui_react/node_modules/@babel/generator/lib/generators/deprecated.js new file mode 100644 index 00000000..0941179b --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/@babel/generator/lib/generators/deprecated.js @@ -0,0 +1,74 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.addDeprecatedGenerators = addDeprecatedGenerators; +function addDeprecatedGenerators(PrinterClass) { + const deprecatedBabel7Generators = { + Noop() {}, + TSExpressionWithTypeArguments(node) { + this.print(node.expression); + this.print(node.typeParameters); + }, + DecimalLiteral(node) { + const raw = this.getPossibleRaw(node); + if (!this.format.minified && raw !== undefined) { + this.word(raw); + return; + } + this.word(node.value + "m"); + }, + RecordExpression(node) { + const props = node.properties; + let startToken; + let endToken; + if (this.format.recordAndTupleSyntaxType === "bar") { + startToken = "{|"; + endToken = "|}"; + } else if (this.format.recordAndTupleSyntaxType !== "hash" && this.format.recordAndTupleSyntaxType != null) { + throw new Error(`The "recordAndTupleSyntaxType" generator option must be "bar" or "hash" (${JSON.stringify(this.format.recordAndTupleSyntaxType)} received).`); + } else { + startToken = "#{"; + endToken = "}"; + } + this.token(startToken); + if (props.length) { + this.space(); + this.printList(props, this.shouldPrintTrailingComma(endToken), true, true); + this.space(); + } + this.token(endToken); + }, + TupleExpression(node) { + const elems = node.elements; + const len = elems.length; + let startToken; + let endToken; + if (this.format.recordAndTupleSyntaxType === "bar") { + startToken = "[|"; + endToken = "|]"; + } else if (this.format.recordAndTupleSyntaxType === "hash") { + startToken = "#["; + endToken = "]"; + } else { + throw new Error(`${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`); + } + this.token(startToken); + for (let i = 0; i < elems.length; i++) { + const elem = elems[i]; + if (elem) { + if (i > 0) this.space(); + this.print(elem); + if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) { + this.token(",", false, i); + } + } + } + this.token(endToken); + } + }; + Object.assign(PrinterClass.prototype, deprecatedBabel7Generators); +} + +//# sourceMappingURL=deprecated.js.map diff --git a/packages/qobserva_ui_react/node_modules/@babel/generator/lib/generators/deprecated.js.map b/packages/qobserva_ui_react/node_modules/@babel/generator/lib/generators/deprecated.js.map new file mode 100644 index 00000000..1b1efa67 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/@babel/generator/lib/generators/deprecated.js.map @@ -0,0 +1 @@ +{"version":3,"names":["addDeprecatedGenerators","PrinterClass","deprecatedBabel7Generators","Noop","TSExpressionWithTypeArguments","node","print","expression","typeParameters","DecimalLiteral","raw","getPossibleRaw","format","minified","undefined","word","value","RecordExpression","props","properties","startToken","endToken","recordAndTupleSyntaxType","Error","JSON","stringify","token","length","space","printList","shouldPrintTrailingComma","TupleExpression","elems","elements","len","i","elem","Object","assign","prototype"],"sources":["../../src/generators/deprecated.ts"],"sourcesContent":["import type Printer from \"../printer\";\nimport type * as t from \"@babel/types\";\n\nexport type DeprecatedBabel7ASTTypes =\n | \"Noop\"\n | \"TSExpressionWithTypeArguments\"\n | \"DecimalLiteral\"\n | \"RecordExpression\"\n | \"TupleExpression\";\n\nexport function addDeprecatedGenerators(PrinterClass: typeof Printer) {\n // Add Babel 7 generator methods that is removed in Babel 8\n if (!process.env.BABEL_8_BREAKING) {\n const deprecatedBabel7Generators = {\n Noop(this: Printer) {},\n\n TSExpressionWithTypeArguments(\n this: Printer,\n // @ts-ignore(Babel 7 vs Babel 8) Babel 7 AST\n node: t.TSExpressionWithTypeArguments,\n ) {\n this.print(node.expression);\n this.print(node.typeParameters);\n },\n\n DecimalLiteral(this: Printer, node: any) {\n const raw = this.getPossibleRaw(node);\n if (!this.format.minified && raw !== undefined) {\n this.word(raw);\n return;\n }\n this.word(node.value + \"m\");\n },\n\n // @ts-ignore(Babel 7 vs Babel 8) - t.RecordExpression only exists in Babel 7\n RecordExpression(this: Printer, node: t.RecordExpression) {\n const props = node.properties;\n\n let startToken;\n let endToken;\n\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"{|\";\n endToken = \"|}\";\n } else if (\n this.format.recordAndTupleSyntaxType !== \"hash\" &&\n this.format.recordAndTupleSyntaxType != null\n ) {\n throw new Error(\n `The \"recordAndTupleSyntaxType\" generator option must be \"bar\" or \"hash\" (${JSON.stringify(\n this.format.recordAndTupleSyntaxType,\n )} received).`,\n );\n } else {\n startToken = \"#{\";\n endToken = \"}\";\n }\n\n this.token(startToken);\n\n if (props.length) {\n this.space();\n this.printList(\n props,\n this.shouldPrintTrailingComma(endToken),\n true,\n true,\n );\n this.space();\n }\n this.token(endToken);\n },\n\n // @ts-ignore(Babel 7 vs Babel 8) - t.TupleExpression only exists in Babel 7\n TupleExpression(this: Printer, node: t.TupleExpression) {\n const elems = node.elements;\n const len = elems.length;\n\n let startToken;\n let endToken;\n if (process.env.BABEL_8_BREAKING) {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n if (this.format.recordAndTupleSyntaxType === \"bar\") {\n startToken = \"[|\";\n endToken = \"|]\";\n } else if (this.format.recordAndTupleSyntaxType === \"hash\") {\n startToken = \"#[\";\n endToken = \"]\";\n } else {\n throw new Error(\n `${this.format.recordAndTupleSyntaxType} is not a valid recordAndTuple syntax type`,\n );\n }\n }\n\n this.token(startToken);\n\n for (let i = 0; i < elems.length; i++) {\n const elem = elems[i];\n if (elem) {\n if (i > 0) this.space();\n this.print(elem);\n if (i < len - 1 || this.shouldPrintTrailingComma(endToken)) {\n this.token(\",\", false, i);\n }\n }\n }\n\n this.token(endToken);\n },\n } satisfies Record<\n DeprecatedBabel7ASTTypes,\n (this: Printer, node: any) => void\n >;\n Object.assign(PrinterClass.prototype, deprecatedBabel7Generators);\n }\n}\n"],"mappings":";;;;;;AAUO,SAASA,uBAAuBA,CAACC,YAA4B,EAAE;EAGlE,MAAMC,0BAA0B,GAAG;IACjCC,IAAIA,CAAA,EAAgB,CAAC,CAAC;IAEtBC,6BAA6BA,CAG3BC,IAAqC,EACrC;MACA,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,UAAU,CAAC;MAC3B,IAAI,CAACD,KAAK,CAACD,IAAI,CAACG,cAAc,CAAC;IACjC,CAAC;IAEDC,cAAcA,CAAgBJ,IAAS,EAAE;MACvC,MAAMK,GAAG,GAAG,IAAI,CAACC,cAAc,CAACN,IAAI,CAAC;MACrC,IAAI,CAAC,IAAI,CAACO,MAAM,CAACC,QAAQ,IAAIH,GAAG,KAAKI,SAAS,EAAE;QAC9C,IAAI,CAACC,IAAI,CAACL,GAAG,CAAC;QACd;MACF;MACA,IAAI,CAACK,IAAI,CAACV,IAAI,CAACW,KAAK,GAAG,GAAG,CAAC;IAC7B,CAAC;IAGDC,gBAAgBA,CAAgBZ,IAAwB,EAAE;MACxD,MAAMa,KAAK,GAAGb,IAAI,CAACc,UAAU;MAE7B,IAAIC,UAAU;MACd,IAAIC,QAAQ;MAEZ,IAAI,IAAI,CAACT,MAAM,CAACU,wBAAwB,KAAK,KAAK,EAAE;QAClDF,UAAU,GAAG,IAAI;QACjBC,QAAQ,GAAG,IAAI;MACjB,CAAC,MAAM,IACL,IAAI,CAACT,MAAM,CAACU,wBAAwB,KAAK,MAAM,IAC/C,IAAI,CAACV,MAAM,CAACU,wBAAwB,IAAI,IAAI,EAC5C;QACA,MAAM,IAAIC,KAAK,CACb,4EAA4EC,IAAI,CAACC,SAAS,CACxF,IAAI,CAACb,MAAM,CAACU,wBACd,CAAC,aACH,CAAC;MACH,CAAC,MAAM;QACLF,UAAU,GAAG,IAAI;QACjBC,QAAQ,GAAG,GAAG;MAChB;MAEA,IAAI,CAACK,KAAK,CAACN,UAAU,CAAC;MAEtB,IAAIF,KAAK,CAACS,MAAM,EAAE;QAChB,IAAI,CAACC,KAAK,CAAC,CAAC;QACZ,IAAI,CAACC,SAAS,CACZX,KAAK,EACL,IAAI,CAACY,wBAAwB,CAACT,QAAQ,CAAC,EACvC,IAAI,EACJ,IACF,CAAC;QACD,IAAI,CAACO,KAAK,CAAC,CAAC;MACd;MACA,IAAI,CAACF,KAAK,CAACL,QAAQ,CAAC;IACtB,CAAC;IAGDU,eAAeA,CAAgB1B,IAAuB,EAAE;MACtD,MAAM2B,KAAK,GAAG3B,IAAI,CAAC4B,QAAQ;MAC3B,MAAMC,GAAG,GAAGF,KAAK,CAACL,MAAM;MAExB,IAAIP,UAAU;MACd,IAAIC,QAAQ;MAKV,IAAI,IAAI,CAACT,MAAM,CAACU,wBAAwB,KAAK,KAAK,EAAE;QAClDF,UAAU,GAAG,IAAI;QACjBC,QAAQ,GAAG,IAAI;MACjB,CAAC,MAAM,IAAI,IAAI,CAACT,MAAM,CAACU,wBAAwB,KAAK,MAAM,EAAE;QAC1DF,UAAU,GAAG,IAAI;QACjBC,QAAQ,GAAG,GAAG;MAChB,CAAC,MAAM;QACL,MAAM,IAAIE,KAAK,CACb,GAAG,IAAI,CAACX,MAAM,CAACU,wBAAwB,4CACzC,CAAC;MACH;MAGF,IAAI,CAACI,KAAK,CAACN,UAAU,CAAC;MAEtB,KAAK,IAAIe,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,KAAK,CAACL,MAAM,EAAEQ,CAAC,EAAE,EAAE;QACrC,MAAMC,IAAI,GAAGJ,KAAK,CAACG,CAAC,CAAC;QACrB,IAAIC,IAAI,EAAE;UACR,IAAID,CAAC,GAAG,CAAC,EAAE,IAAI,CAACP,KAAK,CAAC,CAAC;UACvB,IAAI,CAACtB,KAAK,CAAC8B,IAAI,CAAC;UAChB,IAAID,CAAC,GAAGD,GAAG,GAAG,CAAC,IAAI,IAAI,CAACJ,wBAAwB,CAACT,QAAQ,CAAC,EAAE;YAC1D,IAAI,CAACK,KAAK,CAAC,GAAG,EAAE,KAAK,EAAES,CAAC,CAAC;UAC3B;QACF;MACF;MAEA,IAAI,CAACT,KAAK,CAACL,QAAQ,CAAC;IACtB;EACF,CAGC;EACDgB,MAAM,CAACC,MAAM,CAACrC,YAAY,CAACsC,SAAS,EAAErC,0BAA0B,CAAC;AAErE","ignoreList":[]} \ No newline at end of file diff --git a/packages/qobserva_ui_react/node_modules/@babel/types/lib/definitions/deprecated-aliases.js b/packages/qobserva_ui_react/node_modules/@babel/types/lib/definitions/deprecated-aliases.js new file mode 100644 index 00000000..03a37517 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/@babel/types/lib/definitions/deprecated-aliases.js @@ -0,0 +1,11 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.DEPRECATED_ALIASES = void 0; +const DEPRECATED_ALIASES = exports.DEPRECATED_ALIASES = { + ModuleDeclaration: "ImportOrExportDeclaration" +}; + +//# sourceMappingURL=deprecated-aliases.js.map diff --git a/packages/qobserva_ui_react/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map b/packages/qobserva_ui_react/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map new file mode 100644 index 00000000..1d3dbcb9 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/@babel/types/lib/definitions/deprecated-aliases.js.map @@ -0,0 +1 @@ +{"version":3,"names":["DEPRECATED_ALIASES","exports","ModuleDeclaration"],"sources":["../../src/definitions/deprecated-aliases.ts"],"sourcesContent":["export const DEPRECATED_ALIASES = {\n ModuleDeclaration: \"ImportOrExportDeclaration\",\n};\n"],"mappings":";;;;;;AAAO,MAAMA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,iBAAiB,EAAE;AACrB,CAAC","ignoreList":[]} \ No newline at end of file diff --git a/packages/qobserva_ui_react/node_modules/@babel/types/lib/utils/deprecationWarning.js b/packages/qobserva_ui_react/node_modules/@babel/types/lib/utils/deprecationWarning.js new file mode 100644 index 00000000..6c369382 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/@babel/types/lib/utils/deprecationWarning.js @@ -0,0 +1,44 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.default = deprecationWarning; +const warnings = new Set(); +function deprecationWarning(oldName, newName, prefix = "", cacheKey = oldName) { + if (warnings.has(cacheKey)) return; + warnings.add(cacheKey); + const { + internal, + trace + } = captureShortStackTrace(1, 2); + if (internal) { + return; + } + console.warn(`${prefix}\`${oldName}\` has been deprecated, please migrate to \`${newName}\`\n${trace}`); +} +function captureShortStackTrace(skip, length) { + const { + stackTraceLimit, + prepareStackTrace + } = Error; + let stackTrace; + Error.stackTraceLimit = 1 + skip + length; + Error.prepareStackTrace = function (err, stack) { + stackTrace = stack; + }; + new Error().stack; + Error.stackTraceLimit = stackTraceLimit; + Error.prepareStackTrace = prepareStackTrace; + if (!stackTrace) return { + internal: false, + trace: "" + }; + const shortStackTrace = stackTrace.slice(1 + skip, 1 + skip + length); + return { + internal: /[\\/]@babel[\\/]/.test(shortStackTrace[1].getFileName()), + trace: shortStackTrace.map(frame => ` at ${frame}`).join("\n") + }; +} + +//# sourceMappingURL=deprecationWarning.js.map diff --git a/packages/qobserva_ui_react/node_modules/@babel/types/lib/utils/deprecationWarning.js.map b/packages/qobserva_ui_react/node_modules/@babel/types/lib/utils/deprecationWarning.js.map new file mode 100644 index 00000000..1d96e3ee --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/@babel/types/lib/utils/deprecationWarning.js.map @@ -0,0 +1 @@ +{"version":3,"names":["warnings","Set","deprecationWarning","oldName","newName","prefix","cacheKey","has","add","internal","trace","captureShortStackTrace","console","warn","skip","length","stackTraceLimit","prepareStackTrace","Error","stackTrace","err","stack","shortStackTrace","slice","test","getFileName","map","frame","join"],"sources":["../../src/utils/deprecationWarning.ts"],"sourcesContent":["const warnings = new Set();\n\nexport default function deprecationWarning(\n oldName: string,\n newName: string,\n prefix: string = \"\",\n cacheKey: string = oldName,\n) {\n if (warnings.has(cacheKey)) return;\n warnings.add(cacheKey);\n\n const { internal, trace } = captureShortStackTrace(1, 2);\n if (internal) {\n // If usage comes from an internal package, there is no point in warning because\n // 1. The new version of the package will already use the new API\n // 2. When the deprecation will become an error (in a future major version), users\n // will have to update every package anyway.\n return;\n }\n console.warn(\n `${prefix}\\`${oldName}\\` has been deprecated, please migrate to \\`${newName}\\`\\n${trace}`,\n );\n}\n\nfunction captureShortStackTrace(skip: number, length: number) {\n const { stackTraceLimit, prepareStackTrace } = Error;\n let stackTrace: NodeJS.CallSite[];\n // We add 1 to also take into account this function.\n Error.stackTraceLimit = 1 + skip + length;\n Error.prepareStackTrace = function (err, stack) {\n stackTrace = stack;\n };\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n new Error().stack;\n Error.stackTraceLimit = stackTraceLimit;\n Error.prepareStackTrace = prepareStackTrace;\n\n if (!stackTrace) return { internal: false, trace: \"\" };\n\n const shortStackTrace = stackTrace.slice(1 + skip, 1 + skip + length);\n return {\n internal: /[\\\\/]@babel[\\\\/]/.test(shortStackTrace[1].getFileName()),\n trace: shortStackTrace.map(frame => ` at ${frame}`).join(\"\\n\"),\n };\n}\n"],"mappings":";;;;;;AAAA,MAAMA,QAAQ,GAAG,IAAIC,GAAG,CAAC,CAAC;AAEX,SAASC,kBAAkBA,CACxCC,OAAe,EACfC,OAAe,EACfC,MAAc,GAAG,EAAE,EACnBC,QAAgB,GAAGH,OAAO,EAC1B;EACA,IAAIH,QAAQ,CAACO,GAAG,CAACD,QAAQ,CAAC,EAAE;EAC5BN,QAAQ,CAACQ,GAAG,CAACF,QAAQ,CAAC;EAEtB,MAAM;IAAEG,QAAQ;IAAEC;EAAM,CAAC,GAAGC,sBAAsB,CAAC,CAAC,EAAE,CAAC,CAAC;EACxD,IAAIF,QAAQ,EAAE;IAKZ;EACF;EACAG,OAAO,CAACC,IAAI,CACV,GAAGR,MAAM,KAAKF,OAAO,+CAA+CC,OAAO,OAAOM,KAAK,EACzF,CAAC;AACH;AAEA,SAASC,sBAAsBA,CAACG,IAAY,EAAEC,MAAc,EAAE;EAC5D,MAAM;IAAEC,eAAe;IAAEC;EAAkB,CAAC,GAAGC,KAAK;EACpD,IAAIC,UAA6B;EAEjCD,KAAK,CAACF,eAAe,GAAG,CAAC,GAAGF,IAAI,GAAGC,MAAM;EACzCG,KAAK,CAACD,iBAAiB,GAAG,UAAUG,GAAG,EAAEC,KAAK,EAAE;IAC9CF,UAAU,GAAGE,KAAK;EACpB,CAAC;EAED,IAAIH,KAAK,CAAC,CAAC,CAACG,KAAK;EACjBH,KAAK,CAACF,eAAe,GAAGA,eAAe;EACvCE,KAAK,CAACD,iBAAiB,GAAGA,iBAAiB;EAE3C,IAAI,CAACE,UAAU,EAAE,OAAO;IAAEV,QAAQ,EAAE,KAAK;IAAEC,KAAK,EAAE;EAAG,CAAC;EAEtD,MAAMY,eAAe,GAAGH,UAAU,CAACI,KAAK,CAAC,CAAC,GAAGT,IAAI,EAAE,CAAC,GAAGA,IAAI,GAAGC,MAAM,CAAC;EACrE,OAAO;IACLN,QAAQ,EAAE,kBAAkB,CAACe,IAAI,CAACF,eAAe,CAAC,CAAC,CAAC,CAACG,WAAW,CAAC,CAAC,CAAC;IACnEf,KAAK,EAAEY,eAAe,CAACI,GAAG,CAACC,KAAK,IAAI,UAAUA,KAAK,EAAE,CAAC,CAACC,IAAI,CAAC,IAAI;EAClE,CAAC;AACH","ignoreList":[]} \ No newline at end of file diff --git a/packages/qobserva_ui_react/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js b/packages/qobserva_ui_react/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js new file mode 100644 index 00000000..91907b13 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/@eslint/eslintrc/lib/shared/deprecation-warnings.js @@ -0,0 +1,63 @@ +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +import path from "path"; + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Defitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect.", + ESLINT_PERSONAL_CONFIG_LOAD: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please use a config file per project or the '--config' option.", + ESLINT_PERSONAL_CONFIG_SUPPRESS: + "'~/.eslintrc.*' config files have been deprecated. " + + "Please remove it or add 'root:true' to the config files in your " + + "projects in order to avoid loading '~/.eslintrc.*' accidentally." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + sourceFileErrorCache.add(cacheKey); + + const rel = path.relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +export { + emitDeprecationWarning +}; diff --git a/packages/qobserva_ui_react/node_modules/ajv/lib/dot/dependencies.jst b/packages/qobserva_ui_react/node_modules/ajv/lib/dot/dependencies.jst new file mode 100644 index 00000000..e4bdddec --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/ajv/lib/dot/dependencies.jst @@ -0,0 +1,79 @@ +{{# def.definitions }} +{{# def.errors }} +{{# def.missing }} +{{# def.setupKeyword }} +{{# def.setupNextLevel }} + + +{{## def.propertyInData: + {{=$data}}{{= it.util.getProperty($property) }} !== undefined + {{? $ownProperties }} + && Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($property)}}') + {{?}} +#}} + + +{{ + var $schemaDeps = {} + , $propertyDeps = {} + , $ownProperties = it.opts.ownProperties; + + for ($property in $schema) { + if ($property == '__proto__') continue; + var $sch = $schema[$property]; + var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; + $deps[$property] = $sch; + } +}} + +var {{=$errs}} = errors; + +{{ var $currentErrorPath = it.errorPath; }} + +var missing{{=$lvl}}; +{{ for (var $property in $propertyDeps) { }} + {{ $deps = $propertyDeps[$property]; }} + {{? $deps.length }} + if ({{# def.propertyInData }} + {{? $breakOnError }} + && ({{# def.checkMissingProperty:$deps }})) { + {{# def.errorMissingProperty:'dependencies' }} + {{??}} + ) { + {{~ $deps:$propertyKey }} + {{# def.allErrorsMissingProperty:'dependencies' }} + {{~}} + {{?}} + } {{# def.elseIfValid }} + {{?}} +{{ } }} + +{{ + it.errorPath = $currentErrorPath; + var $currentBaseId = $it.baseId; +}} + + +{{ for (var $property in $schemaDeps) { }} + {{ var $sch = $schemaDeps[$property]; }} + {{? {{# def.nonEmptySchema:$sch }} }} + {{=$nextValid}} = true; + + if ({{# def.propertyInData }}) { + {{ + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + }} + + {{# def.insertSubschemaCode }} + } + + {{# def.ifResultValid }} + {{?}} +{{ } }} + +{{? $breakOnError }} + {{= $closingBraces }} + if ({{=$errs}} == errors) { +{{?}} diff --git a/packages/qobserva_ui_react/node_modules/ajv/lib/dotjs/dependencies.js b/packages/qobserva_ui_react/node_modules/ajv/lib/dotjs/dependencies.js new file mode 100644 index 00000000..e4829497 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/ajv/lib/dotjs/dependencies.js @@ -0,0 +1,168 @@ +'use strict'; +module.exports = function generate_dependencies(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $data = 'data' + ($dataLvl || ''); + var $errs = 'errs__' + $lvl; + var $it = it.util.copy(it); + var $closingBraces = ''; + $it.level++; + var $nextValid = 'valid' + $it.level; + var $schemaDeps = {}, + $propertyDeps = {}, + $ownProperties = it.opts.ownProperties; + for ($property in $schema) { + if ($property == '__proto__') continue; + var $sch = $schema[$property]; + var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps; + $deps[$property] = $sch; + } + out += 'var ' + ($errs) + ' = errors;'; + var $currentErrorPath = it.errorPath; + out += 'var missing' + ($lvl) + ';'; + for (var $property in $propertyDeps) { + $deps = $propertyDeps[$property]; + if ($deps.length) { + out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; + } + if ($breakOnError) { + out += ' && ( '; + var arr1 = $deps; + if (arr1) { + var $propertyKey, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $propertyKey = arr1[$i += 1]; + if ($i) { + out += ' || '; + } + var $prop = it.util.getProperty($propertyKey), + $useData = $data + $prop; + out += ' ( ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; + } + } + out += ')) { '; + var $propertyPath = 'missing' + $lvl, + $missingProperty = '\' + ' + $propertyPath + ' + \''; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should have '; + if ($deps.length == 1) { + out += 'property ' + (it.util.escapeQuotes($deps[0])); + } else { + out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); + } + out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { + /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } else { + out += ' ) { '; + var arr2 = $deps; + if (arr2) { + var $propertyKey, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $propertyKey = arr2[i2 += 1]; + var $prop = it.util.getProperty($propertyKey), + $missingProperty = it.util.escapeQuotes($propertyKey), + $useData = $data + $prop; + if (it.opts._errorDataPathProperty) { + it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); + } + out += ' if ( ' + ($useData) + ' === undefined '; + if ($ownProperties) { + out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; + } + out += ') { var err = '; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should have '; + if ($deps.length == 1) { + out += 'property ' + (it.util.escapeQuotes($deps[0])); + } else { + out += 'properties ' + (it.util.escapeQuotes($deps.join(", "))); + } + out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; + } + } + } + out += ' } '; + if ($breakOnError) { + $closingBraces += '}'; + out += ' else { '; + } + } + } + it.errorPath = $currentErrorPath; + var $currentBaseId = $it.baseId; + for (var $property in $schemaDeps) { + var $sch = $schemaDeps[$property]; + if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) { + out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined '; + if ($ownProperties) { + out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') '; + } + out += ') { '; + $it.schema = $sch; + $it.schemaPath = $schemaPath + it.util.getProperty($property); + $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property); + out += ' ' + (it.validate($it)) + ' '; + $it.baseId = $currentBaseId; + out += ' } '; + if ($breakOnError) { + out += ' if (' + ($nextValid) + ') { '; + $closingBraces += '}'; + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + } + return out; +} diff --git a/packages/qobserva_ui_react/node_modules/axios/lib/helpers/deprecatedMethod.js b/packages/qobserva_ui_react/node_modules/axios/lib/helpers/deprecatedMethod.js new file mode 100644 index 00000000..9e8fae6b --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/axios/lib/helpers/deprecatedMethod.js @@ -0,0 +1,26 @@ +'use strict'; + +/*eslint no-console:0*/ + +/** + * Supply a warning to the developer that a method they are using + * has been deprecated. + * + * @param {string} method The name of the deprecated method + * @param {string} [instead] The alternate method to use if applicable + * @param {string} [docs] The documentation URL to get further details + * + * @returns {void} + */ +export default function deprecatedMethod(method, instead, docs) { + try { + console.warn( + 'DEPRECATED method `' + method + '`.' + + (instead ? ' Use `' + instead + '` instead.' : '') + + ' This method will be removed in a future release.'); + + if (docs) { + console.warn('For more information about usage see ' + docs); + } + } catch (e) { /* Ignore */ } +} diff --git a/packages/qobserva_ui_react/node_modules/eslint/lib/shared/deprecation-warnings.js b/packages/qobserva_ui_react/node_modules/eslint/lib/shared/deprecation-warnings.js new file mode 100644 index 00000000..d09cafb0 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/eslint/lib/shared/deprecation-warnings.js @@ -0,0 +1,58 @@ +/** + * @fileoverview Provide the function that emits deprecation warnings. + * @author Toru Nagashima + */ +"use strict"; + +//------------------------------------------------------------------------------ +// Requirements +//------------------------------------------------------------------------------ + +const path = require("path"); + +//------------------------------------------------------------------------------ +// Private +//------------------------------------------------------------------------------ + +// Definitions for deprecation warnings. +const deprecationWarningMessages = { + ESLINT_LEGACY_ECMAFEATURES: + "The 'ecmaFeatures' config file property is deprecated and has no effect." +}; + +const sourceFileErrorCache = new Set(); + +/** + * Emits a deprecation warning containing a given filepath. A new deprecation warning is emitted + * for each unique file path, but repeated invocations with the same file path have no effect. + * No warnings are emitted if the `--no-deprecation` or `--no-warnings` Node runtime flags are active. + * @param {string} source The name of the configuration source to report the warning for. + * @param {string} errorCode The warning message to show. + * @returns {void} + */ +function emitDeprecationWarning(source, errorCode) { + const cacheKey = JSON.stringify({ source, errorCode }); + + if (sourceFileErrorCache.has(cacheKey)) { + return; + } + + sourceFileErrorCache.add(cacheKey); + + const rel = path.relative(process.cwd(), source); + const message = deprecationWarningMessages[errorCode]; + + process.emitWarning( + `${message} (found in "${rel}")`, + "DeprecationWarning", + errorCode + ); +} + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ + +module.exports = { + emitDeprecationWarning +}; diff --git a/packages/qobserva_ui_react/node_modules/fraction.js/tests/fraction.test.js b/packages/qobserva_ui_react/node_modules/fraction.js/tests/fraction.test.js new file mode 100644 index 00000000..b65833c5 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/fraction.js/tests/fraction.test.js @@ -0,0 +1,1806 @@ +const Fraction = require('fraction.js'); +const assert = require('assert'); + +var DivisionByZero = function () { return new Error("Division by Zero"); }; +var InvalidParameter = function () { return new Error("Invalid argument"); }; +var NonIntegerParameter = function () { return new Error("Parameters must be integer"); }; + +var tests = [{ + set: "", + expectError: InvalidParameter() +}, { + set: "foo", + expectError: InvalidParameter() +}, { + set: " 123", + expectError: InvalidParameter() +}, { + set: 0, + expect: 0 +}, { + set: .2, + expect: "0.2" +}, { + set: .333, + expect: "0.333" +}, { + set: 1.1, + expect: "1.1" +}, { + set: 1.2, + expect: "1.2" +}, { + set: 1.3, + expect: "1.3" +}, { + set: 1.4, + expect: "1.4" +}, { + set: 1.5, + expect: "1.5" +}, { + set: 2.555, + expect: "2.555" +}, { + set: 1e12, + expect: "1000000000000" +}, { + set: " - ", + expectError: InvalidParameter() +}, { + set: ".5", + expect: "0.5" +}, { + set: "2_000_000", + expect: "2000000" +}, { + set: "-.5", + expect: "-0.5" +}, { + set: "123", + expect: "123" +}, { + set: "-123", + expect: "-123" +}, { + set: "123.4", + expect: "123.4" +}, { + set: "-123.4", + expect: "-123.4" +}, { + set: "123.", + expect: "123" +}, { + set: "-123.", + expect: "-123" +}, { + set: "123.4(56)", + expect: "123.4(56)" +}, { + set: "-123.4(56)", + expect: "-123.4(56)" +}, { + set: "123.(4)", + expect: "123.(4)" +}, { + set: "-123.(4)", + expect: "-123.(4)" +}, { + set: "0/0", + expectError: DivisionByZero() +}, { + set: "9/0", + expectError: DivisionByZero() +}, { + label: "0/1+0/1", + set: "0/1", + param: "0/1", + expect: "0" +}, { + label: "1/9+0/1", + set: "1/9", + param: "0/1", + expect: "0.(1)" +}, { + set: "123/456", + expect: "0.269(736842105263157894)" +}, { + set: "-123/456", + expect: "-0.269(736842105263157894)" +}, { + set: "19 123/456", + expect: "19.269(736842105263157894)" +}, { + set: "-19 123/456", + expect: "-19.269(736842105263157894)" +}, { + set: "123.(22)123", + expectError: InvalidParameter() +}, { + set: "+33.3(3)", + expect: "33.(3)" +}, { + set: "3.'09009'", + expect: "3.(09009)" +}, { + set: "123.(((", + expectError: InvalidParameter() +}, { + set: "123.((", + expectError: InvalidParameter() +}, { + set: "123.()", + expectError: InvalidParameter() +}, { + set: null, + expect: "0" // I would say it's just fine +}, { + set: [22, 7], + expect: '3.(142857)' // We got Pi! - almost ;o +}, { + set: "355/113", + expect: "3.(1415929203539823008849557522123893805309734513274336283185840707964601769911504424778761061946902654867256637168)" // Yay, a better PI +}, { + set: "3 1/7", + expect: '3.(142857)' +}, { + set: [36, -36], + expect: "-1" +}, { + set: [1n, 3n], + expect: "0.(3)" +}, { + set: 1n, + set2: 3n, + expect: "0.(3)" +}, { + set: { n: 1n, d: 3n }, + expect: "0.(3)" +}, { + set: { n: 1n, d: 3n }, + expect: "0.(3)" +}, { + set: [1n, 3n], + expect: "0.(3)" +}, { + set: "9/12", + expect: "0.75" +}, { + set: "0.09(33)", + expect: "0.09(3)" +}, { + set: 1 / 2, + expect: "0.5" +}, { + set: 1 / 3, + expect: "0.(3)" +}, { + set: "0.'3'", + expect: "0.(3)" +}, { + set: "0.00002", + expect: "0.00002" +}, { + set: 7 / 8, + expect: "0.875" +}, { + set: 0.003, + expect: "0.003" +}, { + set: 4, + expect: "4" +}, { + set: -99, + expect: "-99" +}, { + set: "-92332.1192", + expect: "-92332.1192" +}, { + set: '88.92933(12111)', + expect: "88.92933(12111)" +}, { + set: '-192322.823(123)', + expect: "-192322.8(231)" +}, { + label: "-99.12 % 0.09(34)", + set: '-99.12', + fn: "mod", + param: "0.09(34)", + expect: "-0.07(95)" +}, { + label: "0.4 / 0.1", + set: .4, + fn: "div", + param: ".1", + expect: "4" +}, { + label: "1 / -.1", + set: 1, + fn: "div", + param: "-.1", + expect: "-10" +}, { + label: "1 - (-1)", + set: 1, + fn: "sub", + param: "-1", + expect: "2" +}, { + label: "1 + (-1)", + set: 1, + fn: "add", + param: "-1", + expect: "0" +}, { + label: "-187 % 12", + set: '-187', + fn: "mod", + param: "12", + expect: "-7" +}, { + label: "Negate by 99 * -1", + set: '99', + fn: "mul", + param: "-1", + expect: "-99" +}, { + label: "0.5050000000000000000000000", + set: "0.5050000000000000000000000", + expect: "101/200", + fn: "toFraction", + param: true +}, { + label: "0.505000000(0000000000)", + set: "0.505000000(0000000000)", + expect: "101/200", + fn: "toFraction", + param: true +}, { + set: [20, -5], + expect: "-4", + fn: "toFraction", + param: true +}, { + set: [-10, -7], + expect: "1 3/7", + fn: "toFraction", + param: true +}, { + set: [21, -6], + expect: "-3 1/2", + fn: "toFraction", + param: true +}, { + set: "10/78", + expect: "5/39", + fn: "toFraction", + param: true +}, { + set: "0/91", + expect: "0", + fn: "toFraction", + param: true +}, { + set: "-0/287", + expect: "0", + fn: "toFraction", + param: true +}, { + set: "-5/20", + expect: "-1/4", + fn: "toFraction", + param: true +}, { + set: "42/9", + expect: "4 2/3", + fn: "toFraction", + param: true +}, { + set: "71/23", + expect: "3 2/23", + fn: "toFraction", + param: true +}, { + set: "6/3", + expect: "2", + fn: "toFraction", + param: true +}, { + set: "28/4", + expect: "7", + fn: "toFraction", + param: true +}, { + set: "105/35", + expect: "3", + fn: "toFraction", + param: true +}, { + set: "4/6", + expect: "2/3", + fn: "toFraction", + param: true +}, { + label: "99.(9) + 66", + set: '99.(999999)', + fn: "add", + param: "66", + expect: "166" +}, { + label: "123.32 / 33.'9821'", + set: '123.32', + fn: "div", + param: "33.'9821'", + expect: "3.628958880242975" +}, { + label: "-82.124 / 66.(3)", + set: '-82.124', + fn: "div", + param: "66.(3)", + expect: "-1.238(050251256281407035175879396984924623115577889447236180904522613065326633165829145728643216080402010)" +}, { + label: "100 - .91", + set: '100', + fn: "sub", + param: ".91", + expect: "99.09" +}, { + label: "381.(33411) % 11.119(356)", + set: '381.(33411)', + fn: "mod", + param: "11.119(356)", + expect: "3.275(997225017295217)" +}, { + label: "13/26 mod 1", + set: '13/26', + fn: "mod", + param: "1.000", + expect: "0.5" +}, { + label: "381.(33411) % 1", // Extract fraction part of a number + set: '381.(33411)', + fn: "mod", + param: "1", + expect: "0.(33411)" +}, { + label: "-222/3", + set: { + n: 3, + d: 222, + s: -1 + }, + fn: "inverse", + param: null, + expect: "-74" +}, { + label: "inverse", + set: 1 / 2, + fn: "inverse", + param: null, + expect: "2" +}, { + label: "abs(-222/3)", + set: { + n: -222, + d: 3 + }, + fn: "abs", + param: null, + expect: "74" +}, { + label: "9 % -2", + set: 9, + fn: "mod", + param: "-2", + expect: "1" +}, { + label: "-9 % 2", + set: '-9', + fn: "mod", + param: "-2", + expect: "-1" +}, { + label: "1 / 195312500", + set: '1', + fn: "div", + param: "195312500", + expect: "0.00000000512" +}, { + label: "10 / 0", + set: 10, + fn: "div", + param: 0, + expectError: DivisionByZero() +}, { + label: "-3 / 4", + set: [-3, 4], + fn: "inverse", + param: null, + expect: "-1.(3)" +}, { + label: "-19.6", + set: [-98, 5], + fn: "equals", + param: '-19.6', + expect: "true" // actually, we get a real bool but we call toString() in the test below +}, { + label: "-19.6", + set: [98, -5], + fn: "equals", + param: '-19.6', + expect: "true" +}, { + label: "99/88", + set: [99, 88], + fn: "equals", + param: [88, 99], + expect: "false" +}, { + label: "99/88", + set: [99, -88], + fn: "equals", + param: [9, 8], + expect: "false" +}, { + label: "12.5", + set: 12.5, + fn: "add", + param: 0, + expect: "12.5" +}, { + label: "0/1 -> 1/0", + set: 0, + fn: "inverse", + param: null, + expectError: DivisionByZero() +}, { + label: "abs(-100.25)", + set: -100.25, + fn: "abs", + param: null, + expect: "100.25" +}, { + label: "0.022222222", + set: '0.0(22222222)', + fn: "abs", + param: null, + expect: "0.0(2)" +}, { + label: "1.5 | 100.5", + set: 100.5, + fn: "divisible", + param: '1.5', + expect: "true" +}, { + label: "1.5 | 100.6", + set: 100.6, + fn: "divisible", + param: 1.6, + expect: "false" +}, { + label: "(1/6) | (2/3)", // == 4 + set: [2, 3], + fn: "divisible", + param: [1, 6], + expect: "true" +}, { + label: "(1/6) | (2/5)", + set: [2, 5], + fn: "divisible", + param: [1, 6], + expect: "false" +}, { + label: "0 | (2/5)", + set: [2, 5], + fn: "divisible", + param: 0, + expect: "false" +}, { + label: "6 | 0", + set: 0, + fn: "divisible", + param: 6, + expect: "true" +}, { + label: "fmod(4.55, 0.05)", // http://phpjs.org/functions/fmod/ (comment section) + set: 4.55, + fn: "mod", + param: 0.05, + expect: "0" +}, { + label: "fmod(99.12, 0.4)", + set: 99.12, + fn: "mod", + param: "0.4", + expect: "0.32" +}, { + label: "fmod(fmod(1.0,0.1))", // http://stackoverflow.com/questions/4218961/why-fmod1-0-0-1-1 + set: 1.0, + fn: "mod", + param: 0.1, + expect: "0" +}, { + label: "bignum", + set: [5385020324, 1673196525], + fn: "add", + param: 0, + expect: "3.21(840276592733181776121606516006839065124164060763872313206005492988936251824931324190982287630557922656455433410609073551596098372245902196097377144624418820138297860736950789447760776337973807350574075570710380240599651018280712721418065340531352107607323652551812465663589637206543923464101146157950573080469432602963360804254598843372567965379918536467197121390148715495330113717514444395585868193217769203770011415724163065662594535928766646225254382476081224230369471990147720394052336440275597631903998844367669243157195775313960803259497565595290726533154854597848271290188102679689703515252041298615534717298077104242133182771222884293284077911887845930112722413166618308629346454087334421161315763550250022184333666363549254920906556389124702491239037207539024741878423396797336762338781453063321417070239253574830368476888869943116813489676593728283053898883754853602746993512910863832926021645903191198654921901657666901979730085800889408373591978384009612977172541043856160291750546158945674358246709841810124486123947693472528578195558946669459524487119048971249805817042322628538808374587079661786890216019304725725509141850506771761314768448972244907094819599867385572056456428511886850828834945135927771544947477105237234460548500123140047759781236696030073335228807028510891749551057667897081007863078128255137273847732859712937785356684266362554153643129279150277938809369688357439064129062782986595074359241811119587401724970711375341877428295519559485099934689381452068220139292962014728066686607540019843156200674036183526020650801913421377683054893985032630879985)" +}, { + label: "ceil(0.4)", + set: 0.4, + fn: "ceil", + param: null, + expect: "1" +}, + + +{ + label: "1 < 2", + set: 1, + fn: "lt", + param: 2, + expect: "true" +}, { + label: "2 < 2", + set: 2, + fn: "lt", + param: 2, + expect: "false" +}, { + label: "3 > 2", + set: 3, + fn: "gt", + param: 2, + expect: "true" +}, { + label: "2 > 2", + set: 2, + fn: "gt", + param: 2, + expect: "false" +}, { + label: "1 <= 2", + set: 1, + fn: "lte", + param: 2, + expect: "true" +}, { + label: "2 <= 2", + set: 2, + fn: "lte", + param: 2, + expect: "true" +}, { + label: "3 <= 2", + set: 3, + fn: "lte", + param: 2, + expect: "false" +}, { + label: "3 >= 2", + set: 3, + fn: "gte", + param: 2, + expect: "true" +}, { + label: "2 >= 2", + set: 2, + fn: "gte", + param: 2, + expect: "true" +}, { + label: "ceil(0.5)", + set: 0.5, + fn: "ceil", + param: null, + expect: "1" +}, { + label: "ceil(0.23, 2)", + set: 0.23, + fn: "ceil", + param: 2, + expect: "0.23" +}, { + label: "ceil(0.6)", + set: 0.6, + fn: "ceil", + param: null, + expect: "1" +}, { + label: "ceil(-0.4)", + set: -0.4, + fn: "ceil", + param: null, + expect: "0" +}, { + label: "ceil(-0.5)", + set: -0.5, + fn: "ceil", + param: null, + expect: "0" +}, { + label: "ceil(-0.6)", + set: -0.6, + fn: "ceil", + param: null, + expect: "0" +}, { + label: "floor(0.4)", + set: 0.4, + fn: "floor", + param: null, + expect: "0" +}, { + label: "floor(0.4, 1)", + set: 0.4, + fn: "floor", + param: 1, + expect: "0.4" +}, { + label: "floor(0.5)", + set: 0.5, + fn: "floor", + param: null, + expect: "0" +}, { + label: "floor(0.6)", + set: 0.6, + fn: "floor", + param: null, + expect: "0" +}, { + label: "floor(-0.4)", + set: -0.4, + fn: "floor", + param: null, + expect: "-1" +}, { + label: "floor(-0.5)", + set: -0.5, + fn: "floor", + param: null, + expect: "-1" +}, { + label: "floor(-0.6)", + set: -0.6, + fn: "floor", + param: null, + expect: "-1" +}, { + label: "floor(10.4)", + set: 10.4, + fn: "floor", + param: null, + expect: "10" +}, { + label: "floor(10.4, 1)", + set: 10.4, + fn: "floor", + param: 1, + expect: "10.4" +}, { + label: "floor(10.5)", + set: 10.5, + fn: "floor", + param: null, + expect: "10" +}, { + label: "floor(10.6)", + set: 10.6, + fn: "floor", + param: null, + expect: "10" +}, { + label: "floor(-10.4)", + set: -10.4, + fn: "floor", + param: null, + expect: "-11" +}, { + label: "floor(-10.5)", + set: -10.5, + fn: "floor", + param: null, + expect: "-11" +}, { + label: "floor(-10.6)", + set: -10.6, + fn: "floor", + param: null, + expect: "-11" +}, { + label: "floor(-10.543,3)", + set: -10.543, + fn: "floor", + param: 3, + expect: "-10.543" +}, { + label: "floor(10.543,3)", + set: 10.543, + fn: "floor", + param: 3, + expect: "10.543" +}, { + label: "round(-10.543,3)", + set: -10.543, + fn: "round", + param: 3, + expect: "-10.543" +}, { + label: "round(10.543,3)", + set: 10.543, + fn: "round", + param: 3, + expect: "10.543" +}, { + label: "round(10.4)", + set: 10.4, + fn: "round", + param: null, + expect: "10" +}, { + label: "round(10.5)", + set: 10.5, + fn: "round", + param: null, + expect: "11" +}, { + label: "round(10.5, 1)", + set: 10.5, + fn: "round", + param: 1, + expect: "10.5" +}, { + label: "round(10.6)", + set: 10.6, + fn: "round", + param: null, + expect: "11" +}, { + label: "round(-10.4)", + set: -10.4, + fn: "round", + param: null, + expect: "-10" +}, { + label: "round(-10.5)", + set: -10.5, + fn: "round", + param: null, + expect: "-10" +}, { + label: "round(-10.6)", + set: -10.6, + fn: "round", + param: null, + expect: "-11" +}, { + label: "round(-0.4)", + set: -0.4, + fn: "round", + param: null, + expect: "0" +}, { + label: "round(-0.5)", + set: -0.5, + fn: "round", + param: null, + expect: "0" +}, { + label: "round(-0.6)", + set: -0.6, + fn: "round", + param: null, + expect: "-1" +}, { + label: "round(-0)", + set: -0, + fn: "round", + param: null, + expect: "0" +}, { + label: "round(big fraction)", + set: [ + '409652136432929109317120'.repeat(100), + '63723676445298091081155'.repeat(100) + ], + fn: "round", + param: null, + expect: "6428570341270001560623330590225448467479093479780591305451264291405695842465355472558570608574213642" +}, { + label: "round(big numerator)", + set: ['409652136432929109317'.repeat(100), 10], + fn: "round", + param: null, + expect: '409652136432929109317'.repeat(99) + '40965213643292910932' +}, { + label: "17402216385200408/5539306332998545", + set: [17402216385200408, 5539306332998545], + fn: "add", + param: 0, + expect: "3.141587653589870" +}, { + label: "17402216385200401/553930633299855", + set: [17402216385200401, 553930633299855], + fn: "add", + param: 0, + expect: "31.415876535898660" +}, { + label: "1283191/418183", + set: [1283191, 418183], + fn: "add", + param: 0, + expect: "3.068491545567371" +}, { + label: "1.001", + set: "1.001", + fn: "add", + param: 0, + expect: "1.001" +}, { + label: "99+1", + set: [99, 1], + fn: "add", + param: 1, + expect: "100" +}, { + label: "gcd(5/8, 3/7)", + set: [5, 8], + fn: "gcd", + param: [3, 7], + expect: "0.017(857142)" // == 1/56 +}, { + label: "gcd(52, 39)", + set: 52, + fn: "gcd", + param: 39, + expect: "13" +}, { + label: "gcd(51357, 3819)", + set: 51357, + fn: "gcd", + param: 3819, + expect: "57" +}, { + label: "gcd(841, 299)", + set: 841, + fn: "gcd", + param: 299, + expect: "1" +}, { + label: "gcd(2/3, 7/5)", + set: [2, 3], + fn: "gcd", + param: [7, 5], + expect: "0.0(6)" // == 1/15 +}, { + label: "lcm(-3, 3)", + set: -3, + fn: "lcm", + param: 3, + expect: "3" +}, { + label: "lcm(3,-3)", + set: 3, + fn: "lcm", + param: -3, + expect: "3" +}, { + label: "lcm(0,3)", + set: 0, + fn: "lcm", + param: 3, + expect: "0" +}, { + label: "lcm(3, 0)", + set: 3, + fn: "lcm", + param: 0, + expect: "0" +}, { + label: "lcm(0, 0)", + set: 0, + fn: "lcm", + param: 0, + expect: "0" +}, { + label: "lcm(200, 333)", + set: 200, + fn: "lcm", + param: 333, expect: "66600" +}, +{ + label: "1 + -1", + set: 1, + fn: "add", + param: -1, + expect: "0" +}, { + label: "3/10+3/14", + set: "3/10", + fn: "add", + param: "3/14", + expect: "0.5(142857)" +}, { + label: "3/10-3/14", + set: "3/10", + fn: "sub", + param: "3/14", + expect: "0.0(857142)" +}, { + label: "3/10*3/14", + set: "3/10", + fn: "mul", + param: "3/14", + expect: "0.06(428571)" +}, { + label: "3/10 / 3/14", + set: "3/10", + fn: "div", + param: "3/14", + expect: "1.4" +}, { + label: "1-2", + set: "1", + fn: "sub", + param: "2", + expect: "-1" +}, { + label: "1--1", + set: "1", + fn: "sub", + param: "-1", + expect: "2" +}, { + label: "0/1*1/3", + set: "0/1", + fn: "mul", + param: "1/3", + expect: "0" +}, { + label: "3/10 * 8/12", + set: "3/10", + fn: "mul", + param: "8/12", + expect: "0.2" +}, { + label: ".5+5", + set: ".5", + fn: "add", + param: 5, expect: "5.5" +}, +{ + label: "10/12-5/60", + set: "10/12", + fn: "sub", + param: "5/60", + expect: "0.75" +}, { + label: "10/15 / 3/4", + set: "10/15", + fn: "div", + param: "3/4", + expect: "0.(8)" +}, { + label: "1/4 + 3/8", + set: "1/4", + fn: "add", + param: "3/8", + expect: "0.625" +}, { + label: "2-1/3", + set: "2", + fn: "sub", + param: "1/3", + expect: "1.(6)" +}, { + label: "5*6", + set: "5", + fn: "mul", + param: 6, + expect: "30" +}, { + label: "1/2-1/5", + set: "1/2", + fn: "sub", + param: "1/5", + expect: "0.3" +}, { + label: "1/2-5", + set: "1/2", + fn: "add", + param: -5, + expect: "-4.5" +}, { + label: "1*-1", + set: "1", + fn: "mul", + param: -1, + expect: "-1" +}, { + label: "5/10", + set: 5.0, + fn: "div", + param: 10, + expect: "0.5" +}, { + label: "1/-1", + set: "1", + fn: "div", + param: -1, + expect: "-1" +}, { + label: "4/5 + 13/2", + set: "4/5", + fn: "add", + param: "13/2", + expect: "7.3" +}, { + label: "4/5 + 61/2", + set: "4/5", + fn: "add", + param: "61/2", + expect: "31.3" +}, { + label: "0.8 + 6.5", + set: "0.8", + fn: "add", + param: "6.5", + expect: "7.3" +}, { + label: "2/7 inverse", + set: "2/7", + fn: "inverse", + param: null, + expect: "3.5" +}, { + label: "neg 1/3", + set: "1/3", + fn: "neg", + param: null, + expect: "-0.(3)" +}, { + label: "1/2+1/3", + set: "1/2", + fn: "add", + param: "1/3", + expect: "0.8(3)" +}, { + label: "1/2+3", + set: ".5", + fn: "add", + param: 3, + expect: "3.5" +}, { + label: "1/2+3.14", + set: "1/2", + fn: "add", + param: "3.14", + expect: "3.64" +}, { + label: "3.5 < 4.1", + set: 3.5, + fn: "compare", + param: 4.1, + expect: "-1" +}, { + label: "3.5 > 4.1", + set: 4.1, + fn: "compare", + param: 3.1, + expect: "1" +}, { + label: "-3.5 > -4.1", + set: -3.5, + fn: "compare", + param: -4.1, + expect: "1" +}, { + label: "-3.5 > -4.1", + set: -4.1, + fn: "compare", + param: -3.5, + expect: "-1" +}, { + label: "4.3 == 4.3", + set: 4.3, + fn: "compare", + param: 4.3, + expect: "0" +}, { + label: "-4.3 == -4.3", + set: -4.3, + fn: "compare", + param: -4.3, + expect: "0" +}, { + label: "-4.3 < 4.3", + set: -4.3, + fn: "compare", + param: 4.3, + expect: "-1" +}, { + label: "4.3 == -4.3", + set: 4.3, + fn: "compare", + param: -4.3, + expect: "1" +}, { + label: "2^0.5", + set: 2, + fn: "pow", + param: 0.5, + expect: "null" +}, { + label: "(-8/27)^(1/3)", + set: [-8, 27], + fn: "pow", + param: [1, 3], + expect: "null" +}, { + label: "(-8/27)^(2/3)", + set: [-8, 27], + fn: "pow", + param: [2, 3], + expect: "null" +}, { + label: "(-32/243)^(5/3)", + set: [-32, 243], + fn: "pow", + param: [5, 3], + expect: "null" +}, { + label: "sqrt(0)", + set: 0, + fn: "pow", + param: 0.5, + expect: "0" +}, { + label: "27^(2/3)", + set: 27, + fn: "pow", + param: "2/3", + expect: "9" +}, { + label: "(243/1024)^(2/5)", + set: "243/1024", + fn: "pow", + param: "2/5", + expect: "0.5625" +}, { + label: "-0.5^-3", + set: -0.5, + fn: "pow", + param: -3, + expect: "-8" +}, { + label: "", + set: -3, + fn: "pow", + param: -3, + expect: "-0.(037)" +}, { + label: "-3", + set: -3, + fn: "pow", + param: 2, + expect: "9" +}, { + label: "-3", + set: -3, + fn: "pow", + param: 3, + expect: "-27" +}, { + label: "0^0", + set: 0, + fn: "pow", + param: 0, + expect: "1" +}, { + label: "2/3^7", + set: [2, 3], + fn: "pow", + param: 7, + expect: "0.(058527663465935070873342478280749885688157293095564700502972107910379515317786922725194330132601737540009144947416552354823959762231367169638774577046181984453589391860996799268404206675811614083219021490626428898033836305441243712848651120256)" +}, { + label: "-0.6^4", + set: -0.6, + fn: "pow", + param: 4, + expect: "0.1296" +}, { + label: "8128371:12394 - 8128371/12394", + set: "8128371:12394", + fn: "sub", + param: "8128371/12394", + expect: "0" +}, { + label: "3/4 + 1/4", + set: "3/4", + fn: "add", + param: "1/4", + expect: "1" +}, { + label: "1/10 + 2/10", + set: "1/10", + fn: "add", + param: "2/10", + expect: "0.3" +}, { + label: "5/10 + 2/10", + set: "5/10", + fn: "add", + param: "2/10", + expect: "0.7" +}, { + label: "18/10 + 2/10", + set: "18/10", + fn: "add", + param: "2/10", + expect: "2" +}, { + label: "1/3 + 1/6", + set: "1/3", + fn: "add", + param: "1/6", + expect: "0.5" +}, { + label: "1/3 + 2/6", + set: "1/3", + fn: "add", + param: "2/6", + expect: "0.(6)" +}, { + label: "3/4 / 1/4", + set: "3/4", + fn: "div", + param: "1/4", + expect: "3" +}, { + label: "1/10 / 2/10", + set: "1/10", + fn: "div", + param: "2/10", + expect: "0.5" +}, { + label: "5/10 / 2/10", + set: "5/10", + fn: "div", + param: "2/10", + expect: "2.5" +}, { + label: "18/10 / 2/10", + set: "18/10", + fn: "div", + param: "2/10", + expect: "9" +}, { + label: "1/3 / 1/6", + set: "1/3", + fn: "div", + param: "1/6", + expect: "2" +}, { + label: "1/3 / 2/6", + set: "1/3", + fn: "div", + param: "2/6", + expect: "1" +}, { + label: "3/4 * 1/4", + set: "3/4", + fn: "mul", + param: "1/4", + expect: "0.1875" +}, { + label: "1/10 * 2/10", + set: "1/10", + fn: "mul", + param: "2/10", + expect: "0.02" +}, { + label: "5/10 * 2/10", + set: "5/10", + fn: "mul", + param: "2/10", + expect: "0.1" +}, { + label: "18/10 * 2/10", + set: "18/10", + fn: "mul", + param: "2/10", + expect: "0.36" +}, { + label: "1/3 * 1/6", + set: "1/3", + fn: "mul", + param: "1/6", + expect: "0.0(5)" +}, { + label: "1/3 * 2/6", + set: "1/3", + fn: "mul", + param: "2/6", + expect: "0.(1)" +}, { + label: "5/4 - 1/4", + set: "5/4", + fn: "sub", + param: "1/4", + expect: "1" +}, { + label: "5/10 - 2/10", + set: "5/10", + fn: "sub", + param: "2/10", + expect: "0.3" +}, { + label: "9/10 - 2/10", + set: "9/10", + fn: "sub", + param: "2/10", + expect: "0.7" +}, { + label: "22/10 - 2/10", + set: "22/10", + fn: "sub", + param: "2/10", + expect: "2" +}, { + label: "2/3 - 1/6", + set: "2/3", + fn: "sub", + param: "1/6", + expect: "0.5" +}, { + label: "3/3 - 2/6", + set: "3/3", + fn: "sub", + param: "2/6", + expect: "0.(6)" +}, { + label: "0.006999999999999999", + set: 0.006999999999999999, + fn: "add", + param: 0, + expect: "0.007" +}, { + label: "1/7 - 1", + set: 1 / 7, + fn: "add", + param: -1, + expect: "-0.(857142)" +}, { + label: "0.0065 + 0.0005", + set: 0.0065, + fn: "add", + param: 0.0005, + expect: "0.007" +}, { + label: "6.5/.5", + set: 6.5, + fn: "div", + param: .5, + expect: "13" +}, { + label: "0.999999999999999999999999999", + set: 0.999999999999999999999999999, + fn: "sub", + param: 1, + expect: "0" +}, { + label: "0.5833333333333334", + set: 0.5833333333333334, + fn: "add", + param: 0, + expect: "0.58(3)" +}, { + label: "1.75/3", + set: 1.75 / 3, + fn: "add", + param: 0, + expect: "0.58(3)" +}, { + label: "3.3333333333333", + set: 3.3333333333333, + fn: "add", + param: 0, + expect: "3.(3)" +}, { + label: "4.285714285714285714285714", + set: 4.285714285714285714285714, + fn: "add", + param: 0, + expect: "4.(285714)" +}, { + label: "-4", + set: -4, + fn: "neg", + param: 0, + expect: "4" +}, { + label: "4", + set: 4, + fn: "neg", + param: 0, + expect: "-4" +}, { + label: "0", + set: 0, + fn: "neg", + param: 0, + expect: "0" +}, { + label: "6869570742453802/5329686054127205", + set: "6869570742453802/5329686054127205", + fn: "neg", + param: 0, + expect: "-1.288925965373540" +}, { + label: "686970702/53212205", + set: "686970702/53212205", + fn: "neg", + param: 0, + expect: "-12.910021338149772" +}, { + label: "1/3000000000000000", + set: "1/3000000000000000", + fn: "add", + param: 0, + expect: "0.000000000000000(3)" +}, { + label: "toString(15) .0000000000000003", + set: ".0000000000000003", + fn: "toString", + param: 15, + expect: "0.000000000000000" +}, { + label: "toString(16) .0000000000000003", + set: ".0000000000000003", + fn: "toString", + param: 16, + expect: "0.0000000000000003" +}, { + label: "12 / 4.3", + set: 12, + set2: 4.3, + fn: "toString", + param: null, + expectError: NonIntegerParameter() +}, { + label: "12.5 / 4", + set: 12.5, + set2: 4, + fn: "toString", + param: null, + expectError: NonIntegerParameter() +}, { + label: "0.9 round to multiple of 1/8", + set: .9, + fn: "roundTo", + param: "1/8", + expect: "0.875" +}, { + label: "1/3 round to multiple of 1/16", + set: 1 / 3, + fn: "roundTo", + param: "1/16", + expect: "0.3125" +}, { + label: "1/3 round to multiple of 1/16", + set: -1 / 3, + fn: "roundTo", + param: "1/16", + expect: "-0.3125" +}, { + label: "1/2 round to multiple of 1/4", + set: 1 / 2, + fn: "roundTo", + param: "1/4", + expect: "0.5" +}, { + label: "1/4 round to multiple of 1/2", + set: 1 / 4, + fn: "roundTo", + param: "1/2", + expect: "0.5" +}, { + label: "10/3 round to multiple of 1/2", + set: "10/3", + fn: "roundTo", + param: "1/2", + expect: "3.5" +}, { + label: "-10/3 round to multiple of 1/2", + set: "-10/3", + fn: "roundTo", + param: "1/2", + expect: "-3.5" +}, { + label: "log_2(8)", + set: "8", + fn: "log", + param: "2", + expect: "3" // because 2^3 = 8 +}, { + label: "log_2(3)", + set: "3", + fn: "log", + param: "2", + expect: 'null' // because 2^(p/q) != 3 +}, { + label: "log_10(1000)", + set: "1000", + fn: "log", + param: "10", + expect: "3" // because 10^3 = 1000 +}, { + label: "log_27(81)", + set: "81", + fn: "log", + param: "27", + expect: "1.(3)" // because 27^(4/3) = 81 +}, { + label: "log_27(9)", + set: "9", + fn: "log", + param: "27", + expect: "0.(6)" // because 27^(2/3) = 9 +}, { + label: "log_9/4(27/8)", + set: "27/8", + fn: "log", + param: "9/4", + expect: "1.5" // because (9/4)^(3/2) = 27/8 +}]; + +describe('Fraction', function () { + for (var i = 0; i < tests.length; i++) { + + (function (i) { + var action; + + if (tests[i].fn) { + action = function () { + var x = Fraction(tests[i].set, tests[i].set2)[tests[i].fn](tests[i].param); + if (x === null) return "null"; + return x.toString(); + }; + } else { + action = function () { + var x = new Fraction(tests[i].set, tests[i].set2); + if (x === null) return "null"; + return x.toString(); + }; + } + + it(String(tests[i].label || tests[i].set), function () { + if (tests[i].expectError) { + assert.throws(action, tests[i].expectError); + } else { + assert.equal(action(), tests[i].expect); + } + }); + + })(i); + } +}); + +describe('JSON', function () { + + it("Should be possible to stringify the object", function () { + + if (typeof Fraction(1).n !== 'number') { + return; + } + assert.equal('{"s":1,"n":14623,"d":330}', JSON.stringify(new Fraction("44.3(12)"))); + assert.equal('{"s":-1,"n":2,"d":1}', JSON.stringify(new Fraction(-1 / 2).inverse())); + }); +}); + +describe('Arguments', function () { + + it("Should be possible to use different kind of params", function () { + + // String + var fraction = new Fraction("0.1"); + assert.equal("1/10", fraction.n + "/" + fraction.d); + + var fraction = new Fraction("6234/6460"); + assert.equal("3117/3230", fraction.n + "/" + fraction.d); + + // Two params + var fraction = new Fraction(1, 2); + assert.equal("1/2", fraction.n + "/" + fraction.d); + + // Object + var fraction = new Fraction({ n: 1, d: 3 }); + assert.equal("1/3", fraction.n + "/" + fraction.d); + + // Array + var fraction = new Fraction([1, 4]); + assert.equal("1/4", fraction.n + "/" + fraction.d); + }); +}); + +describe('fractions', function () { + + it("Should pass 0.08 = 2/25", function () { + + var fraction = new Fraction("0.08"); + assert.equal("2/25", fraction.n + "/" + fraction.d); + }); + + it("Should pass 0.200 = 1/5", function () { + + var fraction = new Fraction("0.200"); + assert.equal("1/5", fraction.n + "/" + fraction.d); + }); + + it("Should pass 0.125 = 1/8", function () { + + var fraction = new Fraction("0.125"); + assert.equal("1/8", fraction.n + "/" + fraction.d); + }); + + it("Should pass 8.36 = 209/25", function () { + + var fraction = new Fraction(8.36); + assert.equal("209/25", fraction.n + "/" + fraction.d); + }); + +}); + +describe('constructors', function () { + + it("Should pass 0.08 = 2/25", function () { + + var tmp = new Fraction({ d: 4, n: 2, s: -1 }); + assert.equal("-1/2", tmp.s * tmp.n + "/" + tmp.d); + + var tmp = new Fraction(-88.3); + assert.equal("-883/10", tmp.s * tmp.n + "/" + tmp.d); + + var tmp = new Fraction(-88.3).clone(); + assert.equal("-883/10", tmp.s * tmp.n + "/" + tmp.d); + + var tmp = new Fraction("123.'3'"); + assert.equal("370/3", tmp.s * tmp.n + "/" + tmp.d); + + var tmp = new Fraction("123.'3'").clone(); + assert.equal("370/3", tmp.s * tmp.n + "/" + tmp.d); + + var tmp = new Fraction([-1023461776, 334639305]); + tmp = tmp.add([4, 25]); + assert.equal("-4849597436/1673196525", tmp.s * tmp.n + "/" + tmp.d); + }); +}); + +describe('Latex Output', function () { + + it("Should pass 123.'3' = \\frac{370}{3}", function () { + + var tmp = new Fraction("123.'3'"); + assert.equal("\\frac{370}{3}", tmp.toLatex()); + }); + + it("Should pass 1.'3' = \\frac{4}{3}", function () { + + var tmp = new Fraction("1.'3'"); + assert.equal("\\frac{4}{3}", tmp.toLatex()); + }); + + it("Should pass -1.0000000000 = -1", function () { + + var tmp = new Fraction("-1.0000000000"); + assert.equal('-1', tmp.toLatex()); + }); + + it("Should pass -0.0000000000 = 0", function () { + + var tmp = new Fraction("-0.0000000000"); + assert.equal('0', tmp.toLatex()); + }); +}); + +describe('Fraction Output', function () { + + it("Should pass 123.'3' = 123 1/3", function () { + + var tmp = new Fraction("123.'3'"); + assert.equal('370/3', tmp.toFraction()); + }); + + it("Should pass 1.'3' = 1 1/3", function () { + + var tmp = new Fraction("1.'3'"); + assert.equal('4/3', tmp.toFraction()); + }); + + it("Should pass -1.0000000000 = -1", function () { + + var tmp = new Fraction("-1.0000000000"); + assert.equal('-1', tmp.toFraction()); + }); + + it("Should pass -0.0000000000 = 0", function () { + + var tmp = new Fraction("-0.0000000000"); + assert.equal('0', tmp.toFraction()); + }); + + it("Should pass 1/-99/293 = -1/29007", function () { + + var tmp = new Fraction(-99).inverse().div(293); + assert.equal('-1/29007', tmp.toFraction()); + }); + + it('Should work with large calculations', function () { + var x = Fraction(1123875); + var y = Fraction(1238750184); + var z = Fraction(1657134); + var r = Fraction(77344464613500, 92063); + assert.equal(x.mul(y).div(z).toFraction(), r.toFraction()); + }); +}); + +describe('Fraction toContinued', function () { + + it("Should pass 415/93", function () { + + var tmp = new Fraction(415, 93); + assert.equal('4,2,6,7', tmp.toContinued().toString()); + }); + + it("Should pass 0/2", function () { + + var tmp = new Fraction(0, 2); + assert.equal('0', tmp.toContinued().toString()); + }); + + it("Should pass 1/7", function () { + + var tmp = new Fraction(1, 7); + assert.equal('0,7', tmp.toContinued().toString()); + }); + + it("Should pass 23/88", function () { + + var tmp = new Fraction('23/88'); + assert.equal('0,3,1,4,1,3', tmp.toContinued().toString()); + }); + + it("Should pass 1/99", function () { + + var tmp = new Fraction('1/99'); + assert.equal('0,99', tmp.toContinued().toString()); + }); + + it("Should pass 1768/99", function () { + + var tmp = new Fraction('1768/99'); + assert.equal('17,1,6,14', tmp.toContinued().toString()); + }); + + it("Should pass 1768/99", function () { + + var tmp = new Fraction('7/8'); + assert.equal('0,1,7', tmp.toContinued().toString()); + }); + +}); + + +describe('Fraction simplify', function () { + + it("Should pass 415/93", function () { + + var tmp = new Fraction(415, 93); + assert.equal('9/2', tmp.simplify(0.1).toFraction()); + assert.equal('58/13', tmp.simplify(0.01).toFraction()); + assert.equal('415/93', tmp.simplify(0.0001).toFraction()); + }); + +}); diff --git a/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/.eslintrc.yml b/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/.eslintrc.yml new file mode 100644 index 00000000..3344da7e --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/.eslintrc.yml @@ -0,0 +1,6 @@ +parserOptions: + ecmaVersion: 6 +globals: + beforeEach: false + describe: false + it: false diff --git a/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/fixtures/schema.js b/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/fixtures/schema.js new file mode 100644 index 00000000..c51430cd --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/fixtures/schema.js @@ -0,0 +1,125 @@ +'use strict'; + +var schema = { + additionalItems: subschema('additionalItems'), + items: subschema('items'), + contains: subschema('contains'), + additionalProperties: subschema('additionalProperties'), + propertyNames: subschema('propertyNames'), + not: subschema('not'), + allOf: [ + subschema('allOf_0'), + subschema('allOf_1'), + { + items: [ + subschema('items_0'), + subschema('items_1'), + ] + } + ], + anyOf: [ + subschema('anyOf_0'), + subschema('anyOf_1'), + ], + oneOf: [ + subschema('oneOf_0'), + subschema('oneOf_1'), + ], + definitions: { + foo: subschema('definitions_foo'), + bar: subschema('definitions_bar'), + }, + properties: { + foo: subschema('properties_foo'), + bar: subschema('properties_bar'), + }, + patternProperties: { + foo: subschema('patternProperties_foo'), + bar: subschema('patternProperties_bar'), + }, + dependencies: { + foo: subschema('dependencies_foo'), + bar: subschema('dependencies_bar'), + }, + required: ['foo', 'bar'] +}; + + +function subschema(keyword) { + var sch = { + properties: {}, + additionalProperties: false, + additionalItems: false, + anyOf: [ + {format: 'email'}, + {format: 'hostname'} + ] + }; + sch.properties['foo_' + keyword] = {title: 'foo'}; + sch.properties['bar_' + keyword] = {title: 'bar'}; + return sch; +} + + +module.exports = { + schema: schema, + + // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex + expectedCalls: [[schema, '', schema, undefined, undefined, undefined, undefined]] + .concat(expectedCalls('additionalItems')) + .concat(expectedCalls('items')) + .concat(expectedCalls('contains')) + .concat(expectedCalls('additionalProperties')) + .concat(expectedCalls('propertyNames')) + .concat(expectedCalls('not')) + .concat(expectedCallsChild('allOf', 0)) + .concat(expectedCallsChild('allOf', 1)) + .concat([ + [schema.allOf[2], '/allOf/2', schema, '', 'allOf', schema, 2], + [schema.allOf[2].items[0], '/allOf/2/items/0', schema, '/allOf/2', 'items', schema.allOf[2], 0], + [schema.allOf[2].items[0].properties.foo_items_0, '/allOf/2/items/0/properties/foo_items_0', schema, '/allOf/2/items/0', 'properties', schema.allOf[2].items[0], 'foo_items_0'], + [schema.allOf[2].items[0].properties.bar_items_0, '/allOf/2/items/0/properties/bar_items_0', schema, '/allOf/2/items/0', 'properties', schema.allOf[2].items[0], 'bar_items_0'], + [schema.allOf[2].items[0].anyOf[0], '/allOf/2/items/0/anyOf/0', schema, '/allOf/2/items/0', 'anyOf', schema.allOf[2].items[0], 0], + [schema.allOf[2].items[0].anyOf[1], '/allOf/2/items/0/anyOf/1', schema, '/allOf/2/items/0', 'anyOf', schema.allOf[2].items[0], 1], + + [schema.allOf[2].items[1], '/allOf/2/items/1', schema, '/allOf/2', 'items', schema.allOf[2], 1], + [schema.allOf[2].items[1].properties.foo_items_1, '/allOf/2/items/1/properties/foo_items_1', schema, '/allOf/2/items/1', 'properties', schema.allOf[2].items[1], 'foo_items_1'], + [schema.allOf[2].items[1].properties.bar_items_1, '/allOf/2/items/1/properties/bar_items_1', schema, '/allOf/2/items/1', 'properties', schema.allOf[2].items[1], 'bar_items_1'], + [schema.allOf[2].items[1].anyOf[0], '/allOf/2/items/1/anyOf/0', schema, '/allOf/2/items/1', 'anyOf', schema.allOf[2].items[1], 0], + [schema.allOf[2].items[1].anyOf[1], '/allOf/2/items/1/anyOf/1', schema, '/allOf/2/items/1', 'anyOf', schema.allOf[2].items[1], 1] + ]) + .concat(expectedCallsChild('anyOf', 0)) + .concat(expectedCallsChild('anyOf', 1)) + .concat(expectedCallsChild('oneOf', 0)) + .concat(expectedCallsChild('oneOf', 1)) + .concat(expectedCallsChild('definitions', 'foo')) + .concat(expectedCallsChild('definitions', 'bar')) + .concat(expectedCallsChild('properties', 'foo')) + .concat(expectedCallsChild('properties', 'bar')) + .concat(expectedCallsChild('patternProperties', 'foo')) + .concat(expectedCallsChild('patternProperties', 'bar')) + .concat(expectedCallsChild('dependencies', 'foo')) + .concat(expectedCallsChild('dependencies', 'bar')) +}; + + +function expectedCalls(keyword) { + return [ + [schema[keyword], `/${keyword}`, schema, '', keyword, schema, undefined], + [schema[keyword].properties[`foo_${keyword}`], `/${keyword}/properties/foo_${keyword}`, schema, `/${keyword}`, 'properties', schema[keyword], `foo_${keyword}`], + [schema[keyword].properties[`bar_${keyword}`], `/${keyword}/properties/bar_${keyword}`, schema, `/${keyword}`, 'properties', schema[keyword], `bar_${keyword}`], + [schema[keyword].anyOf[0], `/${keyword}/anyOf/0`, schema, `/${keyword}`, 'anyOf', schema[keyword], 0], + [schema[keyword].anyOf[1], `/${keyword}/anyOf/1`, schema, `/${keyword}`, 'anyOf', schema[keyword], 1] + ]; +} + + +function expectedCallsChild(keyword, i) { + return [ + [schema[keyword][i], `/${keyword}/${i}`, schema, '', keyword, schema, i], + [schema[keyword][i].properties[`foo_${keyword}_${i}`], `/${keyword}/${i}/properties/foo_${keyword}_${i}`, schema, `/${keyword}/${i}`, 'properties', schema[keyword][i], `foo_${keyword}_${i}`], + [schema[keyword][i].properties[`bar_${keyword}_${i}`], `/${keyword}/${i}/properties/bar_${keyword}_${i}`, schema, `/${keyword}/${i}`, 'properties', schema[keyword][i], `bar_${keyword}_${i}`], + [schema[keyword][i].anyOf[0], `/${keyword}/${i}/anyOf/0`, schema, `/${keyword}/${i}`, 'anyOf', schema[keyword][i], 0], + [schema[keyword][i].anyOf[1], `/${keyword}/${i}/anyOf/1`, schema, `/${keyword}/${i}`, 'anyOf', schema[keyword][i], 1] + ]; +} diff --git a/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/index.spec.js b/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/index.spec.js new file mode 100644 index 00000000..c76b64fc --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/json-schema-traverse/spec/index.spec.js @@ -0,0 +1,171 @@ +'use strict'; + +var traverse = require('../index'); +var assert = require('assert'); + +describe('json-schema-traverse', function() { + var calls; + + beforeEach(function() { + calls = []; + }); + + it('should traverse all keywords containing schemas recursively', function() { + var schema = require('./fixtures/schema').schema; + var expectedCalls = require('./fixtures/schema').expectedCalls; + + traverse(schema, {cb: callback}); + assert.deepStrictEqual(calls, expectedCalls); + }); + + describe('Legacy v0.3.1 API', function() { + it('should traverse all keywords containing schemas recursively', function() { + var schema = require('./fixtures/schema').schema; + var expectedCalls = require('./fixtures/schema').expectedCalls; + + traverse(schema, callback); + assert.deepStrictEqual(calls, expectedCalls); + }); + + it('should work when an options object is provided', function() { + // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex + var schema = require('./fixtures/schema').schema; + var expectedCalls = require('./fixtures/schema').expectedCalls; + + traverse(schema, {}, callback); + assert.deepStrictEqual(calls, expectedCalls); + }); + }); + + + describe('allKeys option', function() { + var schema = { + someObject: { + minimum: 1, + maximum: 2 + } + }; + + it('should traverse objects with allKeys: true option', function() { + // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex + var expectedCalls = [ + [schema, '', schema, undefined, undefined, undefined, undefined], + [schema.someObject, '/someObject', schema, '', 'someObject', schema, undefined] + ]; + + traverse(schema, {allKeys: true, cb: callback}); + assert.deepStrictEqual(calls, expectedCalls); + }); + + + it('should NOT traverse objects with allKeys: false option', function() { + // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex + var expectedCalls = [ + [schema, '', schema, undefined, undefined, undefined, undefined] + ]; + + traverse(schema, {allKeys: false, cb: callback}); + assert.deepStrictEqual(calls, expectedCalls); + }); + + + it('should NOT traverse objects without allKeys option', function() { + // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex + var expectedCalls = [ + [schema, '', schema, undefined, undefined, undefined, undefined] + ]; + + traverse(schema, {cb: callback}); + assert.deepStrictEqual(calls, expectedCalls); + }); + + + it('should NOT travers objects in standard keywords which value is not a schema', function() { + var schema2 = { + const: {foo: 'bar'}, + enum: ['a', 'b'], + required: ['foo'], + another: { + + }, + patternProperties: {}, // will not traverse - no properties + dependencies: true, // will not traverse - invalid + properties: { + smaller: { + type: 'number' + }, + larger: { + type: 'number', + minimum: {$data: '1/smaller'} + } + } + }; + + // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex + var expectedCalls = [ + [schema2, '', schema2, undefined, undefined, undefined, undefined], + [schema2.another, '/another', schema2, '', 'another', schema2, undefined], + [schema2.properties.smaller, '/properties/smaller', schema2, '', 'properties', schema2, 'smaller'], + [schema2.properties.larger, '/properties/larger', schema2, '', 'properties', schema2, 'larger'], + ]; + + traverse(schema2, {allKeys: true, cb: callback}); + assert.deepStrictEqual(calls, expectedCalls); + }); + }); + + describe('pre and post', function() { + var schema = { + type: 'object', + properties: { + name: {type: 'string'}, + age: {type: 'number'} + } + }; + + it('should traverse schema in pre-order', function() { + traverse(schema, {cb: {pre}}); + var expectedCalls = [ + ['pre', schema, '', schema, undefined, undefined, undefined, undefined], + ['pre', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'], + ['pre', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'], + ]; + assert.deepStrictEqual(calls, expectedCalls); + }); + + it('should traverse schema in post-order', function() { + traverse(schema, {cb: {post}}); + var expectedCalls = [ + ['post', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'], + ['post', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'], + ['post', schema, '', schema, undefined, undefined, undefined, undefined], + ]; + assert.deepStrictEqual(calls, expectedCalls); + }); + + it('should traverse schema in pre- and post-order at the same time', function() { + traverse(schema, {cb: {pre, post}}); + var expectedCalls = [ + ['pre', schema, '', schema, undefined, undefined, undefined, undefined], + ['pre', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'], + ['post', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'], + ['pre', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'], + ['post', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'], + ['post', schema, '', schema, undefined, undefined, undefined, undefined], + ]; + assert.deepStrictEqual(calls, expectedCalls); + }); + }); + + function callback() { + calls.push(Array.prototype.slice.call(arguments)); + } + + function pre() { + calls.push(['pre'].concat(Array.prototype.slice.call(arguments))); + } + + function post() { + calls.push(['post'].concat(Array.prototype.slice.call(arguments))); + } +}); diff --git a/packages/qobserva_ui_react/node_modules/react-router/dist/lib/deprecations.d.ts b/packages/qobserva_ui_react/node_modules/react-router/dist/lib/deprecations.d.ts new file mode 100644 index 00000000..83be3ba4 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/react-router/dist/lib/deprecations.d.ts @@ -0,0 +1,4 @@ +import type { FutureConfig as RouterFutureConfig } from "@remix-run/router"; +import type { FutureConfig as RenderFutureConfig } from "./components"; +export declare function warnOnce(key: string, message: string): void; +export declare function logV6DeprecationWarnings(renderFuture: Partial | undefined, routerFuture?: Omit): void; diff --git a/packages/qobserva_ui_react/node_modules/reusify/.github/dependabot.yml b/packages/qobserva_ui_react/node_modules/reusify/.github/dependabot.yml new file mode 100644 index 00000000..4872c5af --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/reusify/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/packages/qobserva_ui_react/node_modules/tailwindcss/lib/cli/build/deps.js b/packages/qobserva_ui_react/node_modules/tailwindcss/lib/cli/build/deps.js new file mode 100644 index 00000000..1aa81163 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/tailwindcss/lib/cli/build/deps.js @@ -0,0 +1,62 @@ +// @ts-check +"use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); +} +_export(exports, { + loadPostcss: function() { + return loadPostcss; + }, + loadPostcssImport: function() { + return loadPostcssImport; + }, + loadCssNano: function() { + return loadCssNano; + }, + loadAutoprefixer: function() { + return loadAutoprefixer; + } +}); +const _index = require("../../../peers/index.js"); +function loadPostcss() { + // Try to load a local `postcss` version first + try { + return require("postcss"); + } catch {} + return (0, _index.lazyPostcss)(); +} +function loadPostcssImport() { + // Try to load a local `postcss-import` version first + try { + return require("postcss-import"); + } catch {} + return (0, _index.lazyPostcssImport)(); +} +function loadCssNano() { + let options = { + preset: [ + "default", + { + cssDeclarationSorter: false + } + ] + }; + // Try to load a local `cssnano` version first + try { + return require("cssnano"); + } catch {} + return (0, _index.lazyCssnano)()(options); +} +function loadAutoprefixer() { + // Try to load a local `autoprefixer` version first + try { + return require("autoprefixer"); + } catch {} + return (0, _index.lazyAutoprefixer)(); +} diff --git a/packages/qobserva_ui_react/node_modules/tailwindcss/src/cli/build/deps.js b/packages/qobserva_ui_react/node_modules/tailwindcss/src/cli/build/deps.js new file mode 100644 index 00000000..9435b929 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/tailwindcss/src/cli/build/deps.js @@ -0,0 +1,56 @@ +// @ts-check + +import { + // @ts-ignore + lazyPostcss, + + // @ts-ignore + lazyPostcssImport, + + // @ts-ignore + lazyCssnano, + + // @ts-ignore + lazyAutoprefixer, +} from '../../../peers/index.js' + +/** + * @returns {import('postcss')} + */ +export function loadPostcss() { + // Try to load a local `postcss` version first + try { + return require('postcss') + } catch {} + + return lazyPostcss() +} + +export function loadPostcssImport() { + // Try to load a local `postcss-import` version first + try { + return require('postcss-import') + } catch {} + + return lazyPostcssImport() +} + +export function loadCssNano() { + let options = { preset: ['default', { cssDeclarationSorter: false }] } + + // Try to load a local `cssnano` version first + try { + return require('cssnano') + } catch {} + + return lazyCssnano()(options) +} + +export function loadAutoprefixer() { + // Try to load a local `autoprefixer` version first + try { + return require('autoprefixer') + } catch {} + + return lazyAutoprefixer() +} diff --git a/packages/qobserva_ui_react/node_modules/vite/dist/node/chunks/dep-BB45zftN.js b/packages/qobserva_ui_react/node_modules/vite/dist/node/chunks/dep-BB45zftN.js new file mode 100644 index 00000000..b96cb158 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/vite/dist/node/chunks/dep-BB45zftN.js @@ -0,0 +1,993 @@ +import { C as getDefaultExportFromCjs } from './dep-BK3b2jBa.js'; +import require$$0 from 'path'; +import require$$0__default from 'fs'; +import { l as lib } from './dep-IQS-Za7F.js'; + +import { fileURLToPath as __cjs_fileURLToPath } from 'node:url'; +import { dirname as __cjs_dirname } from 'node:path'; +import { createRequire as __cjs_createRequire } from 'node:module'; + +const __filename = __cjs_fileURLToPath(import.meta.url); +const __dirname = __cjs_dirname(__filename); +const require = __cjs_createRequire(import.meta.url); +const __require = require; +function _mergeNamespaces(n, m) { + for (var i = 0; i < m.length; i++) { + var e = m[i]; + if (typeof e !== 'string' && !Array.isArray(e)) { for (var k in e) { + if (k !== 'default' && !(k in n)) { + n[k] = e[k]; + } + } } + } + return n; +} + +var formatImportPrelude$2 = function formatImportPrelude(layer, media, supports) { + const parts = []; + + if (typeof layer !== "undefined") { + let layerParams = "layer"; + if (layer) { + layerParams = `layer(${layer})`; + } + + parts.push(layerParams); + } + + if (typeof supports !== "undefined") { + parts.push(`supports(${supports})`); + } + + if (typeof media !== "undefined") { + parts.push(media); + } + + return parts.join(" ") +}; + +const formatImportPrelude$1 = formatImportPrelude$2; + +// Base64 encode an import with conditions +// The order of conditions is important and is interleaved with cascade layer declarations +// Each group of conditions and cascade layers needs to be interpreted in order +// To achieve this we create a list of base64 encoded imports, where each import contains a stylesheet with another import. +// Each import can define a single group of conditions and a single cascade layer. +var base64EncodedImport = function base64EncodedConditionalImport(prelude, conditions) { + conditions.reverse(); + const first = conditions.pop(); + let params = `${prelude} ${formatImportPrelude$1( + first.layer, + first.media, + first.supports, + )}`; + + for (const condition of conditions) { + params = `'data:text/css;base64,${Buffer.from(`@import ${params}`).toString( + "base64", + )}' ${formatImportPrelude$1( + condition.layer, + condition.media, + condition.supports, + )}`; + } + + return params +}; + +const base64EncodedConditionalImport = base64EncodedImport; + +var applyConditions$1 = function applyConditions(bundle, atRule) { + bundle.forEach(stmt => { + if ( + stmt.type === "charset" || + stmt.type === "warning" || + !stmt.conditions?.length + ) { + return + } + + if (stmt.type === "import") { + stmt.node.params = base64EncodedConditionalImport( + stmt.fullUri, + stmt.conditions, + ); + return + } + + const { nodes } = stmt; + const { parent } = nodes[0]; + + const atRules = []; + + // Convert conditions to at-rules + for (const condition of stmt.conditions) { + if (typeof condition.media !== "undefined") { + const mediaNode = atRule({ + name: "media", + params: condition.media, + source: parent.source, + }); + + atRules.push(mediaNode); + } + + if (typeof condition.supports !== "undefined") { + const supportsNode = atRule({ + name: "supports", + params: `(${condition.supports})`, + source: parent.source, + }); + + atRules.push(supportsNode); + } + + if (typeof condition.layer !== "undefined") { + const layerNode = atRule({ + name: "layer", + params: condition.layer, + source: parent.source, + }); + + atRules.push(layerNode); + } + } + + // Add nodes to AST + const outerAtRule = atRules.shift(); + const innerAtRule = atRules.reduce((previous, next) => { + previous.append(next); + return next + }, outerAtRule); + + parent.insertBefore(nodes[0], outerAtRule); + + // remove nodes + nodes.forEach(node => { + node.parent = undefined; + }); + + // better output + nodes[0].raws.before = nodes[0].raws.before || "\n"; + + // wrap new rules with media query and/or layer at rule + innerAtRule.append(nodes); + + stmt.type = "nodes"; + stmt.nodes = [outerAtRule]; + delete stmt.node; + }); +}; + +var applyRaws$1 = function applyRaws(bundle) { + bundle.forEach((stmt, index) => { + if (index === 0) return + + if (stmt.parent) { + const { before } = stmt.parent.node.raws; + if (stmt.type === "nodes") stmt.nodes[0].raws.before = before; + else stmt.node.raws.before = before; + } else if (stmt.type === "nodes") { + stmt.nodes[0].raws.before = stmt.nodes[0].raws.before || "\n"; + } + }); +}; + +var applyStyles$1 = function applyStyles(bundle, styles) { + styles.nodes = []; + + // Strip additional statements. + bundle.forEach(stmt => { + if (["charset", "import"].includes(stmt.type)) { + stmt.node.parent = undefined; + styles.append(stmt.node); + } else if (stmt.type === "nodes") { + stmt.nodes.forEach(node => { + node.parent = undefined; + styles.append(node); + }); + } + }); +}; + +var readCache$1 = {exports: {}}; + +var pify$2 = {exports: {}}; + +var processFn = function (fn, P, opts) { + return function () { + var that = this; + var args = new Array(arguments.length); + + for (var i = 0; i < arguments.length; i++) { + args[i] = arguments[i]; + } + + return new P(function (resolve, reject) { + args.push(function (err, result) { + if (err) { + reject(err); + } else if (opts.multiArgs) { + var results = new Array(arguments.length - 1); + + for (var i = 1; i < arguments.length; i++) { + results[i - 1] = arguments[i]; + } + + resolve(results); + } else { + resolve(result); + } + }); + + fn.apply(that, args); + }); + }; +}; + +var pify$1 = pify$2.exports = function (obj, P, opts) { + if (typeof P !== 'function') { + opts = P; + P = Promise; + } + + opts = opts || {}; + opts.exclude = opts.exclude || [/.+Sync$/]; + + var filter = function (key) { + var match = function (pattern) { + return typeof pattern === 'string' ? key === pattern : pattern.test(key); + }; + + return opts.include ? opts.include.some(match) : !opts.exclude.some(match); + }; + + var ret = typeof obj === 'function' ? function () { + if (opts.excludeMain) { + return obj.apply(this, arguments); + } + + return processFn(obj, P, opts).apply(this, arguments); + } : {}; + + return Object.keys(obj).reduce(function (ret, key) { + var x = obj[key]; + + ret[key] = typeof x === 'function' && filter(key) ? processFn(x, P, opts) : x; + + return ret; + }, ret); +}; + +pify$1.all = pify$1; + +var pifyExports = pify$2.exports; + +var fs = require$$0__default; +var path$3 = require$$0; +var pify = pifyExports; + +var stat = pify(fs.stat); +var readFile = pify(fs.readFile); +var resolve = path$3.resolve; + +var cache = Object.create(null); + +function convert(content, encoding) { + if (Buffer.isEncoding(encoding)) { + return content.toString(encoding); + } + return content; +} + +readCache$1.exports = function (path, encoding) { + path = resolve(path); + + return stat(path).then(function (stats) { + var item = cache[path]; + + if (item && item.mtime.getTime() === stats.mtime.getTime()) { + return convert(item.content, encoding); + } + + return readFile(path).then(function (data) { + cache[path] = { + mtime: stats.mtime, + content: data + }; + + return convert(data, encoding); + }); + }).catch(function (err) { + cache[path] = null; + return Promise.reject(err); + }); +}; + +readCache$1.exports.sync = function (path, encoding) { + path = resolve(path); + + try { + var stats = fs.statSync(path); + var item = cache[path]; + + if (item && item.mtime.getTime() === stats.mtime.getTime()) { + return convert(item.content, encoding); + } + + var data = fs.readFileSync(path); + + cache[path] = { + mtime: stats.mtime, + content: data + }; + + return convert(data, encoding); + } catch (err) { + cache[path] = null; + throw err; + } + +}; + +readCache$1.exports.get = function (path, encoding) { + path = resolve(path); + if (cache[path]) { + return convert(cache[path].content, encoding); + } + return null; +}; + +readCache$1.exports.clear = function () { + cache = Object.create(null); +}; + +var readCacheExports = readCache$1.exports; + +const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i; +const base64DataURLRegexp = /^data:text\/css;base64,/i; +const plainDataURLRegexp = /^data:text\/css;plain,/i; + +function isValid(url) { + return anyDataURLRegexp.test(url) +} + +function contents(url) { + if (base64DataURLRegexp.test(url)) { + // "data:text/css;base64,".length === 21 + return Buffer.from(url.slice(21), "base64").toString() + } + + if (plainDataURLRegexp.test(url)) { + // "data:text/css;plain,".length === 20 + return decodeURIComponent(url.slice(20)) + } + + // "data:text/css,".length === 14 + return decodeURIComponent(url.slice(14)) +} + +var dataUrl = { + isValid, + contents, +}; + +const readCache = readCacheExports; +const dataURL$1 = dataUrl; + +var loadContent$1 = function loadContent(filename) { + if (dataURL$1.isValid(filename)) { + return dataURL$1.contents(filename) + } + + return readCache(filename, "utf-8") +}; + +// external tooling +const valueParser = lib; + +// extended tooling +const { stringify } = valueParser; + +var parseStatements$1 = function parseStatements(result, styles, conditions, from) { + const statements = []; + let nodes = []; + + styles.each(node => { + let stmt; + if (node.type === "atrule") { + if (node.name === "import") + stmt = parseImport(result, node, conditions, from); + else if (node.name === "charset") + stmt = parseCharset(result, node, conditions, from); + } + + if (stmt) { + if (nodes.length) { + statements.push({ + type: "nodes", + nodes, + conditions: [...conditions], + from, + }); + nodes = []; + } + statements.push(stmt); + } else nodes.push(node); + }); + + if (nodes.length) { + statements.push({ + type: "nodes", + nodes, + conditions: [...conditions], + from, + }); + } + + return statements +}; + +function parseCharset(result, atRule, conditions, from) { + if (atRule.prev()) { + return result.warn("@charset must precede all other statements", { + node: atRule, + }) + } + return { + type: "charset", + node: atRule, + conditions: [...conditions], + from, + } +} + +function parseImport(result, atRule, conditions, from) { + let prev = atRule.prev(); + + // `@import` statements may follow other `@import` statements. + if (prev) { + do { + if ( + prev.type === "comment" || + (prev.type === "atrule" && prev.name === "import") + ) { + prev = prev.prev(); + continue + } + + break + } while (prev) + } + + // All `@import` statements may be preceded by `@charset` or `@layer` statements. + // But the `@import` statements must be consecutive. + if (prev) { + do { + if ( + prev.type === "comment" || + (prev.type === "atrule" && + (prev.name === "charset" || (prev.name === "layer" && !prev.nodes))) + ) { + prev = prev.prev(); + continue + } + + return result.warn( + "@import must precede all other statements (besides @charset or empty @layer)", + { node: atRule }, + ) + } while (prev) + } + + if (atRule.nodes) { + return result.warn( + "It looks like you didn't end your @import statement correctly. " + + "Child nodes are attached to it.", + { node: atRule }, + ) + } + + const params = valueParser(atRule.params).nodes; + const stmt = { + type: "import", + uri: "", + fullUri: "", + node: atRule, + conditions: [...conditions], + from, + }; + + let layer; + let media; + let supports; + + for (let i = 0; i < params.length; i++) { + const node = params[i]; + + if (node.type === "space" || node.type === "comment") continue + + if (node.type === "string") { + if (stmt.uri) { + return result.warn(`Multiple url's in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if (!node.value) { + return result.warn(`Unable to find uri in '${atRule.toString()}'`, { + node: atRule, + }) + } + + stmt.uri = node.value; + stmt.fullUri = stringify(node); + continue + } + + if (node.type === "function" && /^url$/i.test(node.value)) { + if (stmt.uri) { + return result.warn(`Multiple url's in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if (!node.nodes?.[0]?.value) { + return result.warn(`Unable to find uri in '${atRule.toString()}'`, { + node: atRule, + }) + } + + stmt.uri = node.nodes[0].value; + stmt.fullUri = stringify(node); + continue + } + + if (!stmt.uri) { + return result.warn(`Unable to find uri in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if ( + (node.type === "word" || node.type === "function") && + /^layer$/i.test(node.value) + ) { + if (typeof layer !== "undefined") { + return result.warn(`Multiple layers in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if (typeof supports !== "undefined") { + return result.warn( + `layers must be defined before support conditions in '${atRule.toString()}'`, + { + node: atRule, + }, + ) + } + + if (node.nodes) { + layer = stringify(node.nodes); + } else { + layer = ""; + } + + continue + } + + if (node.type === "function" && /^supports$/i.test(node.value)) { + if (typeof supports !== "undefined") { + return result.warn( + `Multiple support conditions in '${atRule.toString()}'`, + { + node: atRule, + }, + ) + } + + supports = stringify(node.nodes); + + continue + } + + media = stringify(params.slice(i)); + break + } + + if (!stmt.uri) { + return result.warn(`Unable to find uri in '${atRule.toString()}'`, { + node: atRule, + }) + } + + if ( + typeof media !== "undefined" || + typeof layer !== "undefined" || + typeof supports !== "undefined" + ) { + stmt.conditions.push({ + layer, + media, + supports, + }); + } + + return stmt +} + +// builtin tooling +const path$2 = require$$0; + +// placeholder tooling +let sugarss; + +var processContent$1 = function processContent( + result, + content, + filename, + options, + postcss, +) { + const { plugins } = options; + const ext = path$2.extname(filename); + + const parserList = []; + + // SugarSS support: + if (ext === ".sss") { + if (!sugarss) { + /* c8 ignore next 3 */ + try { + sugarss = __require('sugarss'); + } catch {} // Ignore + } + if (sugarss) + return runPostcss(postcss, content, filename, plugins, [sugarss]) + } + + // Syntax support: + if (result.opts.syntax?.parse) { + parserList.push(result.opts.syntax.parse); + } + + // Parser support: + if (result.opts.parser) parserList.push(result.opts.parser); + // Try the default as a last resort: + parserList.push(null); + + return runPostcss(postcss, content, filename, plugins, parserList) +}; + +function runPostcss(postcss, content, filename, plugins, parsers, index) { + if (!index) index = 0; + return postcss(plugins) + .process(content, { + from: filename, + parser: parsers[index], + }) + .catch(err => { + // If there's an error, try the next parser + index++; + // If there are no parsers left, throw it + if (index === parsers.length) throw err + return runPostcss(postcss, content, filename, plugins, parsers, index) + }) +} + +const path$1 = require$$0; + +const dataURL = dataUrl; +const parseStatements = parseStatements$1; +const processContent = processContent$1; +const resolveId$1 = (id) => id; +const formatImportPrelude = formatImportPrelude$2; + +async function parseStyles$1( + result, + styles, + options, + state, + conditions, + from, + postcss, +) { + const statements = parseStatements(result, styles, conditions, from); + + for (const stmt of statements) { + if (stmt.type !== "import" || !isProcessableURL(stmt.uri)) { + continue + } + + if (options.filter && !options.filter(stmt.uri)) { + // rejected by filter + continue + } + + await resolveImportId(result, stmt, options, state, postcss); + } + + let charset; + const imports = []; + const bundle = []; + + function handleCharset(stmt) { + if (!charset) charset = stmt; + // charsets aren't case-sensitive, so convert to lower case to compare + else if ( + stmt.node.params.toLowerCase() !== charset.node.params.toLowerCase() + ) { + throw stmt.node.error( + `Incompatible @charset statements: + ${stmt.node.params} specified in ${stmt.node.source.input.file} + ${charset.node.params} specified in ${charset.node.source.input.file}`, + ) + } + } + + // squash statements and their children + statements.forEach(stmt => { + if (stmt.type === "charset") handleCharset(stmt); + else if (stmt.type === "import") { + if (stmt.children) { + stmt.children.forEach((child, index) => { + if (child.type === "import") imports.push(child); + else if (child.type === "charset") handleCharset(child); + else bundle.push(child); + // For better output + if (index === 0) child.parent = stmt; + }); + } else imports.push(stmt); + } else if (stmt.type === "nodes") { + bundle.push(stmt); + } + }); + + return charset ? [charset, ...imports.concat(bundle)] : imports.concat(bundle) +} + +async function resolveImportId(result, stmt, options, state, postcss) { + if (dataURL.isValid(stmt.uri)) { + // eslint-disable-next-line require-atomic-updates + stmt.children = await loadImportContent( + result, + stmt, + stmt.uri, + options, + state, + postcss, + ); + + return + } else if (dataURL.isValid(stmt.from.slice(-1))) { + // Data urls can't be used as a base url to resolve imports. + throw stmt.node.error( + `Unable to import '${stmt.uri}' from a stylesheet that is embedded in a data url`, + ) + } + + const atRule = stmt.node; + let sourceFile; + if (atRule.source?.input?.file) { + sourceFile = atRule.source.input.file; + } + const base = sourceFile + ? path$1.dirname(atRule.source.input.file) + : options.root; + + const paths = [await options.resolve(stmt.uri, base, options, atRule)].flat(); + + // Ensure that each path is absolute: + const resolved = await Promise.all( + paths.map(file => { + return !path$1.isAbsolute(file) + ? resolveId$1(file) + : file + }), + ); + + // Add dependency messages: + resolved.forEach(file => { + result.messages.push({ + type: "dependency", + plugin: "postcss-import", + file, + parent: sourceFile, + }); + }); + + const importedContent = await Promise.all( + resolved.map(file => { + return loadImportContent(result, stmt, file, options, state, postcss) + }), + ); + + // Merge loaded statements + // eslint-disable-next-line require-atomic-updates + stmt.children = importedContent.flat().filter(x => !!x); +} + +async function loadImportContent( + result, + stmt, + filename, + options, + state, + postcss, +) { + const atRule = stmt.node; + const { conditions, from } = stmt; + const stmtDuplicateCheckKey = conditions + .map(condition => + formatImportPrelude(condition.layer, condition.media, condition.supports), + ) + .join(":"); + + if (options.skipDuplicates) { + // skip files already imported at the same scope + if (state.importedFiles[filename]?.[stmtDuplicateCheckKey]) { + return + } + + // save imported files to skip them next time + if (!state.importedFiles[filename]) { + state.importedFiles[filename] = {}; + } + state.importedFiles[filename][stmtDuplicateCheckKey] = true; + } + + if (from.includes(filename)) { + return + } + + const content = await options.load(filename, options); + + if (content.trim() === "" && options.warnOnEmpty) { + result.warn(`${filename} is empty`, { node: atRule }); + return + } + + // skip previous imported files not containing @import rules + if ( + options.skipDuplicates && + state.hashFiles[content]?.[stmtDuplicateCheckKey] + ) { + return + } + + const importedResult = await processContent( + result, + content, + filename, + options, + postcss, + ); + + const styles = importedResult.root; + result.messages = result.messages.concat(importedResult.messages); + + if (options.skipDuplicates) { + const hasImport = styles.some(child => { + return child.type === "atrule" && child.name === "import" + }); + if (!hasImport) { + // save hash files to skip them next time + if (!state.hashFiles[content]) { + state.hashFiles[content] = {}; + } + + state.hashFiles[content][stmtDuplicateCheckKey] = true; + } + } + + // recursion: import @import from imported file + return parseStyles$1( + result, + styles, + options, + state, + conditions, + [...from, filename], + postcss, + ) +} + +function isProcessableURL(uri) { + // skip protocol base uri (protocol://url) or protocol-relative + if (/^(?:[a-z]+:)?\/\//i.test(uri)) { + return false + } + + // check for fragment or query + try { + // needs a base to parse properly + const url = new URL(uri, "https://example.com"); + if (url.search) { + return false + } + } catch {} // Ignore + + return true +} + +var parseStyles_1 = parseStyles$1; + +// builtin tooling +const path = require$$0; + +// internal tooling +const applyConditions = applyConditions$1; +const applyRaws = applyRaws$1; +const applyStyles = applyStyles$1; +const loadContent = loadContent$1; +const parseStyles = parseStyles_1; +const resolveId = (id) => id; + +function AtImport(options) { + options = { + root: process.cwd(), + path: [], + skipDuplicates: true, + resolve: resolveId, + load: loadContent, + plugins: [], + addModulesDirectories: [], + warnOnEmpty: true, + ...options, + }; + + options.root = path.resolve(options.root); + + // convert string to an array of a single element + if (typeof options.path === "string") options.path = [options.path]; + + if (!Array.isArray(options.path)) options.path = []; + + options.path = options.path.map(p => path.resolve(options.root, p)); + + return { + postcssPlugin: "postcss-import", + async Once(styles, { result, atRule, postcss }) { + const state = { + importedFiles: {}, + hashFiles: {}, + }; + + if (styles.source?.input?.file) { + state.importedFiles[styles.source.input.file] = {}; + } + + if (options.plugins && !Array.isArray(options.plugins)) { + throw new Error("plugins option must be an array") + } + + const bundle = await parseStyles( + result, + styles, + options, + state, + [], + [], + postcss, + ); + + applyRaws(bundle); + applyConditions(bundle, atRule); + applyStyles(bundle, styles); + }, + } +} + +AtImport.postcss = true; + +var postcssImport = AtImport; + +var index = /*@__PURE__*/getDefaultExportFromCjs(postcssImport); + +var index$1 = /*#__PURE__*/_mergeNamespaces({ + __proto__: null, + default: index +}, [postcssImport]); + +export { index$1 as i }; diff --git a/packages/qobserva_ui_react/node_modules/vite/dist/node/chunks/dep-BK3b2jBa.js b/packages/qobserva_ui_react/node_modules/vite/dist/node/chunks/dep-BK3b2jBa.js new file mode 100644 index 00000000..7992b2f4 --- /dev/null +++ b/packages/qobserva_ui_react/node_modules/vite/dist/node/chunks/dep-BK3b2jBa.js @@ -0,0 +1,67048 @@ +import * as fs$j from 'node:fs'; +import fs__default, { promises as promises$1 } from 'node:fs'; +import fsp, { lstat as lstat$3, readdir as readdir$5, readlink, realpath as realpath$2 } from 'node:fs/promises'; +import path$n, { win32 as win32$1, posix as posix$1, isAbsolute as isAbsolute$1, join as join$2, extname as extname$1, dirname as dirname$2, relative as relative$2, basename as basename$2 } from 'node:path'; +import { fileURLToPath, URL as URL$3, parse as parse$h, pathToFileURL } from 'node:url'; +import { promisify as promisify$4, format as format$2, inspect } from 'node:util'; +import { performance as performance$1 } from 'node:perf_hooks'; +import { createRequire as createRequire$1, builtinModules } from 'node:module'; +import crypto$2, { createHash as createHash$2 } from 'node:crypto'; +import require$$0$3 from 'tty'; +import require$$0$4, { win32, posix, isAbsolute, resolve as resolve$3, relative as relative$1, basename as basename$1, extname, dirname as dirname$1, join as join$1, sep as sep$1, normalize as normalize$1 } from 'path'; +import esbuild, { transform as transform$1, formatMessages, build as build$3 } from 'esbuild'; +import { CLIENT_ENTRY, OPTIMIZABLE_ENTRY_RE, wildcardHosts, loopbackHosts, FS_PREFIX, CLIENT_PUBLIC_PATH, ENV_PUBLIC_PATH, DEFAULT_ASSETS_INLINE_LIMIT, CSS_LANGS_RE, ESBUILD_MODULES_TARGET, SPECIAL_QUERY_RE, ENV_ENTRY, DEP_VERSION_RE, DEFAULT_MAIN_FIELDS, DEFAULT_EXTENSIONS, KNOWN_ASSET_TYPES, JS_TYPES_RE, METADATA_FILENAME, VITE_PACKAGE_DIR, defaultAllowedOrigins, DEFAULT_DEV_PORT, CLIENT_DIR, VERSION, DEFAULT_PREVIEW_PORT, DEFAULT_ASSETS_RE, DEFAULT_CONFIG_FILES } from '../constants.js'; +import * as require$$0$2 from 'fs'; +import require$$0__default, { lstatSync, readdir as readdir$4, readdirSync, readlinkSync, realpathSync as realpathSync$1, existsSync, readFileSync, statSync as statSync$1 } from 'fs'; +import { EventEmitter as EventEmitter$4 } from 'node:events'; +import Stream$1 from 'node:stream'; +import { StringDecoder } from 'node:string_decoder'; +import { exec, execSync } from 'node:child_process'; +import { createServer as createServer$3, STATUS_CODES, get as get$2 } from 'node:http'; +import { createServer as createServer$2, get as get$1 } from 'node:https'; +import require$$0$5 from 'util'; +import require$$4$1 from 'net'; +import require$$0$7 from 'events'; +import require$$0$9 from 'url'; +import require$$1 from 'http'; +import require$$0$6 from 'stream'; +import require$$2 from 'os'; +import require$$2$1 from 'child_process'; +import os$5 from 'node:os'; +import { promises } from 'node:dns'; +import require$$3$1 from 'crypto'; +import require$$0$8, { createRequire as createRequire$2 } from 'module'; +import assert$1 from 'node:assert'; +import v8 from 'node:v8'; +import { Worker as Worker$1 } from 'node:worker_threads'; +import { Buffer as Buffer$1 } from 'node:buffer'; +import { parseAstAsync, parseAst } from 'rollup/parseAst'; +import * as qs from 'querystring'; +import readline from 'node:readline'; +import zlib$1 from 'zlib'; +import require$$0$a from 'buffer'; +import require$$1$1 from 'https'; +import require$$4$2 from 'tls'; +import net$1 from 'node:net'; +import require$$4$3 from 'assert'; +import { gzip } from 'node:zlib'; + +import { fileURLToPath as __cjs_fileURLToPath } from 'node:url'; +import { dirname as __cjs_dirname } from 'node:path'; +import { createRequire as __cjs_createRequire } from 'node:module'; + +const __filename = __cjs_fileURLToPath(import.meta.url); +const __dirname = __cjs_dirname(__filename); +const require = __cjs_createRequire(import.meta.url); +const __require = require; +var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; + +function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; +} + +function getAugmentedNamespace(n) { + if (n.__esModule) return n; + var f = n.default; + if (typeof f == "function") { + var a = function a () { + if (this instanceof a) { + return Reflect.construct(f, arguments, this.constructor); + } + return f.apply(this, arguments); + }; + a.prototype = f.prototype; + } else a = {}; + Object.defineProperty(a, '__esModule', {value: true}); + Object.keys(n).forEach(function (k) { + var d = Object.getOwnPropertyDescriptor(n, k); + Object.defineProperty(a, k, d.get ? d : { + enumerable: true, + get: function () { + return n[k]; + } + }); + }); + return a; +} + +function commonjsRequire(path) { + throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.'); +} + +var picocolors = {exports: {}}; + +let argv = process.argv || [], + env$1 = process.env; +let isColorSupported = + !("NO_COLOR" in env$1 || argv.includes("--no-color")) && + ("FORCE_COLOR" in env$1 || + argv.includes("--color") || + process.platform === "win32" || + (commonjsRequire != null && require$$0$3.isatty(1) && env$1.TERM !== "dumb") || + "CI" in env$1); + +let formatter = + (open, close, replace = open) => + input => { + let string = "" + input; + let index = string.indexOf(close, open.length); + return ~index + ? open + replaceClose(string, close, replace, index) + close + : open + string + close + }; + +let replaceClose = (string, close, replace, index) => { + let result = ""; + let cursor = 0; + do { + result += string.substring(cursor, index) + replace; + cursor = index + close.length; + index = string.indexOf(close, cursor); + } while (~index) + return result + string.substring(cursor) +}; + +let createColors = (enabled = isColorSupported) => { + let init = enabled ? formatter : () => String; + return { + isColorSupported: enabled, + reset: init("\x1b[0m", "\x1b[0m"), + bold: init("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"), + dim: init("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"), + italic: init("\x1b[3m", "\x1b[23m"), + underline: init("\x1b[4m", "\x1b[24m"), + inverse: init("\x1b[7m", "\x1b[27m"), + hidden: init("\x1b[8m", "\x1b[28m"), + strikethrough: init("\x1b[9m", "\x1b[29m"), + black: init("\x1b[30m", "\x1b[39m"), + red: init("\x1b[31m", "\x1b[39m"), + green: init("\x1b[32m", "\x1b[39m"), + yellow: init("\x1b[33m", "\x1b[39m"), + blue: init("\x1b[34m", "\x1b[39m"), + magenta: init("\x1b[35m", "\x1b[39m"), + cyan: init("\x1b[36m", "\x1b[39m"), + white: init("\x1b[37m", "\x1b[39m"), + gray: init("\x1b[90m", "\x1b[39m"), + bgBlack: init("\x1b[40m", "\x1b[49m"), + bgRed: init("\x1b[41m", "\x1b[49m"), + bgGreen: init("\x1b[42m", "\x1b[49m"), + bgYellow: init("\x1b[43m", "\x1b[49m"), + bgBlue: init("\x1b[44m", "\x1b[49m"), + bgMagenta: init("\x1b[45m", "\x1b[49m"), + bgCyan: init("\x1b[46m", "\x1b[49m"), + bgWhite: init("\x1b[47m", "\x1b[49m"), + } +}; + +picocolors.exports = createColors(); +picocolors.exports.createColors = createColors; + +var picocolorsExports = picocolors.exports; +var colors$1 = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports); + +function matches$1(pattern, importee) { + if (pattern instanceof RegExp) { + return pattern.test(importee); + } + if (importee.length < pattern.length) { + return false; + } + if (importee === pattern) { + return true; + } + // eslint-disable-next-line prefer-template + return importee.startsWith(pattern + '/'); +} +function getEntries({ entries, customResolver }) { + if (!entries) { + return []; + } + const resolverFunctionFromOptions = resolveCustomResolver(customResolver); + if (Array.isArray(entries)) { + return entries.map((entry) => { + return { + find: entry.find, + replacement: entry.replacement, + resolverFunction: resolveCustomResolver(entry.customResolver) || resolverFunctionFromOptions + }; + }); + } + return Object.entries(entries).map(([key, value]) => { + return { find: key, replacement: value, resolverFunction: resolverFunctionFromOptions }; + }); +} +function getHookFunction(hook) { + if (typeof hook === 'function') { + return hook; + } + if (hook && 'handler' in hook && typeof hook.handler === 'function') { + return hook.handler; + } + return null; +} +function resolveCustomResolver(customResolver) { + if (typeof customResolver === 'function') { + return customResolver; + } + if (customResolver) { + return getHookFunction(customResolver.resolveId); + } + return null; +} +function alias$1(options = {}) { + const entries = getEntries(options); + if (entries.length === 0) { + return { + name: 'alias', + resolveId: () => null + }; + } + return { + name: 'alias', + async buildStart(inputOptions) { + await Promise.all([...(Array.isArray(options.entries) ? options.entries : []), options].map(({ customResolver }) => { var _a; return customResolver && ((_a = getHookFunction(customResolver.buildStart)) === null || _a === void 0 ? void 0 : _a.call(this, inputOptions)); })); + }, + resolveId(importee, importer, resolveOptions) { + // First match is supposed to be the correct one + const matchedEntry = entries.find((entry) => matches$1(entry.find, importee)); + if (!matchedEntry) { + return null; + } + const updatedId = importee.replace(matchedEntry.find, matchedEntry.replacement); + if (matchedEntry.resolverFunction) { + return matchedEntry.resolverFunction.call(this, updatedId, importer, resolveOptions); + } + return this.resolve(updatedId, importer, Object.assign({ skipSelf: true }, resolveOptions)).then((resolved) => { + if (resolved) + return resolved; + if (!require$$0$4.isAbsolute(updatedId)) { + this.warn(`rewrote ${importee} to ${updatedId} but was not an abolute path and was not handled by other plugins. ` + + `This will lead to duplicated modules for the same path. ` + + `To avoid duplicating modules, you should resolve to an absolute path.`); + } + return { id: updatedId }; + }); + } + }; +} + +const VALID_ID_PREFIX = `/@id/`; +const NULL_BYTE_PLACEHOLDER = `__x00__`; +let SOURCEMAPPING_URL = "sourceMa"; +SOURCEMAPPING_URL += "ppingURL"; +const VITE_RUNTIME_SOURCEMAPPING_SOURCE = "//# sourceMappingSource=vite-runtime"; + +const isWindows$3 = typeof process !== "undefined" && process.platform === "win32"; +function wrapId$1(id) { + return id.startsWith(VALID_ID_PREFIX) ? id : VALID_ID_PREFIX + id.replace("\0", NULL_BYTE_PLACEHOLDER); +} +function unwrapId$1(id) { + return id.startsWith(VALID_ID_PREFIX) ? id.slice(VALID_ID_PREFIX.length).replace(NULL_BYTE_PLACEHOLDER, "\0") : id; +} +const windowsSlashRE = /\\/g; +function slash$1(p) { + return p.replace(windowsSlashRE, "/"); +} +const postfixRE = /[?#].*$/; +function cleanUrl(url) { + return url.replace(postfixRE, ""); +} +function withTrailingSlash(path) { + if (path[path.length - 1] !== "/") { + return `${path}/`; + } + return path; +} +const AsyncFunction = async function() { +}.constructor; +const asyncFunctionDeclarationPaddingLineCount = /* @__PURE__ */ (() => { + const body = "/*code*/"; + const source = new AsyncFunction("a", "b", body).toString(); + return source.slice(0, source.indexOf(body)).split("\n").length - 1; +})(); + +// @ts-check +/** @typedef { import('estree').BaseNode} BaseNode */ + +/** @typedef {{ + skip: () => void; + remove: () => void; + replace: (node: BaseNode) => void; +}} WalkerContext */ + +let WalkerBase$1 = class WalkerBase { + constructor() { + /** @type {boolean} */ + this.should_skip = false; + + /** @type {boolean} */ + this.should_remove = false; + + /** @type {BaseNode | null} */ + this.replacement = null; + + /** @type {WalkerContext} */ + this.context = { + skip: () => (this.should_skip = true), + remove: () => (this.should_remove = true), + replace: (node) => (this.replacement = node) + }; + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + * @param {BaseNode} node + */ + replace(parent, prop, index, node) { + if (parent) { + if (index !== null) { + parent[prop][index] = node; + } else { + parent[prop] = node; + } + } + } + + /** + * + * @param {any} parent + * @param {string} prop + * @param {number} index + */ + remove(parent, prop, index) { + if (parent) { + if (index !== null) { + parent[prop].splice(index, 1); + } else { + delete parent[prop]; + } + } + } +}; + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./walker.js').WalkerContext} WalkerContext */ + +/** @typedef {( + * this: WalkerContext, + * node: BaseNode, + * parent: BaseNode, + * key: string, + * index: number + * ) => void} SyncHandler */ + +let SyncWalker$1 = class SyncWalker extends WalkerBase$1 { + /** + * + * @param {SyncHandler} enter + * @param {SyncHandler} leave + */ + constructor(enter, leave) { + super(); + + /** @type {SyncHandler} */ + this.enter = enter; + + /** @type {SyncHandler} */ + this.leave = leave; + } + + /** + * + * @param {BaseNode} node + * @param {BaseNode} parent + * @param {string} [prop] + * @param {number} [index] + * @returns {BaseNode} + */ + visit(node, parent, prop, index) { + if (node) { + if (this.enter) { + const _should_skip = this.should_skip; + const _should_remove = this.should_remove; + const _replacement = this.replacement; + this.should_skip = false; + this.should_remove = false; + this.replacement = null; + + this.enter.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const skipped = this.should_skip; + const removed = this.should_remove; + + this.should_skip = _should_skip; + this.should_remove = _should_remove; + this.replacement = _replacement; + + if (skipped) return node; + if (removed) return null; + } + + for (const key in node) { + const value = node[key]; + + if (typeof value !== "object") { + continue; + } else if (Array.isArray(value)) { + for (let i = 0; i < value.length; i += 1) { + if (value[i] !== null && typeof value[i].type === 'string') { + if (!this.visit(value[i], node, key, i)) { + // removed + i--; + } + } + } + } else if (value !== null && typeof value.type === "string") { + this.visit(value, node, key, null); + } + } + + if (this.leave) { + const _replacement = this.replacement; + const _should_remove = this.should_remove; + this.replacement = null; + this.should_remove = false; + + this.leave.call(this.context, node, parent, prop, index); + + if (this.replacement) { + node = this.replacement; + this.replace(parent, prop, index, node); + } + + if (this.should_remove) { + this.remove(parent, prop, index); + } + + const removed = this.should_remove; + + this.replacement = _replacement; + this.should_remove = _should_remove; + + if (removed) return null; + } + } + + return node; + } +}; + +// @ts-check + +/** @typedef { import('estree').BaseNode} BaseNode */ +/** @typedef { import('./sync.js').SyncHandler} SyncHandler */ +/** @typedef { import('./async.js').AsyncHandler} AsyncHandler */ + +/** + * + * @param {BaseNode} ast + * @param {{ + * enter?: SyncHandler + * leave?: SyncHandler + * }} walker + * @returns {BaseNode} + */ +function walk$3(ast, { enter, leave }) { + const instance = new SyncWalker$1(enter, leave); + return instance.visit(ast, null); +} + +var utils$k = {}; + +const path$m = require$$0$4; +const WIN_SLASH = '\\\\/'; +const WIN_NO_SLASH = `[^${WIN_SLASH}]`; + +/** + * Posix glob regex + */ + +const DOT_LITERAL = '\\.'; +const PLUS_LITERAL = '\\+'; +const QMARK_LITERAL = '\\?'; +const SLASH_LITERAL = '\\/'; +const ONE_CHAR = '(?=.)'; +const QMARK = '[^/]'; +const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`; +const START_ANCHOR = `(?:^|${SLASH_LITERAL})`; +const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`; +const NO_DOT = `(?!${DOT_LITERAL})`; +const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`; +const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`; +const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`; +const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`; +const STAR$1 = `${QMARK}*?`; + +const POSIX_CHARS = { + DOT_LITERAL, + PLUS_LITERAL, + QMARK_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + QMARK, + END_ANCHOR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK_NO_DOT, + STAR: STAR$1, + START_ANCHOR +}; + +/** + * Windows glob regex + */ + +const WINDOWS_CHARS = { + ...POSIX_CHARS, + + SLASH_LITERAL: `[${WIN_SLASH}]`, + QMARK: WIN_NO_SLASH, + STAR: `${WIN_NO_SLASH}*?`, + DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`, + NO_DOT: `(?!${DOT_LITERAL})`, + NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`, + NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`, + QMARK_NO_DOT: `[^.${WIN_SLASH}]`, + START_ANCHOR: `(?:^|[${WIN_SLASH}])`, + END_ANCHOR: `(?:[${WIN_SLASH}]|$)` +}; + +/** + * POSIX Bracket Regex + */ + +const POSIX_REGEX_SOURCE$1 = { + alnum: 'a-zA-Z0-9', + alpha: 'a-zA-Z', + ascii: '\\x00-\\x7F', + blank: ' \\t', + cntrl: '\\x00-\\x1F\\x7F', + digit: '0-9', + graph: '\\x21-\\x7E', + lower: 'a-z', + print: '\\x20-\\x7E ', + punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~', + space: ' \\t\\r\\n\\v\\f', + upper: 'A-Z', + word: 'A-Za-z0-9_', + xdigit: 'A-Fa-f0-9' +}; + +var constants$6 = { + MAX_LENGTH: 1024 * 64, + POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1, + + // regular expressions + REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g, + REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/, + REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/, + REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g, + REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g, + REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g, + + // Replace globs with equivalent patterns to reduce parsing time. + REPLACEMENTS: { + '***': '*', + '**/**': '**', + '**/**/**': '**' + }, + + // Digits + CHAR_0: 48, /* 0 */ + CHAR_9: 57, /* 9 */ + + // Alphabet chars. + CHAR_UPPERCASE_A: 65, /* A */ + CHAR_LOWERCASE_A: 97, /* a */ + CHAR_UPPERCASE_Z: 90, /* Z */ + CHAR_LOWERCASE_Z: 122, /* z */ + + CHAR_LEFT_PARENTHESES: 40, /* ( */ + CHAR_RIGHT_PARENTHESES: 41, /* ) */ + + CHAR_ASTERISK: 42, /* * */ + + // Non-alphabetic chars. + CHAR_AMPERSAND: 38, /* & */ + CHAR_AT: 64, /* @ */ + CHAR_BACKWARD_SLASH: 92, /* \ */ + CHAR_CARRIAGE_RETURN: 13, /* \r */ + CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */ + CHAR_COLON: 58, /* : */ + CHAR_COMMA: 44, /* , */ + CHAR_DOT: 46, /* . */ + CHAR_DOUBLE_QUOTE: 34, /* " */ + CHAR_EQUAL: 61, /* = */ + CHAR_EXCLAMATION_MARK: 33, /* ! */ + CHAR_FORM_FEED: 12, /* \f */ + CHAR_FORWARD_SLASH: 47, /* / */ + CHAR_GRAVE_ACCENT: 96, /* ` */ + CHAR_HASH: 35, /* # */ + CHAR_HYPHEN_MINUS: 45, /* - */ + CHAR_LEFT_ANGLE_BRACKET: 60, /* < */ + CHAR_LEFT_CURLY_BRACE: 123, /* { */ + CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */ + CHAR_LINE_FEED: 10, /* \n */ + CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */ + CHAR_PERCENT: 37, /* % */ + CHAR_PLUS: 43, /* + */ + CHAR_QUESTION_MARK: 63, /* ? */ + CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */ + CHAR_RIGHT_CURLY_BRACE: 125, /* } */ + CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */ + CHAR_SEMICOLON: 59, /* ; */ + CHAR_SINGLE_QUOTE: 39, /* ' */ + CHAR_SPACE: 32, /* */ + CHAR_TAB: 9, /* \t */ + CHAR_UNDERSCORE: 95, /* _ */ + CHAR_VERTICAL_LINE: 124, /* | */ + CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */ + + SEP: path$m.sep, + + /** + * Create EXTGLOB_CHARS + */ + + extglobChars(chars) { + return { + '!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` }, + '?': { type: 'qmark', open: '(?:', close: ')?' }, + '+': { type: 'plus', open: '(?:', close: ')+' }, + '*': { type: 'star', open: '(?:', close: ')*' }, + '@': { type: 'at', open: '(?:', close: ')' } + }; + }, + + /** + * Create GLOB_CHARS + */ + + globChars(win32) { + return win32 === true ? WINDOWS_CHARS : POSIX_CHARS; + } +}; + +(function (exports) { + + const path = require$$0$4; + const win32 = process.platform === 'win32'; + const { + REGEX_BACKSLASH, + REGEX_REMOVE_BACKSLASH, + REGEX_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_GLOBAL + } = constants$6; + + exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val); + exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str); + exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str); + exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1'); + exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/'); + + exports.removeBackslashes = str => { + return str.replace(REGEX_REMOVE_BACKSLASH, match => { + return match === '\\' ? '' : match; + }); + }; + + exports.supportsLookbehinds = () => { + const segs = process.version.slice(1).split('.').map(Number); + if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) { + return true; + } + return false; + }; + + exports.isWindows = options => { + if (options && typeof options.windows === 'boolean') { + return options.windows; + } + return win32 === true || path.sep === '\\'; + }; + + exports.escapeLast = (input, char, lastIdx) => { + const idx = input.lastIndexOf(char, lastIdx); + if (idx === -1) return input; + if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1); + return `${input.slice(0, idx)}\\${input.slice(idx)}`; + }; + + exports.removePrefix = (input, state = {}) => { + let output = input; + if (output.startsWith('./')) { + output = output.slice(2); + state.prefix = './'; + } + return output; + }; + + exports.wrapOutput = (input, state = {}, options = {}) => { + const prepend = options.contains ? '' : '^'; + const append = options.contains ? '' : '$'; + + let output = `${prepend}(?:${input})${append}`; + if (state.negated === true) { + output = `(?:^(?!${output}).*$)`; + } + return output; + }; +} (utils$k)); + +const utils$j = utils$k; +const { + CHAR_ASTERISK, /* * */ + CHAR_AT, /* @ */ + CHAR_BACKWARD_SLASH, /* \ */ + CHAR_COMMA: CHAR_COMMA$1, /* , */ + CHAR_DOT: CHAR_DOT$1, /* . */ + CHAR_EXCLAMATION_MARK, /* ! */ + CHAR_FORWARD_SLASH, /* / */ + CHAR_LEFT_CURLY_BRACE: CHAR_LEFT_CURLY_BRACE$1, /* { */ + CHAR_LEFT_PARENTHESES: CHAR_LEFT_PARENTHESES$1, /* ( */ + CHAR_LEFT_SQUARE_BRACKET: CHAR_LEFT_SQUARE_BRACKET$1, /* [ */ + CHAR_PLUS, /* + */ + CHAR_QUESTION_MARK, /* ? */ + CHAR_RIGHT_CURLY_BRACE: CHAR_RIGHT_CURLY_BRACE$1, /* } */ + CHAR_RIGHT_PARENTHESES: CHAR_RIGHT_PARENTHESES$1, /* ) */ + CHAR_RIGHT_SQUARE_BRACKET: CHAR_RIGHT_SQUARE_BRACKET$1 /* ] */ +} = constants$6; + +const isPathSeparator = code => { + return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH; +}; + +const depth = token => { + if (token.isPrefix !== true) { + token.depth = token.isGlobstar ? Infinity : 1; + } +}; + +/** + * Quickly scans a glob pattern and returns an object with a handful of + * useful properties, like `isGlob`, `path` (the leading non-glob, if it exists), + * `glob` (the actual pattern), `negated` (true if the path starts with `!` but not + * with `!(`) and `negatedExtglob` (true if the path starts with `!(`). + * + * ```js + * const pm = require('picomatch'); + * console.log(pm.scan('foo/bar/*.js')); + * { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' } + * ``` + * @param {String} `str` + * @param {Object} `options` + * @return {Object} Returns an object with tokens and regex source string. + * @api public + */ + +const scan$2 = (input, options) => { + const opts = options || {}; + + const length = input.length - 1; + const scanToEnd = opts.parts === true || opts.scanToEnd === true; + const slashes = []; + const tokens = []; + const parts = []; + + let str = input; + let index = -1; + let start = 0; + let lastIndex = 0; + let isBrace = false; + let isBracket = false; + let isGlob = false; + let isExtglob = false; + let isGlobstar = false; + let braceEscaped = false; + let backslashes = false; + let negated = false; + let negatedExtglob = false; + let finished = false; + let braces = 0; + let prev; + let code; + let token = { value: '', depth: 0, isGlob: false }; + + const eos = () => index >= length; + const peek = () => str.charCodeAt(index + 1); + const advance = () => { + prev = code; + return str.charCodeAt(++index); + }; + + while (index < length) { + code = advance(); + let next; + + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + + if (code === CHAR_LEFT_CURLY_BRACE$1) { + braceEscaped = true; + } + continue; + } + + if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE$1) { + braces++; + + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (code === CHAR_LEFT_CURLY_BRACE$1) { + braces++; + continue; + } + + if (braceEscaped !== true && code === CHAR_DOT$1 && (code = advance()) === CHAR_DOT$1) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (braceEscaped !== true && code === CHAR_COMMA$1) { + isBrace = token.isBrace = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_RIGHT_CURLY_BRACE$1) { + braces--; + + if (braces === 0) { + braceEscaped = false; + isBrace = token.isBrace = true; + finished = true; + break; + } + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (code === CHAR_FORWARD_SLASH) { + slashes.push(index); + tokens.push(token); + token = { value: '', depth: 0, isGlob: false }; + + if (finished === true) continue; + if (prev === CHAR_DOT$1 && index === (start + 1)) { + start += 2; + continue; + } + + lastIndex = index + 1; + continue; + } + + if (opts.noext !== true) { + const isExtglobChar = code === CHAR_PLUS + || code === CHAR_AT + || code === CHAR_ASTERISK + || code === CHAR_QUESTION_MARK + || code === CHAR_EXCLAMATION_MARK; + + if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES$1) { + isGlob = token.isGlob = true; + isExtglob = token.isExtglob = true; + finished = true; + if (code === CHAR_EXCLAMATION_MARK && index === start) { + negatedExtglob = true; + } + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES$1) { + isGlob = token.isGlob = true; + finished = true; + break; + } + } + continue; + } + break; + } + } + + if (code === CHAR_ASTERISK) { + if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true; + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_QUESTION_MARK) { + isGlob = token.isGlob = true; + finished = true; + + if (scanToEnd === true) { + continue; + } + break; + } + + if (code === CHAR_LEFT_SQUARE_BRACKET$1) { + while (eos() !== true && (next = advance())) { + if (next === CHAR_BACKWARD_SLASH) { + backslashes = token.backslashes = true; + advance(); + continue; + } + + if (next === CHAR_RIGHT_SQUARE_BRACKET$1) { + isBracket = token.isBracket = true; + isGlob = token.isGlob = true; + finished = true; + break; + } + } + + if (scanToEnd === true) { + continue; + } + + break; + } + + if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) { + negated = token.negated = true; + start++; + continue; + } + + if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES$1) { + isGlob = token.isGlob = true; + + if (scanToEnd === true) { + while (eos() !== true && (code = advance())) { + if (code === CHAR_LEFT_PARENTHESES$1) { + backslashes = token.backslashes = true; + code = advance(); + continue; + } + + if (code === CHAR_RIGHT_PARENTHESES$1) { + finished = true; + break; + } + } + continue; + } + break; + } + + if (isGlob === true) { + finished = true; + + if (scanToEnd === true) { + continue; + } + + break; + } + } + + if (opts.noext === true) { + isExtglob = false; + isGlob = false; + } + + let base = str; + let prefix = ''; + let glob = ''; + + if (start > 0) { + prefix = str.slice(0, start); + str = str.slice(start); + lastIndex -= start; + } + + if (base && isGlob === true && lastIndex > 0) { + base = str.slice(0, lastIndex); + glob = str.slice(lastIndex); + } else if (isGlob === true) { + base = ''; + glob = str; + } else { + base = str; + } + + if (base && base !== '' && base !== '/' && base !== str) { + if (isPathSeparator(base.charCodeAt(base.length - 1))) { + base = base.slice(0, -1); + } + } + + if (opts.unescape === true) { + if (glob) glob = utils$j.removeBackslashes(glob); + + if (base && backslashes === true) { + base = utils$j.removeBackslashes(base); + } + } + + const state = { + prefix, + input, + start, + base, + glob, + isBrace, + isBracket, + isGlob, + isExtglob, + isGlobstar, + negated, + negatedExtglob + }; + + if (opts.tokens === true) { + state.maxDepth = 0; + if (!isPathSeparator(code)) { + tokens.push(token); + } + state.tokens = tokens; + } + + if (opts.parts === true || opts.tokens === true) { + let prevIndex; + + for (let idx = 0; idx < slashes.length; idx++) { + const n = prevIndex ? prevIndex + 1 : start; + const i = slashes[idx]; + const value = input.slice(n, i); + if (opts.tokens) { + if (idx === 0 && start !== 0) { + tokens[idx].isPrefix = true; + tokens[idx].value = prefix; + } else { + tokens[idx].value = value; + } + depth(tokens[idx]); + state.maxDepth += tokens[idx].depth; + } + if (idx !== 0 || value !== '') { + parts.push(value); + } + prevIndex = i; + } + + if (prevIndex && prevIndex + 1 < input.length) { + const value = input.slice(prevIndex + 1); + parts.push(value); + + if (opts.tokens) { + tokens[tokens.length - 1].value = value; + depth(tokens[tokens.length - 1]); + state.maxDepth += tokens[tokens.length - 1].depth; + } + } + + state.slashes = slashes; + state.parts = parts; + } + + return state; +}; + +var scan_1 = scan$2; + +const constants$5 = constants$6; +const utils$i = utils$k; + +/** + * Constants + */ + +const { + MAX_LENGTH: MAX_LENGTH$1, + POSIX_REGEX_SOURCE, + REGEX_NON_SPECIAL_CHARS, + REGEX_SPECIAL_CHARS_BACKREF, + REPLACEMENTS +} = constants$5; + +/** + * Helpers + */ + +const expandRange = (args, options) => { + if (typeof options.expandRange === 'function') { + return options.expandRange(...args, options); + } + + args.sort(); + const value = `[${args.join('-')}]`; + + return value; +}; + +/** + * Create the message for a syntax error + */ + +const syntaxError = (type, char) => { + return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`; +}; + +/** + * Parse the given input string. + * @param {String} input + * @param {Object} options + * @return {Object} + */ + +const parse$g = (input, options) => { + if (typeof input !== 'string') { + throw new TypeError('Expected a string'); + } + + input = REPLACEMENTS[input] || input; + + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1; + + let len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + const bos = { type: 'bos', value: '', output: opts.prepend || '' }; + const tokens = [bos]; + + const capture = opts.capture ? '' : '?:'; + const win32 = utils$i.isWindows(options); + + // create constants based on platform, for windows or posix + const PLATFORM_CHARS = constants$5.globChars(win32); + const EXTGLOB_CHARS = constants$5.extglobChars(PLATFORM_CHARS); + + const { + DOT_LITERAL, + PLUS_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOT_SLASH, + NO_DOTS_SLASH, + QMARK, + QMARK_NO_DOT, + STAR, + START_ANCHOR + } = PLATFORM_CHARS; + + const globstar = opts => { + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const nodot = opts.dot ? '' : NO_DOT; + const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT; + let star = opts.bash === true ? globstar(opts) : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + // minimatch options support + if (typeof opts.noext === 'boolean') { + opts.noextglob = opts.noext; + } + + const state = { + input, + index: -1, + start: 0, + dot: opts.dot === true, + consumed: '', + output: '', + prefix: '', + backtrack: false, + negated: false, + brackets: 0, + braces: 0, + parens: 0, + quotes: 0, + globstar: false, + tokens + }; + + input = utils$i.removePrefix(input, state); + len = input.length; + + const extglobs = []; + const braces = []; + const stack = []; + let prev = bos; + let value; + + /** + * Tokenizing helpers + */ + + const eos = () => state.index === len - 1; + const peek = state.peek = (n = 1) => input[state.index + n]; + const advance = state.advance = () => input[++state.index] || ''; + const remaining = () => input.slice(state.index + 1); + const consume = (value = '', num = 0) => { + state.consumed += value; + state.index += num; + }; + + const append = token => { + state.output += token.output != null ? token.output : token.value; + consume(token.value); + }; + + const negate = () => { + let count = 1; + + while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) { + advance(); + state.start++; + count++; + } + + if (count % 2 === 0) { + return false; + } + + state.negated = true; + state.start++; + return true; + }; + + const increment = type => { + state[type]++; + stack.push(type); + }; + + const decrement = type => { + state[type]--; + stack.pop(); + }; + + /** + * Push tokens onto the tokens array. This helper speeds up + * tokenizing by 1) helping us avoid backtracking as much as possible, + * and 2) helping us avoid creating extra tokens when consecutive + * characters are plain text. This improves performance and simplifies + * lookbehinds. + */ + + const push = tok => { + if (prev.type === 'globstar') { + const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace'); + const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren')); + + if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) { + state.output = state.output.slice(0, -prev.output.length); + prev.type = 'star'; + prev.value = '*'; + prev.output = star; + state.output += prev.output; + } + } + + if (extglobs.length && tok.type !== 'paren') { + extglobs[extglobs.length - 1].inner += tok.value; + } + + if (tok.value || tok.output) append(tok); + if (prev && prev.type === 'text' && tok.type === 'text') { + prev.value += tok.value; + prev.output = (prev.output || '') + tok.value; + return; + } + + tok.prev = prev; + tokens.push(tok); + prev = tok; + }; + + const extglobOpen = (type, value) => { + const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' }; + + token.prev = prev; + token.parens = state.parens; + token.output = state.output; + const output = (opts.capture ? '(' : '') + token.open; + + increment('parens'); + push({ type, value, output: state.output ? '' : ONE_CHAR }); + push({ type: 'paren', extglob: true, value: advance(), output }); + extglobs.push(token); + }; + + const extglobClose = token => { + let output = token.close + (opts.capture ? ')' : ''); + let rest; + + if (token.type === 'negate') { + let extglobStar = star; + + if (token.inner && token.inner.length > 1 && token.inner.includes('/')) { + extglobStar = globstar(opts); + } + + if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) { + output = token.close = `)$))${extglobStar}`; + } + + if (token.inner.includes('*') && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) { + // Any non-magical string (`.ts`) or even nested expression (`.{ts,tsx}`) can follow after the closing parenthesis. + // In this case, we need to parse the string and use it in the output of the original pattern. + // Suitable patterns: `/!(*.d).ts`, `/!(*.d).{ts,tsx}`, `**/!(*-dbg).@(js)`. + // + // Disabling the `fastpaths` option due to a problem with parsing strings as `.ts` in the pattern like `**/!(*.d).ts`. + const expression = parse$g(rest, { ...options, fastpaths: false }).output; + + output = token.close = `)${expression})${extglobStar})`; + } + + if (token.prev.type === 'bos') { + state.negatedExtglob = true; + } + } + + push({ type: 'paren', extglob: true, value, output }); + decrement('parens'); + }; + + /** + * Fast paths + */ + + if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) { + let backslashes = false; + + let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => { + if (first === '\\') { + backslashes = true; + return m; + } + + if (first === '?') { + if (esc) { + return esc + first + (rest ? QMARK.repeat(rest.length) : ''); + } + if (index === 0) { + return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : ''); + } + return QMARK.repeat(chars.length); + } + + if (first === '.') { + return DOT_LITERAL.repeat(chars.length); + } + + if (first === '*') { + if (esc) { + return esc + first + (rest ? star : ''); + } + return star; + } + return esc ? m : `\\${m}`; + }); + + if (backslashes === true) { + if (opts.unescape === true) { + output = output.replace(/\\/g, ''); + } else { + output = output.replace(/\\+/g, m => { + return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : ''); + }); + } + } + + if (output === input && opts.contains === true) { + state.output = input; + return state; + } + + state.output = utils$i.wrapOutput(output, state, options); + return state; + } + + /** + * Tokenize input until we reach end-of-string + */ + + while (!eos()) { + value = advance(); + + if (value === '\u0000') { + continue; + } + + /** + * Escaped characters + */ + + if (value === '\\') { + const next = peek(); + + if (next === '/' && opts.bash !== true) { + continue; + } + + if (next === '.' || next === ';') { + continue; + } + + if (!next) { + value += '\\'; + push({ type: 'text', value }); + continue; + } + + // collapse slashes to reduce potential for exploits + const match = /^\\+/.exec(remaining()); + let slashes = 0; + + if (match && match[0].length > 2) { + slashes = match[0].length; + state.index += slashes; + if (slashes % 2 !== 0) { + value += '\\'; + } + } + + if (opts.unescape === true) { + value = advance(); + } else { + value += advance(); + } + + if (state.brackets === 0) { + push({ type: 'text', value }); + continue; + } + } + + /** + * If we're inside a regex character class, continue + * until we reach the closing bracket. + */ + + if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) { + if (opts.posix !== false && value === ':') { + const inner = prev.value.slice(1); + if (inner.includes('[')) { + prev.posix = true; + + if (inner.includes(':')) { + const idx = prev.value.lastIndexOf('['); + const pre = prev.value.slice(0, idx); + const rest = prev.value.slice(idx + 2); + const posix = POSIX_REGEX_SOURCE[rest]; + if (posix) { + prev.value = pre + posix; + state.backtrack = true; + advance(); + + if (!bos.output && tokens.indexOf(prev) === 1) { + bos.output = ONE_CHAR; + } + continue; + } + } + } + } + + if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) { + value = `\\${value}`; + } + + if (value === ']' && (prev.value === '[' || prev.value === '[^')) { + value = `\\${value}`; + } + + if (opts.posix === true && value === '!' && prev.value === '[') { + value = '^'; + } + + prev.value += value; + append({ value }); + continue; + } + + /** + * If we're inside a quoted string, continue + * until we reach the closing double quote. + */ + + if (state.quotes === 1 && value !== '"') { + value = utils$i.escapeRegex(value); + prev.value += value; + append({ value }); + continue; + } + + /** + * Double quotes + */ + + if (value === '"') { + state.quotes = state.quotes === 1 ? 0 : 1; + if (opts.keepQuotes === true) { + push({ type: 'text', value }); + } + continue; + } + + /** + * Parentheses + */ + + if (value === '(') { + increment('parens'); + push({ type: 'paren', value }); + continue; + } + + if (value === ')') { + if (state.parens === 0 && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '(')); + } + + const extglob = extglobs[extglobs.length - 1]; + if (extglob && state.parens === extglob.parens + 1) { + extglobClose(extglobs.pop()); + continue; + } + + push({ type: 'paren', value, output: state.parens ? ')' : '\\)' }); + decrement('parens'); + continue; + } + + /** + * Square brackets + */ + + if (value === '[') { + if (opts.nobracket === true || !remaining().includes(']')) { + if (opts.nobracket !== true && opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('closing', ']')); + } + + value = `\\${value}`; + } else { + increment('brackets'); + } + + push({ type: 'bracket', value }); + continue; + } + + if (value === ']') { + if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) { + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + if (state.brackets === 0) { + if (opts.strictBrackets === true) { + throw new SyntaxError(syntaxError('opening', '[')); + } + + push({ type: 'text', value, output: `\\${value}` }); + continue; + } + + decrement('brackets'); + + const prevValue = prev.value.slice(1); + if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) { + value = `/${value}`; + } + + prev.value += value; + append({ value }); + + // when literal brackets are explicitly disabled + // assume we should match with a regex character class + if (opts.literalBrackets === false || utils$i.hasRegexChars(prevValue)) { + continue; + } + + const escaped = utils$i.escapeRegex(prev.value); + state.output = state.output.slice(0, -prev.value.length); + + // when literal brackets are explicitly enabled + // assume we should escape the brackets to match literal characters + if (opts.literalBrackets === true) { + state.output += escaped; + prev.value = escaped; + continue; + } + + // when the user specifies nothing, try to match both + prev.value = `(${capture}${escaped}|${prev.value})`; + state.output += prev.value; + continue; + } + + /** + * Braces + */ + + if (value === '{' && opts.nobrace !== true) { + increment('braces'); + + const open = { + type: 'brace', + value, + output: '(', + outputIndex: state.output.length, + tokensIndex: state.tokens.length + }; + + braces.push(open); + push(open); + continue; + } + + if (value === '}') { + const brace = braces[braces.length - 1]; + + if (opts.nobrace === true || !brace) { + push({ type: 'text', value, output: value }); + continue; + } + + let output = ')'; + + if (brace.dots === true) { + const arr = tokens.slice(); + const range = []; + + for (let i = arr.length - 1; i >= 0; i--) { + tokens.pop(); + if (arr[i].type === 'brace') { + break; + } + if (arr[i].type !== 'dots') { + range.unshift(arr[i].value); + } + } + + output = expandRange(range, opts); + state.backtrack = true; + } + + if (brace.comma !== true && brace.dots !== true) { + const out = state.output.slice(0, brace.outputIndex); + const toks = state.tokens.slice(brace.tokensIndex); + brace.value = brace.output = '\\{'; + value = output = '\\}'; + state.output = out; + for (const t of toks) { + state.output += (t.output || t.value); + } + } + + push({ type: 'brace', value, output }); + decrement('braces'); + braces.pop(); + continue; + } + + /** + * Pipes + */ + + if (value === '|') { + if (extglobs.length > 0) { + extglobs[extglobs.length - 1].conditions++; + } + push({ type: 'text', value }); + continue; + } + + /** + * Commas + */ + + if (value === ',') { + let output = value; + + const brace = braces[braces.length - 1]; + if (brace && stack[stack.length - 1] === 'braces') { + brace.comma = true; + output = '|'; + } + + push({ type: 'comma', value, output }); + continue; + } + + /** + * Slashes + */ + + if (value === '/') { + // if the beginning of the glob is "./", advance the start + // to the current index, and don't add the "./" characters + // to the state. This greatly simplifies lookbehinds when + // checking for BOS characters like "!" and "." (not "./") + if (prev.type === 'dot' && state.index === state.start + 1) { + state.start = state.index + 1; + state.consumed = ''; + state.output = ''; + tokens.pop(); + prev = bos; // reset "prev" to the first token + continue; + } + + push({ type: 'slash', value, output: SLASH_LITERAL }); + continue; + } + + /** + * Dots + */ + + if (value === '.') { + if (state.braces > 0 && prev.type === 'dot') { + if (prev.value === '.') prev.output = DOT_LITERAL; + const brace = braces[braces.length - 1]; + prev.type = 'dots'; + prev.output += value; + prev.value += value; + brace.dots = true; + continue; + } + + if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') { + push({ type: 'text', value, output: DOT_LITERAL }); + continue; + } + + push({ type: 'dot', value, output: DOT_LITERAL }); + continue; + } + + /** + * Question marks + */ + + if (value === '?') { + const isGroup = prev && prev.value === '('; + if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('qmark', value); + continue; + } + + if (prev && prev.type === 'paren') { + const next = peek(); + let output = value; + + if (next === '<' && !utils$i.supportsLookbehinds()) { + throw new Error('Node.js v10 or higher is required for regex lookbehinds'); + } + + if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) { + output = `\\${value}`; + } + + push({ type: 'text', value, output }); + continue; + } + + if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) { + push({ type: 'qmark', value, output: QMARK_NO_DOT }); + continue; + } + + push({ type: 'qmark', value, output: QMARK }); + continue; + } + + /** + * Exclamation + */ + + if (value === '!') { + if (opts.noextglob !== true && peek() === '(') { + if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) { + extglobOpen('negate', value); + continue; + } + } + + if (opts.nonegate !== true && state.index === 0) { + negate(); + continue; + } + } + + /** + * Plus + */ + + if (value === '+') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + extglobOpen('plus', value); + continue; + } + + if ((prev && prev.value === '(') || opts.regex === false) { + push({ type: 'plus', value, output: PLUS_LITERAL }); + continue; + } + + if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) { + push({ type: 'plus', value }); + continue; + } + + push({ type: 'plus', value: PLUS_LITERAL }); + continue; + } + + /** + * Plain text + */ + + if (value === '@') { + if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') { + push({ type: 'at', extglob: true, value, output: '' }); + continue; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Plain text + */ + + if (value !== '*') { + if (value === '$' || value === '^') { + value = `\\${value}`; + } + + const match = REGEX_NON_SPECIAL_CHARS.exec(remaining()); + if (match) { + value += match[0]; + state.index += match[0].length; + } + + push({ type: 'text', value }); + continue; + } + + /** + * Stars + */ + + if (prev && (prev.type === 'globstar' || prev.star === true)) { + prev.type = 'star'; + prev.star = true; + prev.value += value; + prev.output = star; + state.backtrack = true; + state.globstar = true; + consume(value); + continue; + } + + let rest = remaining(); + if (opts.noextglob !== true && /^\([^?]/.test(rest)) { + extglobOpen('star', value); + continue; + } + + if (prev.type === 'star') { + if (opts.noglobstar === true) { + consume(value); + continue; + } + + const prior = prev.prev; + const before = prior.prev; + const isStart = prior.type === 'slash' || prior.type === 'bos'; + const afterStar = before && (before.type === 'star' || before.type === 'globstar'); + + if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) { + push({ type: 'star', value, output: '' }); + continue; + } + + const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace'); + const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren'); + if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) { + push({ type: 'star', value, output: '' }); + continue; + } + + // strip consecutive `/**/` + while (rest.slice(0, 3) === '/**') { + const after = input[state.index + 4]; + if (after && after !== '/') { + break; + } + rest = rest.slice(3); + consume('/**', 3); + } + + if (prior.type === 'bos' && eos()) { + prev.type = 'globstar'; + prev.value += value; + prev.output = globstar(opts); + state.output = prev.output; + state.globstar = true; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) { + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)'); + prev.value += value; + state.globstar = true; + state.output += prior.output + prev.output; + consume(value); + continue; + } + + if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') { + const end = rest[1] !== void 0 ? '|$' : ''; + + state.output = state.output.slice(0, -(prior.output + prev.output).length); + prior.output = `(?:${prior.output}`; + + prev.type = 'globstar'; + prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`; + prev.value += value; + + state.output += prior.output + prev.output; + state.globstar = true; + + consume(value + advance()); + + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + if (prior.type === 'bos' && rest[0] === '/') { + prev.type = 'globstar'; + prev.value += value; + prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`; + state.output = prev.output; + state.globstar = true; + consume(value + advance()); + push({ type: 'slash', value: '/', output: '' }); + continue; + } + + // remove single star from output + state.output = state.output.slice(0, -prev.output.length); + + // reset previous token to globstar + prev.type = 'globstar'; + prev.output = globstar(opts); + prev.value += value; + + // reset output with globstar + state.output += prev.output; + state.globstar = true; + consume(value); + continue; + } + + const token = { type: 'star', value, output: star }; + + if (opts.bash === true) { + token.output = '.*?'; + if (prev.type === 'bos' || prev.type === 'slash') { + token.output = nodot + token.output; + } + push(token); + continue; + } + + if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) { + token.output = value; + push(token); + continue; + } + + if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') { + if (prev.type === 'dot') { + state.output += NO_DOT_SLASH; + prev.output += NO_DOT_SLASH; + + } else if (opts.dot === true) { + state.output += NO_DOTS_SLASH; + prev.output += NO_DOTS_SLASH; + + } else { + state.output += nodot; + prev.output += nodot; + } + + if (peek() !== '*') { + state.output += ONE_CHAR; + prev.output += ONE_CHAR; + } + } + + push(token); + } + + while (state.brackets > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']')); + state.output = utils$i.escapeLast(state.output, '['); + decrement('brackets'); + } + + while (state.parens > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')')); + state.output = utils$i.escapeLast(state.output, '('); + decrement('parens'); + } + + while (state.braces > 0) { + if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}')); + state.output = utils$i.escapeLast(state.output, '{'); + decrement('braces'); + } + + if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) { + push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` }); + } + + // rebuild the output if we had to backtrack at any point + if (state.backtrack === true) { + state.output = ''; + + for (const token of state.tokens) { + state.output += token.output != null ? token.output : token.value; + + if (token.suffix) { + state.output += token.suffix; + } + } + } + + return state; +}; + +/** + * Fast paths for creating regular expressions for common glob patterns. + * This can significantly speed up processing and has very little downside + * impact when none of the fast paths match. + */ + +parse$g.fastpaths = (input, options) => { + const opts = { ...options }; + const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH$1, opts.maxLength) : MAX_LENGTH$1; + const len = input.length; + if (len > max) { + throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`); + } + + input = REPLACEMENTS[input] || input; + const win32 = utils$i.isWindows(options); + + // create constants based on platform, for windows or posix + const { + DOT_LITERAL, + SLASH_LITERAL, + ONE_CHAR, + DOTS_SLASH, + NO_DOT, + NO_DOTS, + NO_DOTS_SLASH, + STAR, + START_ANCHOR + } = constants$5.globChars(win32); + + const nodot = opts.dot ? NO_DOTS : NO_DOT; + const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT; + const capture = opts.capture ? '' : '?:'; + const state = { negated: false, prefix: '' }; + let star = opts.bash === true ? '.*?' : STAR; + + if (opts.capture) { + star = `(${star})`; + } + + const globstar = opts => { + if (opts.noglobstar === true) return star; + return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`; + }; + + const create = str => { + switch (str) { + case '*': + return `${nodot}${ONE_CHAR}${star}`; + + case '.*': + return `${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*.*': + return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '*/*': + return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`; + + case '**': + return nodot + globstar(opts); + + case '**/*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`; + + case '**/*.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`; + + case '**/.*': + return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`; + + default: { + const match = /^(.*?)\.(\w+)$/.exec(str); + if (!match) return; + + const source = create(match[1]); + if (!source) return; + + return source + DOT_LITERAL + match[2]; + } + } + }; + + const output = utils$i.removePrefix(input, state); + let source = create(output); + + if (source && opts.strictSlashes !== true) { + source += `${SLASH_LITERAL}?`; + } + + return source; +}; + +var parse_1$3 = parse$g; + +const path$l = require$$0$4; +const scan$1 = scan_1; +const parse$f = parse_1$3; +const utils$h = utils$k; +const constants$4 = constants$6; +const isObject$3 = val => val && typeof val === 'object' && !Array.isArray(val); + +/** + * Creates a matcher function from one or more glob patterns. The + * returned function takes a string to match as its first argument, + * and returns true if the string is a match. The returned matcher + * function also takes a boolean as the second argument that, when true, + * returns an object with additional information. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch(glob[, options]); + * + * const isMatch = picomatch('*.!(*a)'); + * console.log(isMatch('a.a')); //=> false + * console.log(isMatch('a.b')); //=> true + * ``` + * @name picomatch + * @param {String|Array} `globs` One or more glob patterns. + * @param {Object=} `options` + * @return {Function=} Returns a matcher function. + * @api public + */ + +const picomatch$5 = (glob, options, returnState = false) => { + if (Array.isArray(glob)) { + const fns = glob.map(input => picomatch$5(input, options, returnState)); + const arrayMatcher = str => { + for (const isMatch of fns) { + const state = isMatch(str); + if (state) return state; + } + return false; + }; + return arrayMatcher; + } + + const isState = isObject$3(glob) && glob.tokens && glob.input; + + if (glob === '' || (typeof glob !== 'string' && !isState)) { + throw new TypeError('Expected pattern to be a non-empty string'); + } + + const opts = options || {}; + const posix = utils$h.isWindows(options); + const regex = isState + ? picomatch$5.compileRe(glob, options) + : picomatch$5.makeRe(glob, options, false, true); + + const state = regex.state; + delete regex.state; + + let isIgnored = () => false; + if (opts.ignore) { + const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null }; + isIgnored = picomatch$5(opts.ignore, ignoreOpts, returnState); + } + + const matcher = (input, returnObject = false) => { + const { isMatch, match, output } = picomatch$5.test(input, regex, options, { glob, posix }); + const result = { glob, state, regex, posix, input, output, match, isMatch }; + + if (typeof opts.onResult === 'function') { + opts.onResult(result); + } + + if (isMatch === false) { + result.isMatch = false; + return returnObject ? result : false; + } + + if (isIgnored(input)) { + if (typeof opts.onIgnore === 'function') { + opts.onIgnore(result); + } + result.isMatch = false; + return returnObject ? result : false; + } + + if (typeof opts.onMatch === 'function') { + opts.onMatch(result); + } + return returnObject ? result : true; + }; + + if (returnState) { + matcher.state = state; + } + + return matcher; +}; + +/** + * Test `input` with the given `regex`. This is used by the main + * `picomatch()` function to test the input string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.test(input, regex[, options]); + * + * console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/)); + * // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' } + * ``` + * @param {String} `input` String to test. + * @param {RegExp} `regex` + * @return {Object} Returns an object with matching info. + * @api public + */ + +picomatch$5.test = (input, regex, options, { glob, posix } = {}) => { + if (typeof input !== 'string') { + throw new TypeError('Expected input to be a string'); + } + + if (input === '') { + return { isMatch: false, output: '' }; + } + + const opts = options || {}; + const format = opts.format || (posix ? utils$h.toPosixSlashes : null); + let match = input === glob; + let output = (match && format) ? format(input) : input; + + if (match === false) { + output = format ? format(input) : input; + match = output === glob; + } + + if (match === false || opts.capture === true) { + if (opts.matchBase === true || opts.basename === true) { + match = picomatch$5.matchBase(input, regex, options, posix); + } else { + match = regex.exec(output); + } + } + + return { isMatch: Boolean(match), match, output }; +}; + +/** + * Match the basename of a filepath. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.matchBase(input, glob[, options]); + * console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true + * ``` + * @param {String} `input` String to test. + * @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe). + * @return {Boolean} + * @api public + */ + +picomatch$5.matchBase = (input, glob, options, posix = utils$h.isWindows(options)) => { + const regex = glob instanceof RegExp ? glob : picomatch$5.makeRe(glob, options); + return regex.test(path$l.basename(input)); +}; + +/** + * Returns true if **any** of the given glob `patterns` match the specified `string`. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.isMatch(string, patterns[, options]); + * + * console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true + * console.log(picomatch.isMatch('a.a', 'b.*')); //=> false + * ``` + * @param {String|Array} str The string to test. + * @param {String|Array} patterns One or more glob patterns to use for matching. + * @param {Object} [options] See available [options](#options). + * @return {Boolean} Returns true if any patterns match `str` + * @api public + */ + +picomatch$5.isMatch = (str, patterns, options) => picomatch$5(patterns, options)(str); + +/** + * Parse a glob pattern to create the source string for a regular + * expression. + * + * ```js + * const picomatch = require('picomatch'); + * const result = picomatch.parse(pattern[, options]); + * ``` + * @param {String} `pattern` + * @param {Object} `options` + * @return {Object} Returns an object with useful properties and output to be used as a regex source string. + * @api public + */ + +picomatch$5.parse = (pattern, options) => { + if (Array.isArray(pattern)) return pattern.map(p => picomatch$5.parse(p, options)); + return parse$f(pattern, { ...options, fastpaths: false }); +}; + +/** + * Scan a glob pattern to separate the pattern into segments. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.scan(input[, options]); + * + * const result = picomatch.scan('!./foo/*.js'); + * console.log(result); + * { prefix: '!./', + * input: '!./foo/*.js', + * start: 3, + * base: 'foo', + * glob: '*.js', + * isBrace: false, + * isBracket: false, + * isGlob: true, + * isExtglob: false, + * isGlobstar: false, + * negated: true } + * ``` + * @param {String} `input` Glob pattern to scan. + * @param {Object} `options` + * @return {Object} Returns an object with + * @api public + */ + +picomatch$5.scan = (input, options) => scan$1(input, options); + +/** + * Compile a regular expression from the `state` object returned by the + * [parse()](#parse) method. + * + * @param {Object} `state` + * @param {Object} `options` + * @param {Boolean} `returnOutput` Intended for implementors, this argument allows you to return the raw output from the parser. + * @param {Boolean} `returnState` Adds the state to a `state` property on the returned regex. Useful for implementors and debugging. + * @return {RegExp} + * @api public + */ + +picomatch$5.compileRe = (state, options, returnOutput = false, returnState = false) => { + if (returnOutput === true) { + return state.output; + } + + const opts = options || {}; + const prepend = opts.contains ? '' : '^'; + const append = opts.contains ? '' : '$'; + + let source = `${prepend}(?:${state.output})${append}`; + if (state && state.negated === true) { + source = `^(?!${source}).*$`; + } + + const regex = picomatch$5.toRegex(source, options); + if (returnState === true) { + regex.state = state; + } + + return regex; +}; + +/** + * Create a regular expression from a parsed glob pattern. + * + * ```js + * const picomatch = require('picomatch'); + * const state = picomatch.parse('*.js'); + * // picomatch.compileRe(state[, options]); + * + * console.log(picomatch.compileRe(state)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `state` The object returned from the `.parse` method. + * @param {Object} `options` + * @param {Boolean} `returnOutput` Implementors may use this argument to return the compiled output, instead of a regular expression. This is not exposed on the options to prevent end-users from mutating the result. + * @param {Boolean} `returnState` Implementors may use this argument to return the state from the parsed glob with the returned regular expression. + * @return {RegExp} Returns a regex created from the given pattern. + * @api public + */ + +picomatch$5.makeRe = (input, options = {}, returnOutput = false, returnState = false) => { + if (!input || typeof input !== 'string') { + throw new TypeError('Expected a non-empty string'); + } + + let parsed = { negated: false, fastpaths: true }; + + if (options.fastpaths !== false && (input[0] === '.' || input[0] === '*')) { + parsed.output = parse$f.fastpaths(input, options); + } + + if (!parsed.output) { + parsed = parse$f(input, options); + } + + return picomatch$5.compileRe(parsed, options, returnOutput, returnState); +}; + +/** + * Create a regular expression from the given regex source string. + * + * ```js + * const picomatch = require('picomatch'); + * // picomatch.toRegex(source[, options]); + * + * const { output } = picomatch.parse('*.js'); + * console.log(picomatch.toRegex(output)); + * //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/ + * ``` + * @param {String} `source` Regular expression source string. + * @param {Object} `options` + * @return {RegExp} + * @api public + */ + +picomatch$5.toRegex = (source, options) => { + try { + const opts = options || {}; + return new RegExp(source, opts.flags || (opts.nocase ? 'i' : '')); + } catch (err) { + if (options && options.debug === true) throw err; + return /$^/; + } +}; + +/** + * Picomatch constants. + * @return {Object} + */ + +picomatch$5.constants = constants$4; + +/** + * Expose "picomatch" + */ + +var picomatch_1 = picomatch$5; + +var picomatch$3 = picomatch_1; + +var picomatch$4 = /*@__PURE__*/getDefaultExportFromCjs(picomatch$3); + +const extractors = { + ArrayPattern(names, param) { + for (const element of param.elements) { + if (element) + extractors[element.type](names, element); + } + }, + AssignmentPattern(names, param) { + extractors[param.left.type](names, param.left); + }, + Identifier(names, param) { + names.push(param.name); + }, + MemberExpression() { }, + ObjectPattern(names, param) { + for (const prop of param.properties) { + // @ts-ignore Typescript reports that this is not a valid type + if (prop.type === 'RestElement') { + extractors.RestElement(names, prop); + } + else { + extractors[prop.value.type](names, prop.value); + } + } + }, + RestElement(names, param) { + extractors[param.argument.type](names, param.argument); + } +}; +const extractAssignedNames = function extractAssignedNames(param) { + const names = []; + extractors[param.type](names, param); + return names; +}; + +const blockDeclarations = { + const: true, + let: true +}; +class Scope { + constructor(options = {}) { + this.parent = options.parent; + this.isBlockScope = !!options.block; + this.declarations = Object.create(null); + if (options.params) { + options.params.forEach((param) => { + extractAssignedNames(param).forEach((name) => { + this.declarations[name] = true; + }); + }); + } + } + addDeclaration(node, isBlockDeclaration, isVar) { + if (!isBlockDeclaration && this.isBlockScope) { + // it's a `var` or function node, and this + // is a block scope, so we need to go up + this.parent.addDeclaration(node, isBlockDeclaration, isVar); + } + else if (node.id) { + extractAssignedNames(node.id).forEach((name) => { + this.declarations[name] = true; + }); + } + } + contains(name) { + return this.declarations[name] || (this.parent ? this.parent.contains(name) : false); + } +} +const attachScopes = function attachScopes(ast, propertyName = 'scope') { + let scope = new Scope(); + walk$3(ast, { + enter(n, parent) { + const node = n; + // function foo () {...} + // class Foo {...} + if (/(Function|Class)Declaration/.test(node.type)) { + scope.addDeclaration(node, false, false); + } + // var foo = 1 + if (node.type === 'VariableDeclaration') { + const { kind } = node; + const isBlockDeclaration = blockDeclarations[kind]; + node.declarations.forEach((declaration) => { + scope.addDeclaration(declaration, isBlockDeclaration, true); + }); + } + let newScope; + // create new function scope + if (/Function/.test(node.type)) { + const func = node; + newScope = new Scope({ + parent: scope, + block: false, + params: func.params + }); + // named function expressions - the name is considered + // part of the function's scope + if (func.type === 'FunctionExpression' && func.id) { + newScope.addDeclaration(func, false, false); + } + } + // create new for scope + if (/For(In|Of)?Statement/.test(node.type)) { + newScope = new Scope({ + parent: scope, + block: true + }); + } + // create new block scope + if (node.type === 'BlockStatement' && !/Function/.test(parent.type)) { + newScope = new Scope({ + parent: scope, + block: true + }); + } + // catch clause has its own block scope + if (node.type === 'CatchClause') { + newScope = new Scope({ + parent: scope, + params: node.param ? [node.param] : [], + block: true + }); + } + if (newScope) { + Object.defineProperty(node, propertyName, { + value: newScope, + configurable: true + }); + scope = newScope; + } + }, + leave(n) { + const node = n; + if (node[propertyName]) + scope = scope.parent; + } + }); + return scope; +}; + +// Helper since Typescript can't detect readonly arrays with Array.isArray +function isArray(arg) { + return Array.isArray(arg); +} +function ensureArray(thing) { + if (isArray(thing)) + return thing; + if (thing == null) + return []; + return [thing]; +} + +const normalizePath$5 = function normalizePath(filename) { + return filename.split(win32.sep).join(posix.sep); +}; + +function getMatcherString(id, resolutionBase) { + if (resolutionBase === false || isAbsolute(id) || id.startsWith('**')) { + return normalizePath$5(id); + } + // resolve('') is valid and will default to process.cwd() + const basePath = normalizePath$5(resolve$3(resolutionBase || '')) + // escape all possible (posix + win) path characters that might interfere with regex + .replace(/[-^$*+?.()|[\]{}]/g, '\\$&'); + // Note that we use posix.join because: + // 1. the basePath has been normalized to use / + // 2. the incoming glob (id) matcher, also uses / + // otherwise Node will force backslash (\) on windows + return posix.join(basePath, normalizePath$5(id)); +} +const createFilter$1 = function createFilter(include, exclude, options) { + const resolutionBase = options && options.resolve; + const getMatcher = (id) => id instanceof RegExp + ? id + : { + test: (what) => { + // this refactor is a tad overly verbose but makes for easy debugging + const pattern = getMatcherString(id, resolutionBase); + const fn = picomatch$4(pattern, { dot: true }); + const result = fn(what); + return result; + } + }; + const includeMatchers = ensureArray(include).map(getMatcher); + const excludeMatchers = ensureArray(exclude).map(getMatcher); + return function result(id) { + if (typeof id !== 'string') + return false; + if (/\0/.test(id)) + return false; + const pathId = normalizePath$5(id); + for (let i = 0; i < excludeMatchers.length; ++i) { + const matcher = excludeMatchers[i]; + if (matcher.test(pathId)) + return false; + } + for (let i = 0; i < includeMatchers.length; ++i) { + const matcher = includeMatchers[i]; + if (matcher.test(pathId)) + return true; + } + return !includeMatchers.length; + }; +}; + +const reservedWords = 'break case class catch const continue debugger default delete do else export extends finally for function if import in instanceof let new return super switch this throw try typeof var void while with yield enum await implements package protected static interface private public'; +const builtins = 'arguments Infinity NaN undefined null true false eval uneval isFinite isNaN parseFloat parseInt decodeURI decodeURIComponent encodeURI encodeURIComponent escape unescape Object Function Boolean Symbol Error EvalError InternalError RangeError ReferenceError SyntaxError TypeError URIError Number Math Date String RegExp Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array Map Set WeakMap WeakSet SIMD ArrayBuffer DataView JSON Promise Generator GeneratorFunction Reflect Proxy Intl'; +const forbiddenIdentifiers = new Set(`${reservedWords} ${builtins}`.split(' ')); +forbiddenIdentifiers.add(''); +const makeLegalIdentifier = function makeLegalIdentifier(str) { + let identifier = str + .replace(/-(\w)/g, (_, letter) => letter.toUpperCase()) + .replace(/[^$_a-zA-Z0-9]/g, '_'); + if (/\d/.test(identifier[0]) || forbiddenIdentifiers.has(identifier)) { + identifier = `_${identifier}`; + } + return identifier || '_'; +}; + +function stringify$8(obj) { + return (JSON.stringify(obj) || 'undefined').replace(/[\u2028\u2029]/g, (char) => `\\u${`000${char.charCodeAt(0).toString(16)}`.slice(-4)}`); +} +function serializeArray(arr, indent, baseIndent) { + let output = '['; + const separator = indent ? `\n${baseIndent}${indent}` : ''; + for (let i = 0; i < arr.length; i++) { + const key = arr[i]; + output += `${i > 0 ? ',' : ''}${separator}${serialize(key, indent, baseIndent + indent)}`; + } + return `${output}${indent ? `\n${baseIndent}` : ''}]`; +} +function serializeObject(obj, indent, baseIndent) { + let output = '{'; + const separator = indent ? `\n${baseIndent}${indent}` : ''; + const entries = Object.entries(obj); + for (let i = 0; i < entries.length; i++) { + const [key, value] = entries[i]; + const stringKey = makeLegalIdentifier(key) === key ? key : stringify$8(key); + output += `${i > 0 ? ',' : ''}${separator}${stringKey}:${indent ? ' ' : ''}${serialize(value, indent, baseIndent + indent)}`; + } + return `${output}${indent ? `\n${baseIndent}` : ''}}`; +} +function serialize(obj, indent, baseIndent) { + if (typeof obj === 'object' && obj !== null) { + if (Array.isArray(obj)) + return serializeArray(obj, indent, baseIndent); + if (obj instanceof Date) + return `new Date(${obj.getTime()})`; + if (obj instanceof RegExp) + return obj.toString(); + return serializeObject(obj, indent, baseIndent); + } + if (typeof obj === 'number') { + if (obj === Infinity) + return 'Infinity'; + if (obj === -Infinity) + return '-Infinity'; + if (obj === 0) + return 1 / obj === Infinity ? '0' : '-0'; + if (obj !== obj) + return 'NaN'; // eslint-disable-line no-self-compare + } + if (typeof obj === 'symbol') { + const key = Symbol.keyFor(obj); + // eslint-disable-next-line no-undefined + if (key !== undefined) + return `Symbol.for(${stringify$8(key)})`; + } + if (typeof obj === 'bigint') + return `${obj}n`; + return stringify$8(obj); +} +// isWellFormed exists from Node.js 20 +const hasStringIsWellFormed = 'isWellFormed' in String.prototype; +function isWellFormedString(input) { + // @ts-expect-error String::isWellFormed exists from ES2024. tsconfig lib is set to ES6 + if (hasStringIsWellFormed) + return input.isWellFormed(); + // https://github.com/tc39/proposal-is-usv-string/blob/main/README.md#algorithm + return !/\p{Surrogate}/u.test(input); +} +const dataToEsm = function dataToEsm(data, options = {}) { + var _a, _b; + const t = options.compact ? '' : 'indent' in options ? options.indent : '\t'; + const _ = options.compact ? '' : ' '; + const n = options.compact ? '' : '\n'; + const declarationType = options.preferConst ? 'const' : 'var'; + if (options.namedExports === false || + typeof data !== 'object' || + Array.isArray(data) || + data instanceof Date || + data instanceof RegExp || + data === null) { + const code = serialize(data, options.compact ? null : t, ''); + const magic = _ || (/^[{[\-\/]/.test(code) ? '' : ' '); // eslint-disable-line no-useless-escape + return `export default${magic}${code};`; + } + let maxUnderbarPrefixLength = 0; + for (const key of Object.keys(data)) { + const underbarPrefixLength = (_b = (_a = key.match(/^(_+)/)) === null || _a === void 0 ? void 0 : _a[0].length) !== null && _b !== void 0 ? _b : 0; + if (underbarPrefixLength > maxUnderbarPrefixLength) { + maxUnderbarPrefixLength = underbarPrefixLength; + } + } + const arbitraryNamePrefix = `${'_'.repeat(maxUnderbarPrefixLength + 1)}arbitrary`; + let namedExportCode = ''; + const defaultExportRows = []; + const arbitraryNameExportRows = []; + for (const [key, value] of Object.entries(data)) { + if (key === makeLegalIdentifier(key)) { + if (options.objectShorthand) + defaultExportRows.push(key); + else + defaultExportRows.push(`${key}:${_}${key}`); + namedExportCode += `export ${declarationType} ${key}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`; + } + else { + defaultExportRows.push(`${stringify$8(key)}:${_}${serialize(value, options.compact ? null : t, '')}`); + if (options.includeArbitraryNames && isWellFormedString(key)) { + const variableName = `${arbitraryNamePrefix}${arbitraryNameExportRows.length}`; + namedExportCode += `${declarationType} ${variableName}${_}=${_}${serialize(value, options.compact ? null : t, '')};${n}`; + arbitraryNameExportRows.push(`${variableName} as ${JSON.stringify(key)}`); + } + } + } + const arbitraryExportCode = arbitraryNameExportRows.length > 0 + ? `export${_}{${n}${t}${arbitraryNameExportRows.join(`,${n}${t}`)}${n}};${n}` + : ''; + const defaultExportCode = `export default${_}{${n}${t}${defaultExportRows.join(`,${n}${t}`)}${n}};${n}`; + return `${namedExportCode}${arbitraryExportCode}${defaultExportCode}`; +}; + +var path$k = require$$0$4; + +var commondir = function (basedir, relfiles) { + if (relfiles) { + var files = relfiles.map(function (r) { + return path$k.resolve(basedir, r); + }); + } + else { + var files = basedir; + } + + var res = files.slice(1).reduce(function (ps, file) { + if (!file.match(/^([A-Za-z]:)?\/|\\/)) { + throw new Error('relative path without a basedir'); + } + + var xs = file.split(/\/+|\\+/); + for ( + var i = 0; + ps[i] === xs[i] && i < Math.min(ps.length, xs.length); + i++ + ); + return ps.slice(0, i); + }, files[0].split(/\/+|\\+/)); + + // Windows correctly handles paths with forward-slashes + return res.length > 1 ? res.join('/') : '/' +}; + +var getCommonDir = /*@__PURE__*/getDefaultExportFromCjs(commondir); + +var balancedMatch = balanced$1; +function balanced$1(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range$1(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced$1.range = range$1; +function range$1(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + if(a===b) { + return [ai, bi]; + } + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} + +var balanced = balancedMatch; + +var braceExpansion = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand$3(escapeBraces(str), true).map(unescapeBraces); +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand$3(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m) return [str]; + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand$3(m.post, false) + : ['']; + + if (/\$$/.test(m.pre)) { + for (var k = 0; k < post.length; k++) { + var expansion = pre+ '{' + m.body + '}' + post[k]; + expansions.push(expansion); + } + } else { + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = m.body.indexOf(',') >= 0; + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand$3(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand$3(n[0], false).map(embrace); + if (n.length === 1) { + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length); + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = []; + + for (var j = 0; j < n.length; j++) { + N.push.apply(N, expand$3(n[j], false)); + } + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + } + + return expansions; +} + +var expand$4 = /*@__PURE__*/getDefaultExportFromCjs(braceExpansion); + +const MAX_PATTERN_LENGTH = 1024 * 64; +const assertValidPattern = (pattern) => { + if (typeof pattern !== 'string') { + throw new TypeError('invalid pattern'); + } + if (pattern.length > MAX_PATTERN_LENGTH) { + throw new TypeError('pattern is too long'); + } +}; + +// translate the various posix character classes into unicode properties +// this works across all unicode locales +// { : [, /u flag required, negated] +const posixClasses = { + '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true], + '[:alpha:]': ['\\p{L}\\p{Nl}', true], + '[:ascii:]': ['\\x' + '00-\\x' + '7f', false], + '[:blank:]': ['\\p{Zs}\\t', true], + '[:cntrl:]': ['\\p{Cc}', true], + '[:digit:]': ['\\p{Nd}', true], + '[:graph:]': ['\\p{Z}\\p{C}', true, true], + '[:lower:]': ['\\p{Ll}', true], + '[:print:]': ['\\p{C}', true], + '[:punct:]': ['\\p{P}', true], + '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true], + '[:upper:]': ['\\p{Lu}', true], + '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true], + '[:xdigit:]': ['A-Fa-f0-9', false], +}; +// only need to escape a few things inside of brace expressions +// escapes: [ \ ] - +const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&'); +// escape all regexp magic characters +const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// everything has already been escaped, we just have to join +const rangesToString = (ranges) => ranges.join(''); +// takes a glob string at a posix brace expression, and returns +// an equivalent regular expression source, and boolean indicating +// whether the /u flag needs to be applied, and the number of chars +// consumed to parse the character class. +// This also removes out of order ranges, and returns ($.) if the +// entire class just no good. +const parseClass = (glob, position) => { + const pos = position; + /* c8 ignore start */ + if (glob.charAt(pos) !== '[') { + throw new Error('not in a brace expression'); + } + /* c8 ignore stop */ + const ranges = []; + const negs = []; + let i = pos + 1; + let sawStart = false; + let uflag = false; + let escaping = false; + let negate = false; + let endPos = pos; + let rangeStart = ''; + WHILE: while (i < glob.length) { + const c = glob.charAt(i); + if ((c === '!' || c === '^') && i === pos + 1) { + negate = true; + i++; + continue; + } + if (c === ']' && sawStart && !escaping) { + endPos = i + 1; + break; + } + sawStart = true; + if (c === '\\') { + if (!escaping) { + escaping = true; + i++; + continue; + } + // escaped \ char, fall through and treat like normal char + } + if (c === '[' && !escaping) { + // either a posix class, a collation equivalent, or just a [ + for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) { + if (glob.startsWith(cls, i)) { + // invalid, [a-[] is fine, but not [a-[:alpha]] + if (rangeStart) { + return ['$.', false, glob.length - pos, true]; + } + i += cls.length; + if (neg) + negs.push(unip); + else + ranges.push(unip); + uflag = uflag || u; + continue WHILE; + } + } + } + // now it's just a normal character, effectively + escaping = false; + if (rangeStart) { + // throw this range away if it's not valid, but others + // can still match. + if (c > rangeStart) { + ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c)); + } + else if (c === rangeStart) { + ranges.push(braceEscape(c)); + } + rangeStart = ''; + i++; + continue; + } + // now might be the start of a range. + // can be either c-d or c-] or c] or c] at this point + if (glob.startsWith('-]', i + 1)) { + ranges.push(braceEscape(c + '-')); + i += 2; + continue; + } + if (glob.startsWith('-', i + 1)) { + rangeStart = c; + i += 2; + continue; + } + // not the start of a range, just a single character + ranges.push(braceEscape(c)); + i++; + } + if (endPos < i) { + // didn't see the end of the class, not a valid class, + // but might still be valid as a literal match. + return ['', false, 0, false]; + } + // if we got no ranges and no negates, then we have a range that + // cannot possibly match anything, and that poisons the whole glob + if (!ranges.length && !negs.length) { + return ['$.', false, glob.length - pos, true]; + } + // if we got one positive range, and it's a single character, then that's + // not actually a magic pattern, it's just that one literal character. + // we should not treat that as "magic", we should just return the literal + // character. [_] is a perfectly valid way to escape glob magic chars. + if (negs.length === 0 && + ranges.length === 1 && + /^\\?.$/.test(ranges[0]) && + !negate) { + const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]; + return [regexpEscape(r), false, endPos - pos, false]; + } + const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'; + const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'; + const comb = ranges.length && negs.length + ? '(' + sranges + '|' + snegs + ')' + : ranges.length + ? sranges + : snegs; + return [comb, uflag, endPos - pos, true]; +}; + +/** + * Un-escape a string that has been escaped with {@link escape}. + * + * If the {@link windowsPathsNoEscape} option is used, then square-brace + * escapes are removed, but not backslash escapes. For example, it will turn + * the string `'[*]'` into `*`, but it will not turn `'\\*'` into `'*'`, + * becuase `\` is a path separator in `windowsPathsNoEscape` mode. + * + * When `windowsPathsNoEscape` is not set, then both brace escapes and + * backslash escapes are removed. + * + * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped + * or unescaped. + */ +const unescape$1 = (s, { windowsPathsNoEscape = false, } = {}) => { + return windowsPathsNoEscape + ? s.replace(/\[([^\/\\])\]/g, '$1') + : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, '$1$2').replace(/\\([^\/])/g, '$1'); +}; + +// parse a single path portion +const types$1 = new Set(['!', '?', '+', '*', '@']); +const isExtglobType = (c) => types$1.has(c); +// Patterns that get prepended to bind to the start of either the +// entire string, or just a single path portion, to prevent dots +// and/or traversal patterns, when needed. +// Exts don't need the ^ or / bit, because the root binds that already. +const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))'; +const startNoDot = '(?!\\.)'; +// characters that indicate a start of pattern needs the "no dots" bit, +// because a dot *might* be matched. ( is not in the list, because in +// the case of a child extglob, it will handle the prevention itself. +const addPatternStart = new Set(['[', '.']); +// cases where traversal is A-OK, no dot prevention needed +const justDots = new Set(['..', '.']); +const reSpecials = new Set('().*{}+?[]^$\\!'); +const regExpEscape$1 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +// any single thing other than / +const qmark$1 = '[^/]'; +// * => any number of characters +const star$1 = qmark$1 + '*?'; +// use + when we need to ensure that *something* matches, because the * is +// the only thing in the path portion. +const starNoEmpty = qmark$1 + '+?'; +// remove the \ chars that we added if we end up doing a nonmagic compare +// const deslash = (s: string) => s.replace(/\\(.)/g, '$1') +class AST { + type; + #root; + #hasMagic; + #uflag = false; + #parts = []; + #parent; + #parentIndex; + #negs; + #filledNegs = false; + #options; + #toString; + // set to true if it's an extglob with no children + // (which really means one child of '') + #emptyExt = false; + constructor(type, parent, options = {}) { + this.type = type; + // extglobs are inherently magical + if (type) + this.#hasMagic = true; + this.#parent = parent; + this.#root = this.#parent ? this.#parent.#root : this; + this.#options = this.#root === this ? options : this.#root.#options; + this.#negs = this.#root === this ? [] : this.#root.#negs; + if (type === '!' && !this.#root.#filledNegs) + this.#negs.push(this); + this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0; + } + get hasMagic() { + /* c8 ignore start */ + if (this.#hasMagic !== undefined) + return this.#hasMagic; + /* c8 ignore stop */ + for (const p of this.#parts) { + if (typeof p === 'string') + continue; + if (p.type || p.hasMagic) + return (this.#hasMagic = true); + } + // note: will be undefined until we generate the regexp src and find out + return this.#hasMagic; + } + // reconstructs the pattern + toString() { + if (this.#toString !== undefined) + return this.#toString; + if (!this.type) { + return (this.#toString = this.#parts.map(p => String(p)).join('')); + } + else { + return (this.#toString = + this.type + '(' + this.#parts.map(p => String(p)).join('|') + ')'); + } + } + #fillNegs() { + /* c8 ignore start */ + if (this !== this.#root) + throw new Error('should only call on root'); + if (this.#filledNegs) + return this; + /* c8 ignore stop */ + // call toString() once to fill this out + this.toString(); + this.#filledNegs = true; + let n; + while ((n = this.#negs.pop())) { + if (n.type !== '!') + continue; + // walk up the tree, appending everthing that comes AFTER parentIndex + let p = n; + let pp = p.#parent; + while (pp) { + for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) { + for (const part of n.#parts) { + /* c8 ignore start */ + if (typeof part === 'string') { + throw new Error('string part in extglob AST??'); + } + /* c8 ignore stop */ + part.copyIn(pp.#parts[i]); + } + } + p = pp; + pp = p.#parent; + } + } + return this; + } + push(...parts) { + for (const p of parts) { + if (p === '') + continue; + /* c8 ignore start */ + if (typeof p !== 'string' && !(p instanceof AST && p.#parent === this)) { + throw new Error('invalid part: ' + p); + } + /* c8 ignore stop */ + this.#parts.push(p); + } + } + toJSON() { + const ret = this.type === null + ? this.#parts.slice().map(p => (typeof p === 'string' ? p : p.toJSON())) + : [this.type, ...this.#parts.map(p => p.toJSON())]; + if (this.isStart() && !this.type) + ret.unshift([]); + if (this.isEnd() && + (this === this.#root || + (this.#root.#filledNegs && this.#parent?.type === '!'))) { + ret.push({}); + } + return ret; + } + isStart() { + if (this.#root === this) + return true; + // if (this.type) return !!this.#parent?.isStart() + if (!this.#parent?.isStart()) + return false; + if (this.#parentIndex === 0) + return true; + // if everything AHEAD of this is a negation, then it's still the "start" + const p = this.#parent; + for (let i = 0; i < this.#parentIndex; i++) { + const pp = p.#parts[i]; + if (!(pp instanceof AST && pp.type === '!')) { + return false; + } + } + return true; + } + isEnd() { + if (this.#root === this) + return true; + if (this.#parent?.type === '!') + return true; + if (!this.#parent?.isEnd()) + return false; + if (!this.type) + return this.#parent?.isEnd(); + // if not root, it'll always have a parent + /* c8 ignore start */ + const pl = this.#parent ? this.#parent.#parts.length : 0; + /* c8 ignore stop */ + return this.#parentIndex === pl - 1; + } + copyIn(part) { + if (typeof part === 'string') + this.push(part); + else + this.push(part.clone(this)); + } + clone(parent) { + const c = new AST(this.type, parent); + for (const p of this.#parts) { + c.copyIn(p); + } + return c; + } + static #parseAST(str, ast, pos, opt) { + let escaping = false; + let inBrace = false; + let braceStart = -1; + let braceNeg = false; + if (ast.type === null) { + // outside of a extglob, append until we find a start + let i = pos; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (!opt.noext && isExtglobType(c) && str.charAt(i) === '(') { + ast.push(acc); + acc = ''; + const ext = new AST(c, ast); + i = AST.#parseAST(str, ext, i, opt); + ast.push(ext); + continue; + } + acc += c; + } + ast.push(acc); + return i; + } + // some kind of extglob, pos is at the ( + // find the next | or ) + let i = pos + 1; + let part = new AST(null, ast); + const parts = []; + let acc = ''; + while (i < str.length) { + const c = str.charAt(i++); + // still accumulate escapes at this point, but we do ignore + // starts that are escaped + if (escaping || c === '\\') { + escaping = !escaping; + acc += c; + continue; + } + if (inBrace) { + if (i === braceStart + 1) { + if (c === '^' || c === '!') { + braceNeg = true; + } + } + else if (c === ']' && !(i === braceStart + 2 && braceNeg)) { + inBrace = false; + } + acc += c; + continue; + } + else if (c === '[') { + inBrace = true; + braceStart = i; + braceNeg = false; + acc += c; + continue; + } + if (isExtglobType(c) && str.charAt(i) === '(') { + part.push(acc); + acc = ''; + const ext = new AST(c, part); + part.push(ext); + i = AST.#parseAST(str, ext, i, opt); + continue; + } + if (c === '|') { + part.push(acc); + acc = ''; + parts.push(part); + part = new AST(null, ast); + continue; + } + if (c === ')') { + if (acc === '' && ast.#parts.length === 0) { + ast.#emptyExt = true; + } + part.push(acc); + acc = ''; + ast.push(...parts, part); + return i; + } + acc += c; + } + // unfinished extglob + // if we got here, it was a malformed extglob! not an extglob, but + // maybe something else in there. + ast.type = null; + ast.#hasMagic = undefined; + ast.#parts = [str.substring(pos - 1)]; + return i; + } + static fromGlob(pattern, options = {}) { + const ast = new AST(null, undefined, options); + AST.#parseAST(pattern, ast, 0, options); + return ast; + } + // returns the regular expression if there's magic, or the unescaped + // string if not. + toMMPattern() { + // should only be called on root + /* c8 ignore start */ + if (this !== this.#root) + return this.#root.toMMPattern(); + /* c8 ignore stop */ + const glob = this.toString(); + const [re, body, hasMagic, uflag] = this.toRegExpSource(); + // if we're in nocase mode, and not nocaseMagicOnly, then we do + // still need a regular expression if we have to case-insensitively + // match capital/lowercase characters. + const anyMagic = hasMagic || + this.#hasMagic || + (this.#options.nocase && + !this.#options.nocaseMagicOnly && + glob.toUpperCase() !== glob.toLowerCase()); + if (!anyMagic) { + return body; + } + const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : ''); + return Object.assign(new RegExp(`^${re}$`, flags), { + _src: re, + _glob: glob, + }); + } + get options() { + return this.#options; + } + // returns the string match, the regexp source, whether there's magic + // in the regexp (so a regular expression is required) and whether or + // not the uflag is needed for the regular expression (for posix classes) + // TODO: instead of injecting the start/end at this point, just return + // the BODY of the regexp, along with the start/end portions suitable + // for binding the start/end in either a joined full-path makeRe context + // (where we bind to (^|/), or a standalone matchPart context (where + // we bind to ^, and not /). Otherwise slashes get duped! + // + // In part-matching mode, the start is: + // - if not isStart: nothing + // - if traversal possible, but not allowed: ^(?!\.\.?$) + // - if dots allowed or not possible: ^ + // - if dots possible and not allowed: ^(?!\.) + // end is: + // - if not isEnd(): nothing + // - else: $ + // + // In full-path matching mode, we put the slash at the START of the + // pattern, so start is: + // - if first pattern: same as part-matching mode + // - if not isStart(): nothing + // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/)) + // - if dots allowed or not possible: / + // - if dots possible and not allowed: /(?!\.) + // end is: + // - if last pattern, same as part-matching mode + // - else nothing + // + // Always put the (?:$|/) on negated tails, though, because that has to be + // there to bind the end of the negated pattern portion, and it's easier to + // just stick it in now rather than try to inject it later in the middle of + // the pattern. + // + // We can just always return the same end, and leave it up to the caller + // to know whether it's going to be used joined or in parts. + // And, if the start is adjusted slightly, can do the same there: + // - if not isStart: nothing + // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$) + // - if dots allowed or not possible: (?:/|^) + // - if dots possible and not allowed: (?:/|^)(?!\.) + // + // But it's better to have a simpler binding without a conditional, for + // performance, so probably better to return both start options. + // + // Then the caller just ignores the end if it's not the first pattern, + // and the start always gets applied. + // + // But that's always going to be $ if it's the ending pattern, or nothing, + // so the caller can just attach $ at the end of the pattern when building. + // + // So the todo is: + // - better detect what kind of start is needed + // - return both flavors of starting pattern + // - attach $ at the end of the pattern when creating the actual RegExp + // + // Ah, but wait, no, that all only applies to the root when the first pattern + // is not an extglob. If the first pattern IS an extglob, then we need all + // that dot prevention biz to live in the extglob portions, because eg + // +(*|.x*) can match .xy but not .yx. + // + // So, return the two flavors if it's #root and the first child is not an + // AST, otherwise leave it to the child AST to handle it, and there, + // use the (?:^|/) style of start binding. + // + // Even simplified further: + // - Since the start for a join is eg /(?!\.) and the start for a part + // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root + // or start or whatever) and prepend ^ or / at the Regexp construction. + toRegExpSource(allowDot) { + const dot = allowDot ?? !!this.#options.dot; + if (this.#root === this) + this.#fillNegs(); + if (!this.type) { + const noEmpty = this.isStart() && this.isEnd(); + const src = this.#parts + .map(p => { + const [re, _, hasMagic, uflag] = typeof p === 'string' + ? AST.#parseGlob(p, this.#hasMagic, noEmpty) + : p.toRegExpSource(allowDot); + this.#hasMagic = this.#hasMagic || hasMagic; + this.#uflag = this.#uflag || uflag; + return re; + }) + .join(''); + let start = ''; + if (this.isStart()) { + if (typeof this.#parts[0] === 'string') { + // this is the string that will match the start of the pattern, + // so we need to protect against dots and such. + // '.' and '..' cannot match unless the pattern is that exactly, + // even if it starts with . or dot:true is set. + const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]); + if (!dotTravAllowed) { + const aps = addPatternStart; + // check if we have a possibility of matching . or .., + // and prevent that. + const needNoTrav = + // dots are allowed, and the pattern starts with [ or . + (dot && aps.has(src.charAt(0))) || + // the pattern starts with \., and then [ or . + (src.startsWith('\\.') && aps.has(src.charAt(2))) || + // the pattern starts with \.\., and then [ or . + (src.startsWith('\\.\\.') && aps.has(src.charAt(4))); + // no need to prevent dots if it can't match a dot, or if a + // sub-pattern will be preventing it anyway. + const needNoDot = !dot && !allowDot && aps.has(src.charAt(0)); + start = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : ''; + } + } + } + // append the "end of path portion" pattern to negation tails + let end = ''; + if (this.isEnd() && + this.#root.#filledNegs && + this.#parent?.type === '!') { + end = '(?:$|\\/)'; + } + const final = start + src + end; + return [ + final, + unescape$1(src), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + // We need to calculate the body *twice* if it's a repeat pattern + // at the start, once in nodot mode, then again in dot mode, so a + // pattern like *(?) can match 'x.y' + const repeated = this.type === '*' || this.type === '+'; + // some kind of extglob + const start = this.type === '!' ? '(?:(?!(?:' : '(?:'; + let body = this.#partsToRegExp(dot); + if (this.isStart() && this.isEnd() && !body && this.type !== '!') { + // invalid extglob, has to at least be *something* present, if it's + // the entire path portion. + const s = this.toString(); + this.#parts = [s]; + this.type = null; + this.#hasMagic = undefined; + return [s, unescape$1(this.toString()), false, false]; + } + // XXX abstract out this map method + let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot + ? '' + : this.#partsToRegExp(true); + if (bodyDotAllowed === body) { + bodyDotAllowed = ''; + } + if (bodyDotAllowed) { + body = `(?:${body})(?:${bodyDotAllowed})*?`; + } + // an empty !() is exactly equivalent to a starNoEmpty + let final = ''; + if (this.type === '!' && this.#emptyExt) { + final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty; + } + else { + const close = this.type === '!' + ? // !() must match something,but !(x) can match '' + '))' + + (this.isStart() && !dot && !allowDot ? startNoDot : '') + + star$1 + + ')' + : this.type === '@' + ? ')' + : this.type === '?' + ? ')?' + : this.type === '+' && bodyDotAllowed + ? ')' + : this.type === '*' && bodyDotAllowed + ? `)?` + : `)${this.type}`; + final = start + body + close; + } + return [ + final, + unescape$1(body), + (this.#hasMagic = !!this.#hasMagic), + this.#uflag, + ]; + } + #partsToRegExp(dot) { + return this.#parts + .map(p => { + // extglob ASTs should only contain parent ASTs + /* c8 ignore start */ + if (typeof p === 'string') { + throw new Error('string type in extglob ast??'); + } + /* c8 ignore stop */ + // can ignore hasMagic, because extglobs are already always magic + const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot); + this.#uflag = this.#uflag || uflag; + return re; + }) + .filter(p => !(this.isStart() && this.isEnd()) || !!p) + .join('|'); + } + static #parseGlob(glob, hasMagic, noEmpty = false) { + let escaping = false; + let re = ''; + let uflag = false; + for (let i = 0; i < glob.length; i++) { + const c = glob.charAt(i); + if (escaping) { + escaping = false; + re += (reSpecials.has(c) ? '\\' : '') + c; + continue; + } + if (c === '\\') { + if (i === glob.length - 1) { + re += '\\\\'; + } + else { + escaping = true; + } + continue; + } + if (c === '[') { + const [src, needUflag, consumed, magic] = parseClass(glob, i); + if (consumed) { + re += src; + uflag = uflag || needUflag; + i += consumed - 1; + hasMagic = hasMagic || magic; + continue; + } + } + if (c === '*') { + if (noEmpty && glob === '*') + re += starNoEmpty; + else + re += star$1; + hasMagic = true; + continue; + } + if (c === '?') { + re += qmark$1; + hasMagic = true; + continue; + } + re += regExpEscape$1(c); + } + return [re, unescape$1(glob), !!hasMagic, uflag]; + } +} + +/** + * Escape all magic characters in a glob pattern. + * + * If the {@link windowsPathsNoEscape | GlobOptions.windowsPathsNoEscape} + * option is used, then characters are escaped by wrapping in `[]`, because + * a magic character wrapped in a character class can only be satisfied by + * that exact character. In this mode, `\` is _not_ escaped, because it is + * not interpreted as a magic character, but instead as a path separator. + */ +const escape$2 = (s, { windowsPathsNoEscape = false, } = {}) => { + // don't need to escape +@! because we escape the parens + // that make those magic, and escaping ! as [!] isn't valid, + // because [!]] is a valid glob class meaning not ']'. + return windowsPathsNoEscape + ? s.replace(/[?*()[\]]/g, '[$&]') + : s.replace(/[?*()[\]\\]/g, '\\$&'); +}; + +const minimatch = (p, pattern, options = {}) => { + assertValidPattern(pattern); + // shortcut: comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + return false; + } + return new Minimatch(pattern, options).match(p); +}; +// Optimized checking for the most common glob patterns. +const starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/; +const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext); +const starDotExtTestDot = (ext) => (f) => f.endsWith(ext); +const starDotExtTestNocase = (ext) => { + ext = ext.toLowerCase(); + return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext); +}; +const starDotExtTestNocaseDot = (ext) => { + ext = ext.toLowerCase(); + return (f) => f.toLowerCase().endsWith(ext); +}; +const starDotStarRE = /^\*+\.\*+$/; +const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.'); +const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.'); +const dotStarRE = /^\.\*+$/; +const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.'); +const starRE = /^\*+$/; +const starTest = (f) => f.length !== 0 && !f.startsWith('.'); +const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..'; +const qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/; +const qmarksTestNocase = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestNocaseDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + if (!ext) + return noext; + ext = ext.toLowerCase(); + return (f) => noext(f) && f.toLowerCase().endsWith(ext); +}; +const qmarksTestDot = ([$0, ext = '']) => { + const noext = qmarksTestNoExtDot([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTest = ([$0, ext = '']) => { + const noext = qmarksTestNoExt([$0]); + return !ext ? noext : (f) => noext(f) && f.endsWith(ext); +}; +const qmarksTestNoExt = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && !f.startsWith('.'); +}; +const qmarksTestNoExtDot = ([$0]) => { + const len = $0.length; + return (f) => f.length === len && f !== '.' && f !== '..'; +}; +/* c8 ignore start */ +const defaultPlatform$2 = (typeof process === 'object' && process + ? (typeof process.env === 'object' && + process.env && + process.env.__MINIMATCH_TESTING_PLATFORM__) || + process.platform + : 'posix'); +const path$j = { + win32: { sep: '\\' }, + posix: { sep: '/' }, +}; +/* c8 ignore stop */ +const sep = defaultPlatform$2 === 'win32' ? path$j.win32.sep : path$j.posix.sep; +minimatch.sep = sep; +const GLOBSTAR$2 = Symbol('globstar **'); +minimatch.GLOBSTAR = GLOBSTAR$2; +// any single thing other than / +// don't need to escape / when using new RegExp() +const qmark = '[^/]'; +// * => any number of characters +const star = qmark + '*?'; +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?'; +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?'; +const filter$1 = (pattern, options = {}) => (p) => minimatch(p, pattern, options); +minimatch.filter = filter$1; +const ext = (a, b = {}) => Object.assign({}, a, b); +const defaults = (def) => { + if (!def || typeof def !== 'object' || !Object.keys(def).length) { + return minimatch; + } + const orig = minimatch; + const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options)); + return Object.assign(m, { + Minimatch: class Minimatch extends orig.Minimatch { + constructor(pattern, options = {}) { + super(pattern, ext(def, options)); + } + static defaults(options) { + return orig.defaults(ext(def, options)).Minimatch; + } + }, + AST: class AST extends orig.AST { + /* c8 ignore start */ + constructor(type, parent, options = {}) { + super(type, parent, ext(def, options)); + } + /* c8 ignore stop */ + static fromGlob(pattern, options = {}) { + return orig.AST.fromGlob(pattern, ext(def, options)); + } + }, + unescape: (s, options = {}) => orig.unescape(s, ext(def, options)), + escape: (s, options = {}) => orig.escape(s, ext(def, options)), + filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)), + defaults: (options) => orig.defaults(ext(def, options)), + makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)), + braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)), + match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)), + sep: orig.sep, + GLOBSTAR: GLOBSTAR$2, + }); +}; +minimatch.defaults = defaults; +// Brace expansion: +// a{b,c}d -> abd acd +// a{b,}c -> abc ac +// a{0..3}d -> a0d a1d a2d a3d +// a{b,c{d,e}f}g -> abg acdfg acefg +// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg +// +// Invalid sets are not expanded. +// a{2..}b -> a{2..}b +// a{b}c -> a{b}c +const braceExpand = (pattern, options = {}) => { + assertValidPattern(pattern); + // Thanks to Yeting Li for + // improving this regexp to avoid a ReDOS vulnerability. + if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) { + // shortcut. no need to expand. + return [pattern]; + } + return expand$4(pattern); +}; +minimatch.braceExpand = braceExpand; +// parse a component of the expanded set. +// At this point, no pattern may contain "/" in it +// so we're going to return a 2d array, where each entry is the full +// pattern, split on '/', and then turned into a regular expression. +// A regexp is made at the end which joins each array with an +// escaped /, and another full one which joins each regexp with |. +// +// Following the lead of Bash 4.1, note that "**" only has special meaning +// when it is the *only* thing in a path portion. Otherwise, any series +// of * is equivalent to a single *. Globstar behavior is enabled by +// default, and can be disabled by setting options.noglobstar. +const makeRe$1 = (pattern, options = {}) => new Minimatch(pattern, options).makeRe(); +minimatch.makeRe = makeRe$1; +const match = (list, pattern, options = {}) => { + const mm = new Minimatch(pattern, options); + list = list.filter(f => mm.match(f)); + if (mm.options.nonull && !list.length) { + list.push(pattern); + } + return list; +}; +minimatch.match = match; +// replace stuff like \* with * +const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/; +const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); +class Minimatch { + options; + set; + pattern; + windowsPathsNoEscape; + nonegate; + negate; + comment; + empty; + preserveMultipleSlashes; + partial; + globSet; + globParts; + nocase; + isWindows; + platform; + windowsNoMagicRoot; + regexp; + constructor(pattern, options = {}) { + assertValidPattern(pattern); + options = options || {}; + this.options = options; + this.pattern = pattern; + this.platform = options.platform || defaultPlatform$2; + this.isWindows = this.platform === 'win32'; + this.windowsPathsNoEscape = + !!options.windowsPathsNoEscape || options.allowWindowsEscape === false; + if (this.windowsPathsNoEscape) { + this.pattern = this.pattern.replace(/\\/g, '/'); + } + this.preserveMultipleSlashes = !!options.preserveMultipleSlashes; + this.regexp = null; + this.negate = false; + this.nonegate = !!options.nonegate; + this.comment = false; + this.empty = false; + this.partial = !!options.partial; + this.nocase = !!this.options.nocase; + this.windowsNoMagicRoot = + options.windowsNoMagicRoot !== undefined + ? options.windowsNoMagicRoot + : !!(this.isWindows && this.nocase); + this.globSet = []; + this.globParts = []; + this.set = []; + // make the set of regexps etc. + this.make(); + } + hasMagic() { + if (this.options.magicalBraces && this.set.length > 1) { + return true; + } + for (const pattern of this.set) { + for (const part of pattern) { + if (typeof part !== 'string') + return true; + } + } + return false; + } + debug(..._) { } + make() { + const pattern = this.pattern; + const options = this.options; + // empty patterns and comments match nothing. + if (!options.nocomment && pattern.charAt(0) === '#') { + this.comment = true; + return; + } + if (!pattern) { + this.empty = true; + return; + } + // step 1: figure out negation, etc. + this.parseNegate(); + // step 2: expand braces + this.globSet = [...new Set(this.braceExpand())]; + if (options.debug) { + this.debug = (...args) => console.error(...args); + } + this.debug(this.pattern, this.globSet); + // step 3: now we have a set, so turn each one into a series of + // path-portion matching patterns. + // These will be regexps, except in the case of "**", which is + // set to the GLOBSTAR object for globstar behavior, + // and will not contain any / characters + // + // First, we preprocess to make the glob pattern sets a bit simpler + // and deduped. There are some perf-killing patterns that can cause + // problems with a glob walk, but we can simplify them down a bit. + const rawGlobParts = this.globSet.map(s => this.slashSplit(s)); + this.globParts = this.preprocess(rawGlobParts); + this.debug(this.pattern, this.globParts); + // glob --> regexps + let set = this.globParts.map((s, _, __) => { + if (this.isWindows && this.windowsNoMagicRoot) { + // check if it's a drive or unc path. + const isUNC = s[0] === '' && + s[1] === '' && + (s[2] === '?' || !globMagic.test(s[2])) && + !globMagic.test(s[3]); + const isDrive = /^[a-z]:/i.test(s[0]); + if (isUNC) { + return [...s.slice(0, 4), ...s.slice(4).map(ss => this.parse(ss))]; + } + else if (isDrive) { + return [s[0], ...s.slice(1).map(ss => this.parse(ss))]; + } + } + return s.map(ss => this.parse(ss)); + }); + this.debug(this.pattern, set); + // filter out everything that didn't compile properly. + this.set = set.filter(s => s.indexOf(false) === -1); + // do not treat the ? in UNC paths as magic + if (this.isWindows) { + for (let i = 0; i < this.set.length; i++) { + const p = this.set[i]; + if (p[0] === '' && + p[1] === '' && + this.globParts[i][2] === '?' && + typeof p[3] === 'string' && + /^[a-z]:$/i.test(p[3])) { + p[2] = '?'; + } + } + } + this.debug(this.pattern, this.set); + } + // various transforms to equivalent pattern sets that are + // faster to process in a filesystem walk. The goal is to + // eliminate what we can, and push all ** patterns as far + // to the right as possible, even if it increases the number + // of patterns that we have to process. + preprocess(globParts) { + // if we're not in globstar mode, then turn all ** into * + if (this.options.noglobstar) { + for (let i = 0; i < globParts.length; i++) { + for (let j = 0; j < globParts[i].length; j++) { + if (globParts[i][j] === '**') { + globParts[i][j] = '*'; + } + } + } + } + const { optimizationLevel = 1 } = this.options; + if (optimizationLevel >= 2) { + // aggressive optimization for the purpose of fs walking + globParts = this.firstPhasePreProcess(globParts); + globParts = this.secondPhasePreProcess(globParts); + } + else if (optimizationLevel >= 1) { + // just basic optimizations to remove some .. parts + globParts = this.levelOneOptimize(globParts); + } + else { + // just collapse multiple ** portions into one + globParts = this.adjascentGlobstarOptimize(globParts); + } + return globParts; + } + // just get rid of adjascent ** portions + adjascentGlobstarOptimize(globParts) { + return globParts.map(parts => { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let i = gs; + while (parts[i + 1] === '**') { + i++; + } + if (i !== gs) { + parts.splice(gs, i - gs); + } + } + return parts; + }); + } + // get rid of adjascent ** and resolve .. portions + levelOneOptimize(globParts) { + return globParts.map(parts => { + parts = parts.reduce((set, part) => { + const prev = set[set.length - 1]; + if (part === '**' && prev === '**') { + return set; + } + if (part === '..') { + if (prev && prev !== '..' && prev !== '.' && prev !== '**') { + set.pop(); + return set; + } + } + set.push(part); + return set; + }, []); + return parts.length === 0 ? [''] : parts; + }); + } + levelTwoFileOptimize(parts) { + if (!Array.isArray(parts)) { + parts = this.slashSplit(parts); + } + let didSomething = false; + do { + didSomething = false; + //
// -> 
/
+            if (!this.preserveMultipleSlashes) {
+                for (let i = 1; i < parts.length - 1; i++) {
+                    const p = parts[i];
+                    // don't squeeze out UNC patterns
+                    if (i === 1 && p === '' && parts[0] === '')
+                        continue;
+                    if (p === '.' || p === '') {
+                        didSomething = true;
+                        parts.splice(i, 1);
+                        i--;
+                    }
+                }
+                if (parts[0] === '.' &&
+                    parts.length === 2 &&
+                    (parts[1] === '.' || parts[1] === '')) {
+                    didSomething = true;
+                    parts.pop();
+                }
+            }
+            // 
/

/../ ->

/
+            let dd = 0;
+            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                const p = parts[dd - 1];
+                if (p && p !== '.' && p !== '..' && p !== '**') {
+                    didSomething = true;
+                    parts.splice(dd - 1, 2);
+                    dd -= 2;
+                }
+            }
+        } while (didSomething);
+        return parts.length === 0 ? [''] : parts;
+    }
+    // First phase: single-pattern processing
+    // 
 is 1 or more portions
+    //  is 1 or more portions
+    // 

is any portion other than ., .., '', or ** + // is . or '' + // + // **/.. is *brutal* for filesystem walking performance, because + // it effectively resets the recursive walk each time it occurs, + // and ** cannot be reduced out by a .. pattern part like a regexp + // or most strings (other than .., ., and '') can be. + // + //

/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + //

// -> 
/
+    // 
/

/../ ->

/
+    // **/**/ -> **/
+    //
+    // **/*/ -> */**/ <== not valid because ** doesn't follow
+    // this WOULD be allowed if ** did follow symlinks, or * didn't
+    firstPhasePreProcess(globParts) {
+        let didSomething = false;
+        do {
+            didSomething = false;
+            // 
/**/../

/

/ -> {

/../

/

/,

/**/

/

/} + for (let parts of globParts) { + let gs = -1; + while (-1 !== (gs = parts.indexOf('**', gs + 1))) { + let gss = gs; + while (parts[gss + 1] === '**') { + //

/**/**/ -> 
/**/
+                        gss++;
+                    }
+                    // eg, if gs is 2 and gss is 4, that means we have 3 **
+                    // parts, and can remove 2 of them.
+                    if (gss > gs) {
+                        parts.splice(gs + 1, gss - gs);
+                    }
+                    let next = parts[gs + 1];
+                    const p = parts[gs + 2];
+                    const p2 = parts[gs + 3];
+                    if (next !== '..')
+                        continue;
+                    if (!p ||
+                        p === '.' ||
+                        p === '..' ||
+                        !p2 ||
+                        p2 === '.' ||
+                        p2 === '..') {
+                        continue;
+                    }
+                    didSomething = true;
+                    // edit parts in place, and push the new one
+                    parts.splice(gs, 1);
+                    const other = parts.slice(0);
+                    other[gs] = '**';
+                    globParts.push(other);
+                    gs--;
+                }
+                // 
// -> 
/
+                if (!this.preserveMultipleSlashes) {
+                    for (let i = 1; i < parts.length - 1; i++) {
+                        const p = parts[i];
+                        // don't squeeze out UNC patterns
+                        if (i === 1 && p === '' && parts[0] === '')
+                            continue;
+                        if (p === '.' || p === '') {
+                            didSomething = true;
+                            parts.splice(i, 1);
+                            i--;
+                        }
+                    }
+                    if (parts[0] === '.' &&
+                        parts.length === 2 &&
+                        (parts[1] === '.' || parts[1] === '')) {
+                        didSomething = true;
+                        parts.pop();
+                    }
+                }
+                // 
/

/../ ->

/
+                let dd = 0;
+                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
+                    const p = parts[dd - 1];
+                    if (p && p !== '.' && p !== '..' && p !== '**') {
+                        didSomething = true;
+                        const needDot = dd === 1 && parts[dd + 1] === '**';
+                        const splin = needDot ? ['.'] : [];
+                        parts.splice(dd - 1, 2, ...splin);
+                        if (parts.length === 0)
+                            parts.push('');
+                        dd -= 2;
+                    }
+                }
+            }
+        } while (didSomething);
+        return globParts;
+    }
+    // second phase: multi-pattern dedupes
+    // {
/*/,
/

/} ->

/*/
+    // {
/,
/} -> 
/
+    // {
/**/,
/} -> 
/**/
+    //
+    // {
/**/,
/**/

/} ->

/**/
+    // ^-- not valid because ** doens't follow symlinks
+    secondPhasePreProcess(globParts) {
+        for (let i = 0; i < globParts.length - 1; i++) {
+            for (let j = i + 1; j < globParts.length; j++) {
+                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
+                if (matched) {
+                    globParts[i] = [];
+                    globParts[j] = matched;
+                    break;
+                }
+            }
+        }
+        return globParts.filter(gs => gs.length);
+    }
+    partsMatch(a, b, emptyGSMatch = false) {
+        let ai = 0;
+        let bi = 0;
+        let result = [];
+        let which = '';
+        while (ai < a.length && bi < b.length) {
+            if (a[ai] === b[bi]) {
+                result.push(which === 'b' ? b[bi] : a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
+                result.push(a[ai]);
+                ai++;
+            }
+            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
+                result.push(b[bi]);
+                bi++;
+            }
+            else if (a[ai] === '*' &&
+                b[bi] &&
+                (this.options.dot || !b[bi].startsWith('.')) &&
+                b[bi] !== '**') {
+                if (which === 'b')
+                    return false;
+                which = 'a';
+                result.push(a[ai]);
+                ai++;
+                bi++;
+            }
+            else if (b[bi] === '*' &&
+                a[ai] &&
+                (this.options.dot || !a[ai].startsWith('.')) &&
+                a[ai] !== '**') {
+                if (which === 'a')
+                    return false;
+                which = 'b';
+                result.push(b[bi]);
+                ai++;
+                bi++;
+            }
+            else {
+                return false;
+            }
+        }
+        // if we fall out of the loop, it means they two are identical
+        // as long as their lengths match
+        return a.length === b.length && result;
+    }
+    parseNegate() {
+        if (this.nonegate)
+            return;
+        const pattern = this.pattern;
+        let negate = false;
+        let negateOffset = 0;
+        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
+            negate = !negate;
+            negateOffset++;
+        }
+        if (negateOffset)
+            this.pattern = pattern.slice(negateOffset);
+        this.negate = negate;
+    }
+    // set partial to true to test if, for example,
+    // "/a/b" matches the start of "/*/b/*/d"
+    // Partial means, if you run out of file before you run
+    // out of pattern, then that's fine, as long as all
+    // the parts match.
+    matchOne(file, pattern, partial = false) {
+        const options = this.options;
+        // UNC paths like //?/X:/... can match X:/... and vice versa
+        // Drive letters in absolute drive or unc paths are always compared
+        // case-insensitively.
+        if (this.isWindows) {
+            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
+            const fileUNC = !fileDrive &&
+                file[0] === '' &&
+                file[1] === '' &&
+                file[2] === '?' &&
+                /^[a-z]:$/i.test(file[3]);
+            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
+            const patternUNC = !patternDrive &&
+                pattern[0] === '' &&
+                pattern[1] === '' &&
+                pattern[2] === '?' &&
+                typeof pattern[3] === 'string' &&
+                /^[a-z]:$/i.test(pattern[3]);
+            const fdi = fileUNC ? 3 : fileDrive ? 0 : undefined;
+            const pdi = patternUNC ? 3 : patternDrive ? 0 : undefined;
+            if (typeof fdi === 'number' && typeof pdi === 'number') {
+                const [fd, pd] = [file[fdi], pattern[pdi]];
+                if (fd.toLowerCase() === pd.toLowerCase()) {
+                    pattern[pdi] = fd;
+                    if (pdi > fdi) {
+                        pattern = pattern.slice(pdi);
+                    }
+                    else if (fdi > pdi) {
+                        file = file.slice(fdi);
+                    }
+                }
+            }
+        }
+        // resolve and reduce . and .. portions in the file as well.
+        // dont' need to do the second phase, because it's only one string[]
+        const { optimizationLevel = 1 } = this.options;
+        if (optimizationLevel >= 2) {
+            file = this.levelTwoFileOptimize(file);
+        }
+        this.debug('matchOne', this, { file, pattern });
+        this.debug('matchOne', file.length, pattern.length);
+        for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
+            this.debug('matchOne loop');
+            var p = pattern[pi];
+            var f = file[fi];
+            this.debug(pattern, p, f);
+            // should be impossible.
+            // some invalid regexp stuff in the set.
+            /* c8 ignore start */
+            if (p === false) {
+                return false;
+            }
+            /* c8 ignore stop */
+            if (p === GLOBSTAR$2) {
+                this.debug('GLOBSTAR', [pattern, p, f]);
+                // "**"
+                // a/**/b/**/c would match the following:
+                // a/b/x/y/z/c
+                // a/x/y/z/b/c
+                // a/b/x/b/x/c
+                // a/b/c
+                // To do this, take the rest of the pattern after
+                // the **, and see if it would match the file remainder.
+                // If so, return success.
+                // If not, the ** "swallows" a segment, and try again.
+                // This is recursively awful.
+                //
+                // a/**/b/**/c matching a/b/x/y/z/c
+                // - a matches a
+                // - doublestar
+                //   - matchOne(b/x/y/z/c, b/**/c)
+                //     - b matches b
+                //     - doublestar
+                //       - matchOne(x/y/z/c, c) -> no
+                //       - matchOne(y/z/c, c) -> no
+                //       - matchOne(z/c, c) -> no
+                //       - matchOne(c, c) yes, hit
+                var fr = fi;
+                var pr = pi + 1;
+                if (pr === pl) {
+                    this.debug('** at the end');
+                    // a ** at the end will just swallow the rest.
+                    // We have found a match.
+                    // however, it will not swallow /.x, unless
+                    // options.dot is set.
+                    // . and .. are *never* matched by **, for explosively
+                    // exponential reasons.
+                    for (; fi < fl; fi++) {
+                        if (file[fi] === '.' ||
+                            file[fi] === '..' ||
+                            (!options.dot && file[fi].charAt(0) === '.'))
+                            return false;
+                    }
+                    return true;
+                }
+                // ok, let's see if we can swallow whatever we can.
+                while (fr < fl) {
+                    var swallowee = file[fr];
+                    this.debug('\nglobstar while', file, fr, pattern, pr, swallowee);
+                    // XXX remove this slice.  Just pass the start index.
+                    if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
+                        this.debug('globstar found match!', fr, fl, swallowee);
+                        // found a match.
+                        return true;
+                    }
+                    else {
+                        // can't swallow "." or ".." ever.
+                        // can only swallow ".foo" when explicitly asked.
+                        if (swallowee === '.' ||
+                            swallowee === '..' ||
+                            (!options.dot && swallowee.charAt(0) === '.')) {
+                            this.debug('dot detected!', file, fr, pattern, pr);
+                            break;
+                        }
+                        // ** swallows a segment, and continue.
+                        this.debug('globstar swallow a segment, and continue');
+                        fr++;
+                    }
+                }
+                // no match was found.
+                // However, in partial mode, we can't say this is necessarily over.
+                /* c8 ignore start */
+                if (partial) {
+                    // ran out of file
+                    this.debug('\n>>> no match, partial?', file, fr, pattern, pr);
+                    if (fr === fl) {
+                        return true;
+                    }
+                }
+                /* c8 ignore stop */
+                return false;
+            }
+            // something other than **
+            // non-magic patterns just have to match exactly
+            // patterns with magic have been turned into regexps.
+            let hit;
+            if (typeof p === 'string') {
+                hit = f === p;
+                this.debug('string match', p, f, hit);
+            }
+            else {
+                hit = p.test(f);
+                this.debug('pattern match', p, f, hit);
+            }
+            if (!hit)
+                return false;
+        }
+        // Note: ending in / means that we'll get a final ""
+        // at the end of the pattern.  This can only match a
+        // corresponding "" at the end of the file.
+        // If the file ends in /, then it can only match a
+        // a pattern that ends in /, unless the pattern just
+        // doesn't have any more for it. But, a/b/ should *not*
+        // match "a/b/*", even though "" matches against the
+        // [^/]*? pattern, except in partial mode, where it might
+        // simply not be reached yet.
+        // However, a/b/ should still satisfy a/*
+        // now either we fell off the end of the pattern, or we're done.
+        if (fi === fl && pi === pl) {
+            // ran out of pattern and filename at the same time.
+            // an exact hit!
+            return true;
+        }
+        else if (fi === fl) {
+            // ran out of file, but still had pattern left.
+            // this is ok if we're doing the match as part of
+            // a glob fs traversal.
+            return partial;
+        }
+        else if (pi === pl) {
+            // ran out of pattern, still have file left.
+            // this is only acceptable if we're on the very last
+            // empty segment of a file with a trailing slash.
+            // a/* should match a/b/
+            return fi === fl - 1 && file[fi] === '';
+            /* c8 ignore start */
+        }
+        else {
+            // should be unreachable.
+            throw new Error('wtf?');
+        }
+        /* c8 ignore stop */
+    }
+    braceExpand() {
+        return braceExpand(this.pattern, this.options);
+    }
+    parse(pattern) {
+        assertValidPattern(pattern);
+        const options = this.options;
+        // shortcuts
+        if (pattern === '**')
+            return GLOBSTAR$2;
+        if (pattern === '')
+            return '';
+        // far and away, the most common glob pattern parts are
+        // *, *.*, and *.  Add a fast check method for those.
+        let m;
+        let fastTest = null;
+        if ((m = pattern.match(starRE))) {
+            fastTest = options.dot ? starTestDot : starTest;
+        }
+        else if ((m = pattern.match(starDotExtRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? starDotExtTestNocaseDot
+                    : starDotExtTestNocase
+                : options.dot
+                    ? starDotExtTestDot
+                    : starDotExtTest)(m[1]);
+        }
+        else if ((m = pattern.match(qmarksRE))) {
+            fastTest = (options.nocase
+                ? options.dot
+                    ? qmarksTestNocaseDot
+                    : qmarksTestNocase
+                : options.dot
+                    ? qmarksTestDot
+                    : qmarksTest)(m);
+        }
+        else if ((m = pattern.match(starDotStarRE))) {
+            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
+        }
+        else if ((m = pattern.match(dotStarRE))) {
+            fastTest = dotStarTest;
+        }
+        const re = AST.fromGlob(pattern, this.options).toMMPattern();
+        if (fastTest && typeof re === 'object') {
+            // Avoids overriding in frozen environments
+            Reflect.defineProperty(re, 'test', { value: fastTest });
+        }
+        return re;
+    }
+    makeRe() {
+        if (this.regexp || this.regexp === false)
+            return this.regexp;
+        // at this point, this.set is a 2d array of partial
+        // pattern strings, or "**".
+        //
+        // It's better to use .match().  This function shouldn't
+        // be used, really, but it's pretty convenient sometimes,
+        // when you just want to work with a regex.
+        const set = this.set;
+        if (!set.length) {
+            this.regexp = false;
+            return this.regexp;
+        }
+        const options = this.options;
+        const twoStar = options.noglobstar
+            ? star
+            : options.dot
+                ? twoStarDot
+                : twoStarNoDot;
+        const flags = new Set(options.nocase ? ['i'] : []);
+        // regexpify non-globstar patterns
+        // if ** is only item, then we just do one twoStar
+        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
+        // if ** is last, append (\/twoStar|) to previous
+        // if ** is in the middle, append (\/|\/twoStar\/) to previous
+        // then filter out GLOBSTAR symbols
+        let re = set
+            .map(pattern => {
+            const pp = pattern.map(p => {
+                if (p instanceof RegExp) {
+                    for (const f of p.flags.split(''))
+                        flags.add(f);
+                }
+                return typeof p === 'string'
+                    ? regExpEscape(p)
+                    : p === GLOBSTAR$2
+                        ? GLOBSTAR$2
+                        : p._src;
+            });
+            pp.forEach((p, i) => {
+                const next = pp[i + 1];
+                const prev = pp[i - 1];
+                if (p !== GLOBSTAR$2 || prev === GLOBSTAR$2) {
+                    return;
+                }
+                if (prev === undefined) {
+                    if (next !== undefined && next !== GLOBSTAR$2) {
+                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
+                    }
+                    else {
+                        pp[i] = twoStar;
+                    }
+                }
+                else if (next === undefined) {
+                    pp[i - 1] = prev + '(?:\\/|' + twoStar + ')?';
+                }
+                else if (next !== GLOBSTAR$2) {
+                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
+                    pp[i + 1] = GLOBSTAR$2;
+                }
+            });
+            return pp.filter(p => p !== GLOBSTAR$2).join('/');
+        })
+            .join('|');
+        // need to wrap in parens if we had more than one thing with |,
+        // otherwise only the first will be anchored to ^ and the last to $
+        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
+        // must match entire pattern
+        // ending in a * or ** will make it less strict.
+        re = '^' + open + re + close + '$';
+        // can match anything, as long as it's not this.
+        if (this.negate)
+            re = '^(?!' + re + ').+$';
+        try {
+            this.regexp = new RegExp(re, [...flags].join(''));
+            /* c8 ignore start */
+        }
+        catch (ex) {
+            // should be impossible
+            this.regexp = false;
+        }
+        /* c8 ignore stop */
+        return this.regexp;
+    }
+    slashSplit(p) {
+        // if p starts with // on windows, we preserve that
+        // so that UNC paths aren't broken.  Otherwise, any number of
+        // / characters are coalesced into one, unless
+        // preserveMultipleSlashes is set to true.
+        if (this.preserveMultipleSlashes) {
+            return p.split('/');
+        }
+        else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
+            // add an extra '' for the one we lose
+            return ['', ...p.split(/\/+/)];
+        }
+        else {
+            return p.split(/\/+/);
+        }
+    }
+    match(f, partial = this.partial) {
+        this.debug('match', f, this.pattern);
+        // short-circuit in the case of busted things.
+        // comments, etc.
+        if (this.comment) {
+            return false;
+        }
+        if (this.empty) {
+            return f === '';
+        }
+        if (f === '/' && partial) {
+            return true;
+        }
+        const options = this.options;
+        // windows: need to use /, not \
+        if (this.isWindows) {
+            f = f.split('\\').join('/');
+        }
+        // treat the test path as a set of pathparts.
+        const ff = this.slashSplit(f);
+        this.debug(this.pattern, 'split', ff);
+        // just ONE of the pattern sets in this.set needs to match
+        // in order for it to be valid.  If negating, then just one
+        // match means that we have failed.
+        // Either way, return on the first hit.
+        const set = this.set;
+        this.debug(this.pattern, 'set', set);
+        // Find the basename of the path by looking for the last non-empty segment
+        let filename = ff[ff.length - 1];
+        if (!filename) {
+            for (let i = ff.length - 2; !filename && i >= 0; i--) {
+                filename = ff[i];
+            }
+        }
+        for (let i = 0; i < set.length; i++) {
+            const pattern = set[i];
+            let file = ff;
+            if (options.matchBase && pattern.length === 1) {
+                file = [filename];
+            }
+            const hit = this.matchOne(file, pattern, partial);
+            if (hit) {
+                if (options.flipNegate) {
+                    return true;
+                }
+                return !this.negate;
+            }
+        }
+        // didn't get any hits.  this is success if it's a negative
+        // pattern, failure otherwise.
+        if (options.flipNegate) {
+            return false;
+        }
+        return this.negate;
+    }
+    static defaults(def) {
+        return minimatch.defaults(def).Minimatch;
+    }
+}
+/* c8 ignore stop */
+minimatch.AST = AST;
+minimatch.Minimatch = Minimatch;
+minimatch.escape = escape$2;
+minimatch.unescape = unescape$1;
+
+/**
+ * @module LRUCache
+ */
+const perf = typeof performance === 'object' &&
+    performance &&
+    typeof performance.now === 'function'
+    ? performance
+    : Date;
+const warned$1 = new Set();
+/* c8 ignore start */
+const PROCESS = (typeof process === 'object' && !!process ? process : {});
+/* c8 ignore start */
+const emitWarning = (msg, type, code, fn) => {
+    typeof PROCESS.emitWarning === 'function'
+        ? PROCESS.emitWarning(msg, type, code, fn)
+        : console.error(`[${code}] ${type}: ${msg}`);
+};
+let AC = globalThis.AbortController;
+let AS = globalThis.AbortSignal;
+/* c8 ignore start */
+if (typeof AC === 'undefined') {
+    //@ts-ignore
+    AS = class AbortSignal {
+        onabort;
+        _onabort = [];
+        reason;
+        aborted = false;
+        addEventListener(_, fn) {
+            this._onabort.push(fn);
+        }
+    };
+    //@ts-ignore
+    AC = class AbortController {
+        constructor() {
+            warnACPolyfill();
+        }
+        signal = new AS();
+        abort(reason) {
+            if (this.signal.aborted)
+                return;
+            //@ts-ignore
+            this.signal.reason = reason;
+            //@ts-ignore
+            this.signal.aborted = true;
+            //@ts-ignore
+            for (const fn of this.signal._onabort) {
+                fn(reason);
+            }
+            this.signal.onabort?.(reason);
+        }
+    };
+    let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== '1';
+    const warnACPolyfill = () => {
+        if (!printACPolyfillWarning)
+            return;
+        printACPolyfillWarning = false;
+        emitWarning('AbortController is not defined. If using lru-cache in ' +
+            'node 14, load an AbortController polyfill from the ' +
+            '`node-abort-controller` package. A minimal polyfill is ' +
+            'provided for use by LRUCache.fetch(), but it should not be ' +
+            'relied upon in other contexts (eg, passing it to other APIs that ' +
+            'use AbortController/AbortSignal might have undesirable effects). ' +
+            'You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.', 'NO_ABORT_CONTROLLER', 'ENOTSUP', warnACPolyfill);
+    };
+}
+/* c8 ignore stop */
+const shouldWarn = (code) => !warned$1.has(code);
+const isPosInt = (n) => n && n === Math.floor(n) && n > 0 && isFinite(n);
+/* c8 ignore start */
+// This is a little bit ridiculous, tbh.
+// The maximum array length is 2^32-1 or thereabouts on most JS impls.
+// And well before that point, you're caching the entire world, I mean,
+// that's ~32GB of just integers for the next/prev links, plus whatever
+// else to hold that many keys and values.  Just filling the memory with
+// zeroes at init time is brutal when you get that big.
+// But why not be complete?
+// Maybe in the future, these limits will have expanded.
+const getUintArray = (max) => !isPosInt(max)
+    ? null
+    : max <= Math.pow(2, 8)
+        ? Uint8Array
+        : max <= Math.pow(2, 16)
+            ? Uint16Array
+            : max <= Math.pow(2, 32)
+                ? Uint32Array
+                : max <= Number.MAX_SAFE_INTEGER
+                    ? ZeroArray
+                    : null;
+/* c8 ignore stop */
+class ZeroArray extends Array {
+    constructor(size) {
+        super(size);
+        this.fill(0);
+    }
+}
+class Stack {
+    heap;
+    length;
+    // private constructor
+    static #constructing = false;
+    static create(max) {
+        const HeapCls = getUintArray(max);
+        if (!HeapCls)
+            return [];
+        Stack.#constructing = true;
+        const s = new Stack(max, HeapCls);
+        Stack.#constructing = false;
+        return s;
+    }
+    constructor(max, HeapCls) {
+        /* c8 ignore start */
+        if (!Stack.#constructing) {
+            throw new TypeError('instantiate Stack using Stack.create(n)');
+        }
+        /* c8 ignore stop */
+        this.heap = new HeapCls(max);
+        this.length = 0;
+    }
+    push(n) {
+        this.heap[this.length++] = n;
+    }
+    pop() {
+        return this.heap[--this.length];
+    }
+}
+/**
+ * Default export, the thing you're using this module to get.
+ *
+ * The `K` and `V` types define the key and value types, respectively. The
+ * optional `FC` type defines the type of the `context` object passed to
+ * `cache.fetch()` and `cache.memo()`.
+ *
+ * Keys and values **must not** be `null` or `undefined`.
+ *
+ * All properties from the options object (with the exception of `max`,
+ * `maxSize`, `fetchMethod`, `memoMethod`, `dispose` and `disposeAfter`) are
+ * added as normal public members. (The listed options are read-only getters.)
+ *
+ * Changing any of these will alter the defaults for subsequent method calls.
+ */
+class LRUCache {
+    // options that cannot be changed without disaster
+    #max;
+    #maxSize;
+    #dispose;
+    #disposeAfter;
+    #fetchMethod;
+    #memoMethod;
+    /**
+     * {@link LRUCache.OptionsBase.ttl}
+     */
+    ttl;
+    /**
+     * {@link LRUCache.OptionsBase.ttlResolution}
+     */
+    ttlResolution;
+    /**
+     * {@link LRUCache.OptionsBase.ttlAutopurge}
+     */
+    ttlAutopurge;
+    /**
+     * {@link LRUCache.OptionsBase.updateAgeOnGet}
+     */
+    updateAgeOnGet;
+    /**
+     * {@link LRUCache.OptionsBase.updateAgeOnHas}
+     */
+    updateAgeOnHas;
+    /**
+     * {@link LRUCache.OptionsBase.allowStale}
+     */
+    allowStale;
+    /**
+     * {@link LRUCache.OptionsBase.noDisposeOnSet}
+     */
+    noDisposeOnSet;
+    /**
+     * {@link LRUCache.OptionsBase.noUpdateTTL}
+     */
+    noUpdateTTL;
+    /**
+     * {@link LRUCache.OptionsBase.maxEntrySize}
+     */
+    maxEntrySize;
+    /**
+     * {@link LRUCache.OptionsBase.sizeCalculation}
+     */
+    sizeCalculation;
+    /**
+     * {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
+     */
+    noDeleteOnFetchRejection;
+    /**
+     * {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
+     */
+    noDeleteOnStaleGet;
+    /**
+     * {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
+     */
+    allowStaleOnFetchAbort;
+    /**
+     * {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
+     */
+    allowStaleOnFetchRejection;
+    /**
+     * {@link LRUCache.OptionsBase.ignoreFetchAbort}
+     */
+    ignoreFetchAbort;
+    // computed properties
+    #size;
+    #calculatedSize;
+    #keyMap;
+    #keyList;
+    #valList;
+    #next;
+    #prev;
+    #head;
+    #tail;
+    #free;
+    #disposed;
+    #sizes;
+    #starts;
+    #ttls;
+    #hasDispose;
+    #hasFetchMethod;
+    #hasDisposeAfter;
+    /**
+     * Do not call this method unless you need to inspect the
+     * inner workings of the cache.  If anything returned by this
+     * object is modified in any way, strange breakage may occur.
+     *
+     * These fields are private for a reason!
+     *
+     * @internal
+     */
+    static unsafeExposeInternals(c) {
+        return {
+            // properties
+            starts: c.#starts,
+            ttls: c.#ttls,
+            sizes: c.#sizes,
+            keyMap: c.#keyMap,
+            keyList: c.#keyList,
+            valList: c.#valList,
+            next: c.#next,
+            prev: c.#prev,
+            get head() {
+                return c.#head;
+            },
+            get tail() {
+                return c.#tail;
+            },
+            free: c.#free,
+            // methods
+            isBackgroundFetch: (p) => c.#isBackgroundFetch(p),
+            backgroundFetch: (k, index, options, context) => c.#backgroundFetch(k, index, options, context),
+            moveToTail: (index) => c.#moveToTail(index),
+            indexes: (options) => c.#indexes(options),
+            rindexes: (options) => c.#rindexes(options),
+            isStale: (index) => c.#isStale(index),
+        };
+    }
+    // Protected read-only members
+    /**
+     * {@link LRUCache.OptionsBase.max} (read-only)
+     */
+    get max() {
+        return this.#max;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.maxSize} (read-only)
+     */
+    get maxSize() {
+        return this.#maxSize;
+    }
+    /**
+     * The total computed size of items in the cache (read-only)
+     */
+    get calculatedSize() {
+        return this.#calculatedSize;
+    }
+    /**
+     * The number of items stored in the cache (read-only)
+     */
+    get size() {
+        return this.#size;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.fetchMethod} (read-only)
+     */
+    get fetchMethod() {
+        return this.#fetchMethod;
+    }
+    get memoMethod() {
+        return this.#memoMethod;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.dispose} (read-only)
+     */
+    get dispose() {
+        return this.#dispose;
+    }
+    /**
+     * {@link LRUCache.OptionsBase.disposeAfter} (read-only)
+     */
+    get disposeAfter() {
+        return this.#disposeAfter;
+    }
+    constructor(options) {
+        const { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort, } = options;
+        if (max !== 0 && !isPosInt(max)) {
+            throw new TypeError('max option must be a nonnegative integer');
+        }
+        const UintArray = max ? getUintArray(max) : Array;
+        if (!UintArray) {
+            throw new Error('invalid max value: ' + max);
+        }
+        this.#max = max;
+        this.#maxSize = maxSize;
+        this.maxEntrySize = maxEntrySize || this.#maxSize;
+        this.sizeCalculation = sizeCalculation;
+        if (this.sizeCalculation) {
+            if (!this.#maxSize && !this.maxEntrySize) {
+                throw new TypeError('cannot set sizeCalculation without setting maxSize or maxEntrySize');
+            }
+            if (typeof this.sizeCalculation !== 'function') {
+                throw new TypeError('sizeCalculation set to non-function');
+            }
+        }
+        if (memoMethod !== undefined &&
+            typeof memoMethod !== 'function') {
+            throw new TypeError('memoMethod must be a function if defined');
+        }
+        this.#memoMethod = memoMethod;
+        if (fetchMethod !== undefined &&
+            typeof fetchMethod !== 'function') {
+            throw new TypeError('fetchMethod must be a function if specified');
+        }
+        this.#fetchMethod = fetchMethod;
+        this.#hasFetchMethod = !!fetchMethod;
+        this.#keyMap = new Map();
+        this.#keyList = new Array(max).fill(undefined);
+        this.#valList = new Array(max).fill(undefined);
+        this.#next = new UintArray(max);
+        this.#prev = new UintArray(max);
+        this.#head = 0;
+        this.#tail = 0;
+        this.#free = Stack.create(max);
+        this.#size = 0;
+        this.#calculatedSize = 0;
+        if (typeof dispose === 'function') {
+            this.#dispose = dispose;
+        }
+        if (typeof disposeAfter === 'function') {
+            this.#disposeAfter = disposeAfter;
+            this.#disposed = [];
+        }
+        else {
+            this.#disposeAfter = undefined;
+            this.#disposed = undefined;
+        }
+        this.#hasDispose = !!this.#dispose;
+        this.#hasDisposeAfter = !!this.#disposeAfter;
+        this.noDisposeOnSet = !!noDisposeOnSet;
+        this.noUpdateTTL = !!noUpdateTTL;
+        this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection;
+        this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection;
+        this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort;
+        this.ignoreFetchAbort = !!ignoreFetchAbort;
+        // NB: maxEntrySize is set to maxSize if it's set
+        if (this.maxEntrySize !== 0) {
+            if (this.#maxSize !== 0) {
+                if (!isPosInt(this.#maxSize)) {
+                    throw new TypeError('maxSize must be a positive integer if specified');
+                }
+            }
+            if (!isPosInt(this.maxEntrySize)) {
+                throw new TypeError('maxEntrySize must be a positive integer if specified');
+            }
+            this.#initializeSizeTracking();
+        }
+        this.allowStale = !!allowStale;
+        this.noDeleteOnStaleGet = !!noDeleteOnStaleGet;
+        this.updateAgeOnGet = !!updateAgeOnGet;
+        this.updateAgeOnHas = !!updateAgeOnHas;
+        this.ttlResolution =
+            isPosInt(ttlResolution) || ttlResolution === 0
+                ? ttlResolution
+                : 1;
+        this.ttlAutopurge = !!ttlAutopurge;
+        this.ttl = ttl || 0;
+        if (this.ttl) {
+            if (!isPosInt(this.ttl)) {
+                throw new TypeError('ttl must be a positive integer if specified');
+            }
+            this.#initializeTTLTracking();
+        }
+        // do not allow completely unbounded caches
+        if (this.#max === 0 && this.ttl === 0 && this.#maxSize === 0) {
+            throw new TypeError('At least one of max, maxSize, or ttl is required');
+        }
+        if (!this.ttlAutopurge && !this.#max && !this.#maxSize) {
+            const code = 'LRU_CACHE_UNBOUNDED';
+            if (shouldWarn(code)) {
+                warned$1.add(code);
+                const msg = 'TTL caching without ttlAutopurge, max, or maxSize can ' +
+                    'result in unbounded memory consumption.';
+                emitWarning(msg, 'UnboundedCacheWarning', code, LRUCache);
+            }
+        }
+    }
+    /**
+     * Return the number of ms left in the item's TTL. If item is not in cache,
+     * returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
+     */
+    getRemainingTTL(key) {
+        return this.#keyMap.has(key) ? Infinity : 0;
+    }
+    #initializeTTLTracking() {
+        const ttls = new ZeroArray(this.#max);
+        const starts = new ZeroArray(this.#max);
+        this.#ttls = ttls;
+        this.#starts = starts;
+        this.#setItemTTL = (index, ttl, start = perf.now()) => {
+            starts[index] = ttl !== 0 ? start : 0;
+            ttls[index] = ttl;
+            if (ttl !== 0 && this.ttlAutopurge) {
+                const t = setTimeout(() => {
+                    if (this.#isStale(index)) {
+                        this.#delete(this.#keyList[index], 'expire');
+                    }
+                }, ttl + 1);
+                // unref() not supported on all platforms
+                /* c8 ignore start */
+                if (t.unref) {
+                    t.unref();
+                }
+                /* c8 ignore stop */
+            }
+        };
+        this.#updateItemAge = index => {
+            starts[index] = ttls[index] !== 0 ? perf.now() : 0;
+        };
+        this.#statusTTL = (status, index) => {
+            if (ttls[index]) {
+                const ttl = ttls[index];
+                const start = starts[index];
+                /* c8 ignore next */
+                if (!ttl || !start)
+                    return;
+                status.ttl = ttl;
+                status.start = start;
+                status.now = cachedNow || getNow();
+                const age = status.now - start;
+                status.remainingTTL = ttl - age;
+            }
+        };
+        // debounce calls to perf.now() to 1s so we're not hitting
+        // that costly call repeatedly.
+        let cachedNow = 0;
+        const getNow = () => {
+            const n = perf.now();
+            if (this.ttlResolution > 0) {
+                cachedNow = n;
+                const t = setTimeout(() => (cachedNow = 0), this.ttlResolution);
+                // not available on all platforms
+                /* c8 ignore start */
+                if (t.unref) {
+                    t.unref();
+                }
+                /* c8 ignore stop */
+            }
+            return n;
+        };
+        this.getRemainingTTL = key => {
+            const index = this.#keyMap.get(key);
+            if (index === undefined) {
+                return 0;
+            }
+            const ttl = ttls[index];
+            const start = starts[index];
+            if (!ttl || !start) {
+                return Infinity;
+            }
+            const age = (cachedNow || getNow()) - start;
+            return ttl - age;
+        };
+        this.#isStale = index => {
+            const s = starts[index];
+            const t = ttls[index];
+            return !!t && !!s && (cachedNow || getNow()) - s > t;
+        };
+    }
+    // conditionally set private methods related to TTL
+    #updateItemAge = () => { };
+    #statusTTL = () => { };
+    #setItemTTL = () => { };
+    /* c8 ignore stop */
+    #isStale = () => false;
+    #initializeSizeTracking() {
+        const sizes = new ZeroArray(this.#max);
+        this.#calculatedSize = 0;
+        this.#sizes = sizes;
+        this.#removeItemSize = index => {
+            this.#calculatedSize -= sizes[index];
+            sizes[index] = 0;
+        };
+        this.#requireSize = (k, v, size, sizeCalculation) => {
+            // provisionally accept background fetches.
+            // actual value size will be checked when they return.
+            if (this.#isBackgroundFetch(v)) {
+                return 0;
+            }
+            if (!isPosInt(size)) {
+                if (sizeCalculation) {
+                    if (typeof sizeCalculation !== 'function') {
+                        throw new TypeError('sizeCalculation must be a function');
+                    }
+                    size = sizeCalculation(v, k);
+                    if (!isPosInt(size)) {
+                        throw new TypeError('sizeCalculation return invalid (expect positive integer)');
+                    }
+                }
+                else {
+                    throw new TypeError('invalid size value (must be positive integer). ' +
+                        'When maxSize or maxEntrySize is used, sizeCalculation ' +
+                        'or size must be set.');
+                }
+            }
+            return size;
+        };
+        this.#addItemSize = (index, size, status) => {
+            sizes[index] = size;
+            if (this.#maxSize) {
+                const maxSize = this.#maxSize - sizes[index];
+                while (this.#calculatedSize > maxSize) {
+                    this.#evict(true);
+                }
+            }
+            this.#calculatedSize += sizes[index];
+            if (status) {
+                status.entrySize = size;
+                status.totalCalculatedSize = this.#calculatedSize;
+            }
+        };
+    }
+    #removeItemSize = _i => { };
+    #addItemSize = (_i, _s, _st) => { };
+    #requireSize = (_k, _v, size, sizeCalculation) => {
+        if (size || sizeCalculation) {
+            throw new TypeError('cannot set size without setting maxSize or maxEntrySize on cache');
+        }
+        return 0;
+    };
+    *#indexes({ allowStale = this.allowStale } = {}) {
+        if (this.#size) {
+            for (let i = this.#tail; true;) {
+                if (!this.#isValidIndex(i)) {
+                    break;
+                }
+                if (allowStale || !this.#isStale(i)) {
+                    yield i;
+                }
+                if (i === this.#head) {
+                    break;
+                }
+                else {
+                    i = this.#prev[i];
+                }
+            }
+        }
+    }
+    *#rindexes({ allowStale = this.allowStale } = {}) {
+        if (this.#size) {
+            for (let i = this.#head; true;) {
+                if (!this.#isValidIndex(i)) {
+                    break;
+                }
+                if (allowStale || !this.#isStale(i)) {
+                    yield i;
+                }
+                if (i === this.#tail) {
+                    break;
+                }
+                else {
+                    i = this.#next[i];
+                }
+            }
+        }
+    }
+    #isValidIndex(index) {
+        return (index !== undefined &&
+            this.#keyMap.get(this.#keyList[index]) === index);
+    }
+    /**
+     * Return a generator yielding `[key, value]` pairs,
+     * in order from most recently used to least recently used.
+     */
+    *entries() {
+        for (const i of this.#indexes()) {
+            if (this.#valList[i] !== undefined &&
+                this.#keyList[i] !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield [this.#keyList[i], this.#valList[i]];
+            }
+        }
+    }
+    /**
+     * Inverse order version of {@link LRUCache.entries}
+     *
+     * Return a generator yielding `[key, value]` pairs,
+     * in order from least recently used to most recently used.
+     */
+    *rentries() {
+        for (const i of this.#rindexes()) {
+            if (this.#valList[i] !== undefined &&
+                this.#keyList[i] !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield [this.#keyList[i], this.#valList[i]];
+            }
+        }
+    }
+    /**
+     * Return a generator yielding the keys in the cache,
+     * in order from most recently used to least recently used.
+     */
+    *keys() {
+        for (const i of this.#indexes()) {
+            const k = this.#keyList[i];
+            if (k !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield k;
+            }
+        }
+    }
+    /**
+     * Inverse order version of {@link LRUCache.keys}
+     *
+     * Return a generator yielding the keys in the cache,
+     * in order from least recently used to most recently used.
+     */
+    *rkeys() {
+        for (const i of this.#rindexes()) {
+            const k = this.#keyList[i];
+            if (k !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield k;
+            }
+        }
+    }
+    /**
+     * Return a generator yielding the values in the cache,
+     * in order from most recently used to least recently used.
+     */
+    *values() {
+        for (const i of this.#indexes()) {
+            const v = this.#valList[i];
+            if (v !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield this.#valList[i];
+            }
+        }
+    }
+    /**
+     * Inverse order version of {@link LRUCache.values}
+     *
+     * Return a generator yielding the values in the cache,
+     * in order from least recently used to most recently used.
+     */
+    *rvalues() {
+        for (const i of this.#rindexes()) {
+            const v = this.#valList[i];
+            if (v !== undefined &&
+                !this.#isBackgroundFetch(this.#valList[i])) {
+                yield this.#valList[i];
+            }
+        }
+    }
+    /**
+     * Iterating over the cache itself yields the same results as
+     * {@link LRUCache.entries}
+     */
+    [Symbol.iterator]() {
+        return this.entries();
+    }
+    /**
+     * A String value that is used in the creation of the default string
+     * description of an object. Called by the built-in method
+     * `Object.prototype.toString`.
+     */
+    [Symbol.toStringTag] = 'LRUCache';
+    /**
+     * Find a value for which the supplied fn method returns a truthy value,
+     * similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
+     */
+    find(fn, getOptions = {}) {
+        for (const i of this.#indexes()) {
+            const v = this.#valList[i];
+            const value = this.#isBackgroundFetch(v)
+                ? v.__staleWhileFetching
+                : v;
+            if (value === undefined)
+                continue;
+            if (fn(value, this.#keyList[i], this)) {
+                return this.get(this.#keyList[i], getOptions);
+            }
+        }
+    }
+    /**
+     * Call the supplied function on each item in the cache, in order from most
+     * recently used to least recently used.
+     *
+     * `fn` is called as `fn(value, key, cache)`.
+     *
+     * If `thisp` is provided, function will be called in the `this`-context of
+     * the provided object, or the cache if no `thisp` object is provided.
+     *
+     * Does not update age or recenty of use, or iterate over stale values.
+     */
+    forEach(fn, thisp = this) {
+        for (const i of this.#indexes()) {
+            const v = this.#valList[i];
+            const value = this.#isBackgroundFetch(v)
+                ? v.__staleWhileFetching
+                : v;
+            if (value === undefined)
+                continue;
+            fn.call(thisp, value, this.#keyList[i], this);
+        }
+    }
+    /**
+     * The same as {@link LRUCache.forEach} but items are iterated over in
+     * reverse order.  (ie, less recently used items are iterated over first.)
+     */
+    rforEach(fn, thisp = this) {
+        for (const i of this.#rindexes()) {
+            const v = this.#valList[i];
+            const value = this.#isBackgroundFetch(v)
+                ? v.__staleWhileFetching
+                : v;
+            if (value === undefined)
+                continue;
+            fn.call(thisp, value, this.#keyList[i], this);
+        }
+    }
+    /**
+     * Delete any stale entries. Returns true if anything was removed,
+     * false otherwise.
+     */
+    purgeStale() {
+        let deleted = false;
+        for (const i of this.#rindexes({ allowStale: true })) {
+            if (this.#isStale(i)) {
+                this.#delete(this.#keyList[i], 'expire');
+                deleted = true;
+            }
+        }
+        return deleted;
+    }
+    /**
+     * Get the extended info about a given entry, to get its value, size, and
+     * TTL info simultaneously. Returns `undefined` if the key is not present.
+     *
+     * Unlike {@link LRUCache#dump}, which is designed to be portable and survive
+     * serialization, the `start` value is always the current timestamp, and the
+     * `ttl` is a calculated remaining time to live (negative if expired).
+     *
+     * Always returns stale values, if their info is found in the cache, so be
+     * sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
+     * if relevant.
+     */
+    info(key) {
+        const i = this.#keyMap.get(key);
+        if (i === undefined)
+            return undefined;
+        const v = this.#valList[i];
+        const value = this.#isBackgroundFetch(v)
+            ? v.__staleWhileFetching
+            : v;
+        if (value === undefined)
+            return undefined;
+        const entry = { value };
+        if (this.#ttls && this.#starts) {
+            const ttl = this.#ttls[i];
+            const start = this.#starts[i];
+            if (ttl && start) {
+                const remain = ttl - (perf.now() - start);
+                entry.ttl = remain;
+                entry.start = Date.now();
+            }
+        }
+        if (this.#sizes) {
+            entry.size = this.#sizes[i];
+        }
+        return entry;
+    }
+    /**
+     * Return an array of [key, {@link LRUCache.Entry}] tuples which can be
+     * passed to {@link LRLUCache#load}.
+     *
+     * The `start` fields are calculated relative to a portable `Date.now()`
+     * timestamp, even if `performance.now()` is available.
+     *
+     * Stale entries are always included in the `dump`, even if
+     * {@link LRUCache.OptionsBase.allowStale} is false.
+     *
+     * Note: this returns an actual array, not a generator, so it can be more
+     * easily passed around.
+     */
+    dump() {
+        const arr = [];
+        for (const i of this.#indexes({ allowStale: true })) {
+            const key = this.#keyList[i];
+            const v = this.#valList[i];
+            const value = this.#isBackgroundFetch(v)
+                ? v.__staleWhileFetching
+                : v;
+            if (value === undefined || key === undefined)
+                continue;
+            const entry = { value };
+            if (this.#ttls && this.#starts) {
+                entry.ttl = this.#ttls[i];
+                // always dump the start relative to a portable timestamp
+                // it's ok for this to be a bit slow, it's a rare operation.
+                const age = perf.now() - this.#starts[i];
+                entry.start = Math.floor(Date.now() - age);
+            }
+            if (this.#sizes) {
+                entry.size = this.#sizes[i];
+            }
+            arr.unshift([key, entry]);
+        }
+        return arr;
+    }
+    /**
+     * Reset the cache and load in the items in entries in the order listed.
+     *
+     * The shape of the resulting cache may be different if the same options are
+     * not used in both caches.
+     *
+     * The `start` fields are assumed to be calculated relative to a portable
+     * `Date.now()` timestamp, even if `performance.now()` is available.
+     */
+    load(arr) {
+        this.clear();
+        for (const [key, entry] of arr) {
+            if (entry.start) {
+                // entry.start is a portable timestamp, but we may be using
+                // node's performance.now(), so calculate the offset, so that
+                // we get the intended remaining TTL, no matter how long it's
+                // been on ice.
+                //
+                // it's ok for this to be a bit slow, it's a rare operation.
+                const age = Date.now() - entry.start;
+                entry.start = perf.now() - age;
+            }
+            this.set(key, entry.value, entry);
+        }
+    }
+    /**
+     * Add a value to the cache.
+     *
+     * Note: if `undefined` is specified as a value, this is an alias for
+     * {@link LRUCache#delete}
+     *
+     * Fields on the {@link LRUCache.SetOptions} options param will override
+     * their corresponding values in the constructor options for the scope
+     * of this single `set()` operation.
+     *
+     * If `start` is provided, then that will set the effective start
+     * time for the TTL calculation. Note that this must be a previous
+     * value of `performance.now()` if supported, or a previous value of
+     * `Date.now()` if not.
+     *
+     * Options object may also include `size`, which will prevent
+     * calling the `sizeCalculation` function and just use the specified
+     * number if it is a positive integer, and `noDisposeOnSet` which
+     * will prevent calling a `dispose` function in the case of
+     * overwrites.
+     *
+     * If the `size` (or return value of `sizeCalculation`) for a given
+     * entry is greater than `maxEntrySize`, then the item will not be
+     * added to the cache.
+     *
+     * Will update the recency of the entry.
+     *
+     * If the value is `undefined`, then this is an alias for
+     * `cache.delete(key)`. `undefined` is never stored in the cache.
+     */
+    set(k, v, setOptions = {}) {
+        if (v === undefined) {
+            this.delete(k);
+            return this;
+        }
+        const { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status, } = setOptions;
+        let { noUpdateTTL = this.noUpdateTTL } = setOptions;
+        const size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
+        // if the item doesn't fit, don't do anything
+        // NB: maxEntrySize set to maxSize by default
+        if (this.maxEntrySize && size > this.maxEntrySize) {
+            if (status) {
+                status.set = 'miss';
+                status.maxEntrySizeExceeded = true;
+            }
+            // have to delete, in case something is there already.
+            this.#delete(k, 'set');
+            return this;
+        }
+        let index = this.#size === 0 ? undefined : this.#keyMap.get(k);
+        if (index === undefined) {
+            // addition
+            index = (this.#size === 0
+                ? this.#tail
+                : this.#free.length !== 0
+                    ? this.#free.pop()
+                    : this.#size === this.#max
+                        ? this.#evict(false)
+                        : this.#size);
+            this.#keyList[index] = k;
+            this.#valList[index] = v;
+            this.#keyMap.set(k, index);
+            this.#next[this.#tail] = index;
+            this.#prev[index] = this.#tail;
+            this.#tail = index;
+            this.#size++;
+            this.#addItemSize(index, size, status);
+            if (status)
+                status.set = 'add';
+            noUpdateTTL = false;
+        }
+        else {
+            // update
+            this.#moveToTail(index);
+            const oldVal = this.#valList[index];
+            if (v !== oldVal) {
+                if (this.#hasFetchMethod && this.#isBackgroundFetch(oldVal)) {
+                    oldVal.__abortController.abort(new Error('replaced'));
+                    const { __staleWhileFetching: s } = oldVal;
+                    if (s !== undefined && !noDisposeOnSet) {
+                        if (this.#hasDispose) {
+                            this.#dispose?.(s, k, 'set');
+                        }
+                        if (this.#hasDisposeAfter) {
+                            this.#disposed?.push([s, k, 'set']);
+                        }
+                    }
+                }
+                else if (!noDisposeOnSet) {
+                    if (this.#hasDispose) {
+                        this.#dispose?.(oldVal, k, 'set');
+                    }
+                    if (this.#hasDisposeAfter) {
+                        this.#disposed?.push([oldVal, k, 'set']);
+                    }
+                }
+                this.#removeItemSize(index);
+                this.#addItemSize(index, size, status);
+                this.#valList[index] = v;
+                if (status) {
+                    status.set = 'replace';
+                    const oldValue = oldVal && this.#isBackgroundFetch(oldVal)
+                        ? oldVal.__staleWhileFetching
+                        : oldVal;
+                    if (oldValue !== undefined)
+                        status.oldValue = oldValue;
+                }
+            }
+            else if (status) {
+                status.set = 'update';
+            }
+        }
+        if (ttl !== 0 && !this.#ttls) {
+            this.#initializeTTLTracking();
+        }
+        if (this.#ttls) {
+            if (!noUpdateTTL) {
+                this.#setItemTTL(index, ttl, start);
+            }
+            if (status)
+                this.#statusTTL(status, index);
+        }
+        if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
+            const dt = this.#disposed;
+            let task;
+            while ((task = dt?.shift())) {
+                this.#disposeAfter?.(...task);
+            }
+        }
+        return this;
+    }
+    /**
+     * Evict the least recently used item, returning its value or
+     * `undefined` if cache is empty.
+     */
+    pop() {
+        try {
+            while (this.#size) {
+                const val = this.#valList[this.#head];
+                this.#evict(true);
+                if (this.#isBackgroundFetch(val)) {
+                    if (val.__staleWhileFetching) {
+                        return val.__staleWhileFetching;
+                    }
+                }
+                else if (val !== undefined) {
+                    return val;
+                }
+            }
+        }
+        finally {
+            if (this.#hasDisposeAfter && this.#disposed) {
+                const dt = this.#disposed;
+                let task;
+                while ((task = dt?.shift())) {
+                    this.#disposeAfter?.(...task);
+                }
+            }
+        }
+    }
+    #evict(free) {
+        const head = this.#head;
+        const k = this.#keyList[head];
+        const v = this.#valList[head];
+        if (this.#hasFetchMethod && this.#isBackgroundFetch(v)) {
+            v.__abortController.abort(new Error('evicted'));
+        }
+        else if (this.#hasDispose || this.#hasDisposeAfter) {
+            if (this.#hasDispose) {
+                this.#dispose?.(v, k, 'evict');
+            }
+            if (this.#hasDisposeAfter) {
+                this.#disposed?.push([v, k, 'evict']);
+            }
+        }
+        this.#removeItemSize(head);
+        // if we aren't about to use the index, then null these out
+        if (free) {
+            this.#keyList[head] = undefined;
+            this.#valList[head] = undefined;
+            this.#free.push(head);
+        }
+        if (this.#size === 1) {
+            this.#head = this.#tail = 0;
+            this.#free.length = 0;
+        }
+        else {
+            this.#head = this.#next[head];
+        }
+        this.#keyMap.delete(k);
+        this.#size--;
+        return head;
+    }
+    /**
+     * Check if a key is in the cache, without updating the recency of use.
+     * Will return false if the item is stale, even though it is technically
+     * in the cache.
+     *
+     * Check if a key is in the cache, without updating the recency of
+     * use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
+     * to `true` in either the options or the constructor.
+     *
+     * Will return `false` if the item is stale, even though it is technically in
+     * the cache. The difference can be determined (if it matters) by using a
+     * `status` argument, and inspecting the `has` field.
+     *
+     * Will not update item age unless
+     * {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
+     */
+    has(k, hasOptions = {}) {
+        const { updateAgeOnHas = this.updateAgeOnHas, status } = hasOptions;
+        const index = this.#keyMap.get(k);
+        if (index !== undefined) {
+            const v = this.#valList[index];
+            if (this.#isBackgroundFetch(v) &&
+                v.__staleWhileFetching === undefined) {
+                return false;
+            }
+            if (!this.#isStale(index)) {
+                if (updateAgeOnHas) {
+                    this.#updateItemAge(index);
+                }
+                if (status) {
+                    status.has = 'hit';
+                    this.#statusTTL(status, index);
+                }
+                return true;
+            }
+            else if (status) {
+                status.has = 'stale';
+                this.#statusTTL(status, index);
+            }
+        }
+        else if (status) {
+            status.has = 'miss';
+        }
+        return false;
+    }
+    /**
+     * Like {@link LRUCache#get} but doesn't update recency or delete stale
+     * items.
+     *
+     * Returns `undefined` if the item is stale, unless
+     * {@link LRUCache.OptionsBase.allowStale} is set.
+     */
+    peek(k, peekOptions = {}) {
+        const { allowStale = this.allowStale } = peekOptions;
+        const index = this.#keyMap.get(k);
+        if (index === undefined ||
+            (!allowStale && this.#isStale(index))) {
+            return;
+        }
+        const v = this.#valList[index];
+        // either stale and allowed, or forcing a refresh of non-stale value
+        return this.#isBackgroundFetch(v) ? v.__staleWhileFetching : v;
+    }
+    #backgroundFetch(k, index, options, context) {
+        const v = index === undefined ? undefined : this.#valList[index];
+        if (this.#isBackgroundFetch(v)) {
+            return v;
+        }
+        const ac = new AC();
+        const { signal } = options;
+        // when/if our AC signals, then stop listening to theirs.
+        signal?.addEventListener('abort', () => ac.abort(signal.reason), {
+            signal: ac.signal,
+        });
+        const fetchOpts = {
+            signal: ac.signal,
+            options,
+            context,
+        };
+        const cb = (v, updateCache = false) => {
+            const { aborted } = ac.signal;
+            const ignoreAbort = options.ignoreFetchAbort && v !== undefined;
+            if (options.status) {
+                if (aborted && !updateCache) {
+                    options.status.fetchAborted = true;
+                    options.status.fetchError = ac.signal.reason;
+                    if (ignoreAbort)
+                        options.status.fetchAbortIgnored = true;
+                }
+                else {
+                    options.status.fetchResolved = true;
+                }
+            }
+            if (aborted && !ignoreAbort && !updateCache) {
+                return fetchFail(ac.signal.reason);
+            }
+            // either we didn't abort, and are still here, or we did, and ignored
+            const bf = p;
+            if (this.#valList[index] === p) {
+                if (v === undefined) {
+                    if (bf.__staleWhileFetching) {
+                        this.#valList[index] = bf.__staleWhileFetching;
+                    }
+                    else {
+                        this.#delete(k, 'fetch');
+                    }
+                }
+                else {
+                    if (options.status)
+                        options.status.fetchUpdated = true;
+                    this.set(k, v, fetchOpts.options);
+                }
+            }
+            return v;
+        };
+        const eb = (er) => {
+            if (options.status) {
+                options.status.fetchRejected = true;
+                options.status.fetchError = er;
+            }
+            return fetchFail(er);
+        };
+        const fetchFail = (er) => {
+            const { aborted } = ac.signal;
+            const allowStaleAborted = aborted && options.allowStaleOnFetchAbort;
+            const allowStale = allowStaleAborted || options.allowStaleOnFetchRejection;
+            const noDelete = allowStale || options.noDeleteOnFetchRejection;
+            const bf = p;
+            if (this.#valList[index] === p) {
+                // if we allow stale on fetch rejections, then we need to ensure that
+                // the stale value is not removed from the cache when the fetch fails.
+                const del = !noDelete || bf.__staleWhileFetching === undefined;
+                if (del) {
+                    this.#delete(k, 'fetch');
+                }
+                else if (!allowStaleAborted) {
+                    // still replace the *promise* with the stale value,
+                    // since we are done with the promise at this point.
+                    // leave it untouched if we're still waiting for an
+                    // aborted background fetch that hasn't yet returned.
+                    this.#valList[index] = bf.__staleWhileFetching;
+                }
+            }
+            if (allowStale) {
+                if (options.status && bf.__staleWhileFetching !== undefined) {
+                    options.status.returnedStale = true;
+                }
+                return bf.__staleWhileFetching;
+            }
+            else if (bf.__returned === bf) {
+                throw er;
+            }
+        };
+        const pcall = (res, rej) => {
+            const fmp = this.#fetchMethod?.(k, v, fetchOpts);
+            if (fmp && fmp instanceof Promise) {
+                fmp.then(v => res(v === undefined ? undefined : v), rej);
+            }
+            // ignored, we go until we finish, regardless.
+            // defer check until we are actually aborting,
+            // so fetchMethod can override.
+            ac.signal.addEventListener('abort', () => {
+                if (!options.ignoreFetchAbort ||
+                    options.allowStaleOnFetchAbort) {
+                    res(undefined);
+                    // when it eventually resolves, update the cache.
+                    if (options.allowStaleOnFetchAbort) {
+                        res = v => cb(v, true);
+                    }
+                }
+            });
+        };
+        if (options.status)
+            options.status.fetchDispatched = true;
+        const p = new Promise(pcall).then(cb, eb);
+        const bf = Object.assign(p, {
+            __abortController: ac,
+            __staleWhileFetching: v,
+            __returned: undefined,
+        });
+        if (index === undefined) {
+            // internal, don't expose status.
+            this.set(k, bf, { ...fetchOpts.options, status: undefined });
+            index = this.#keyMap.get(k);
+        }
+        else {
+            this.#valList[index] = bf;
+        }
+        return bf;
+    }
+    #isBackgroundFetch(p) {
+        if (!this.#hasFetchMethod)
+            return false;
+        const b = p;
+        return (!!b &&
+            b instanceof Promise &&
+            b.hasOwnProperty('__staleWhileFetching') &&
+            b.__abortController instanceof AC);
+    }
+    async fetch(k, fetchOptions = {}) {
+        const { 
+        // get options
+        allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, 
+        // set options
+        ttl = this.ttl, noDisposeOnSet = this.noDisposeOnSet, size = 0, sizeCalculation = this.sizeCalculation, noUpdateTTL = this.noUpdateTTL, 
+        // fetch exclusive options
+        noDeleteOnFetchRejection = this.noDeleteOnFetchRejection, allowStaleOnFetchRejection = this.allowStaleOnFetchRejection, ignoreFetchAbort = this.ignoreFetchAbort, allowStaleOnFetchAbort = this.allowStaleOnFetchAbort, context, forceRefresh = false, status, signal, } = fetchOptions;
+        if (!this.#hasFetchMethod) {
+            if (status)
+                status.fetch = 'get';
+            return this.get(k, {
+                allowStale,
+                updateAgeOnGet,
+                noDeleteOnStaleGet,
+                status,
+            });
+        }
+        const options = {
+            allowStale,
+            updateAgeOnGet,
+            noDeleteOnStaleGet,
+            ttl,
+            noDisposeOnSet,
+            size,
+            sizeCalculation,
+            noUpdateTTL,
+            noDeleteOnFetchRejection,
+            allowStaleOnFetchRejection,
+            allowStaleOnFetchAbort,
+            ignoreFetchAbort,
+            status,
+            signal,
+        };
+        let index = this.#keyMap.get(k);
+        if (index === undefined) {
+            if (status)
+                status.fetch = 'miss';
+            const p = this.#backgroundFetch(k, index, options, context);
+            return (p.__returned = p);
+        }
+        else {
+            // in cache, maybe already fetching
+            const v = this.#valList[index];
+            if (this.#isBackgroundFetch(v)) {
+                const stale = allowStale && v.__staleWhileFetching !== undefined;
+                if (status) {
+                    status.fetch = 'inflight';
+                    if (stale)
+                        status.returnedStale = true;
+                }
+                return stale ? v.__staleWhileFetching : (v.__returned = v);
+            }
+            // if we force a refresh, that means do NOT serve the cached value,
+            // unless we are already in the process of refreshing the cache.
+            const isStale = this.#isStale(index);
+            if (!forceRefresh && !isStale) {
+                if (status)
+                    status.fetch = 'hit';
+                this.#moveToTail(index);
+                if (updateAgeOnGet) {
+                    this.#updateItemAge(index);
+                }
+                if (status)
+                    this.#statusTTL(status, index);
+                return v;
+            }
+            // ok, it is stale or a forced refresh, and not already fetching.
+            // refresh the cache.
+            const p = this.#backgroundFetch(k, index, options, context);
+            const hasStale = p.__staleWhileFetching !== undefined;
+            const staleVal = hasStale && allowStale;
+            if (status) {
+                status.fetch = isStale ? 'stale' : 'refresh';
+                if (staleVal && isStale)
+                    status.returnedStale = true;
+            }
+            return staleVal ? p.__staleWhileFetching : (p.__returned = p);
+        }
+    }
+    async forceFetch(k, fetchOptions = {}) {
+        const v = await this.fetch(k, fetchOptions);
+        if (v === undefined)
+            throw new Error('fetch() returned undefined');
+        return v;
+    }
+    memo(k, memoOptions = {}) {
+        const memoMethod = this.#memoMethod;
+        if (!memoMethod) {
+            throw new Error('no memoMethod provided to constructor');
+        }
+        const { context, forceRefresh, ...options } = memoOptions;
+        const v = this.get(k, options);
+        if (!forceRefresh && v !== undefined)
+            return v;
+        const vv = memoMethod(k, v, {
+            options,
+            context,
+        });
+        this.set(k, vv, options);
+        return vv;
+    }
+    /**
+     * Return a value from the cache. Will update the recency of the cache
+     * entry found.
+     *
+     * If the key is not found, get() will return `undefined`.
+     */
+    get(k, getOptions = {}) {
+        const { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status, } = getOptions;
+        const index = this.#keyMap.get(k);
+        if (index !== undefined) {
+            const value = this.#valList[index];
+            const fetching = this.#isBackgroundFetch(value);
+            if (status)
+                this.#statusTTL(status, index);
+            if (this.#isStale(index)) {
+                if (status)
+                    status.get = 'stale';
+                // delete only if not an in-flight background fetch
+                if (!fetching) {
+                    if (!noDeleteOnStaleGet) {
+                        this.#delete(k, 'expire');
+                    }
+                    if (status && allowStale)
+                        status.returnedStale = true;
+                    return allowStale ? value : undefined;
+                }
+                else {
+                    if (status &&
+                        allowStale &&
+                        value.__staleWhileFetching !== undefined) {
+                        status.returnedStale = true;
+                    }
+                    return allowStale ? value.__staleWhileFetching : undefined;
+                }
+            }
+            else {
+                if (status)
+                    status.get = 'hit';
+                // if we're currently fetching it, we don't actually have it yet
+                // it's not stale, which means this isn't a staleWhileRefetching.
+                // If it's not stale, and fetching, AND has a __staleWhileFetching
+                // value, then that means the user fetched with {forceRefresh:true},
+                // so it's safe to return that value.
+                if (fetching) {
+                    return value.__staleWhileFetching;
+                }
+                this.#moveToTail(index);
+                if (updateAgeOnGet) {
+                    this.#updateItemAge(index);
+                }
+                return value;
+            }
+        }
+        else if (status) {
+            status.get = 'miss';
+        }
+    }
+    #connect(p, n) {
+        this.#prev[n] = p;
+        this.#next[p] = n;
+    }
+    #moveToTail(index) {
+        // if tail already, nothing to do
+        // if head, move head to next[index]
+        // else
+        //   move next[prev[index]] to next[index] (head has no prev)
+        //   move prev[next[index]] to prev[index]
+        // prev[index] = tail
+        // next[tail] = index
+        // tail = index
+        if (index !== this.#tail) {
+            if (index === this.#head) {
+                this.#head = this.#next[index];
+            }
+            else {
+                this.#connect(this.#prev[index], this.#next[index]);
+            }
+            this.#connect(this.#tail, index);
+            this.#tail = index;
+        }
+    }
+    /**
+     * Deletes a key out of the cache.
+     *
+     * Returns true if the key was deleted, false otherwise.
+     */
+    delete(k) {
+        return this.#delete(k, 'delete');
+    }
+    #delete(k, reason) {
+        let deleted = false;
+        if (this.#size !== 0) {
+            const index = this.#keyMap.get(k);
+            if (index !== undefined) {
+                deleted = true;
+                if (this.#size === 1) {
+                    this.#clear(reason);
+                }
+                else {
+                    this.#removeItemSize(index);
+                    const v = this.#valList[index];
+                    if (this.#isBackgroundFetch(v)) {
+                        v.__abortController.abort(new Error('deleted'));
+                    }
+                    else if (this.#hasDispose || this.#hasDisposeAfter) {
+                        if (this.#hasDispose) {
+                            this.#dispose?.(v, k, reason);
+                        }
+                        if (this.#hasDisposeAfter) {
+                            this.#disposed?.push([v, k, reason]);
+                        }
+                    }
+                    this.#keyMap.delete(k);
+                    this.#keyList[index] = undefined;
+                    this.#valList[index] = undefined;
+                    if (index === this.#tail) {
+                        this.#tail = this.#prev[index];
+                    }
+                    else if (index === this.#head) {
+                        this.#head = this.#next[index];
+                    }
+                    else {
+                        const pi = this.#prev[index];
+                        this.#next[pi] = this.#next[index];
+                        const ni = this.#next[index];
+                        this.#prev[ni] = this.#prev[index];
+                    }
+                    this.#size--;
+                    this.#free.push(index);
+                }
+            }
+        }
+        if (this.#hasDisposeAfter && this.#disposed?.length) {
+            const dt = this.#disposed;
+            let task;
+            while ((task = dt?.shift())) {
+                this.#disposeAfter?.(...task);
+            }
+        }
+        return deleted;
+    }
+    /**
+     * Clear the cache entirely, throwing away all values.
+     */
+    clear() {
+        return this.#clear('delete');
+    }
+    #clear(reason) {
+        for (const index of this.#rindexes({ allowStale: true })) {
+            const v = this.#valList[index];
+            if (this.#isBackgroundFetch(v)) {
+                v.__abortController.abort(new Error('deleted'));
+            }
+            else {
+                const k = this.#keyList[index];
+                if (this.#hasDispose) {
+                    this.#dispose?.(v, k, reason);
+                }
+                if (this.#hasDisposeAfter) {
+                    this.#disposed?.push([v, k, reason]);
+                }
+            }
+        }
+        this.#keyMap.clear();
+        this.#valList.fill(undefined);
+        this.#keyList.fill(undefined);
+        if (this.#ttls && this.#starts) {
+            this.#ttls.fill(0);
+            this.#starts.fill(0);
+        }
+        if (this.#sizes) {
+            this.#sizes.fill(0);
+        }
+        this.#head = 0;
+        this.#tail = 0;
+        this.#free.length = 0;
+        this.#calculatedSize = 0;
+        this.#size = 0;
+        if (this.#hasDisposeAfter && this.#disposed) {
+            const dt = this.#disposed;
+            let task;
+            while ((task = dt?.shift())) {
+                this.#disposeAfter?.(...task);
+            }
+        }
+    }
+}
+
+const proc = typeof process === 'object' && process
+    ? process
+    : {
+        stdout: null,
+        stderr: null,
+    };
+/**
+ * Return true if the argument is a Minipass stream, Node stream, or something
+ * else that Minipass can interact with.
+ */
+const isStream = (s) => !!s &&
+    typeof s === 'object' &&
+    (s instanceof Minipass ||
+        s instanceof Stream$1 ||
+        isReadable(s) ||
+        isWritable(s));
+/**
+ * Return true if the argument is a valid {@link Minipass.Readable}
+ */
+const isReadable = (s) => !!s &&
+    typeof s === 'object' &&
+    s instanceof EventEmitter$4 &&
+    typeof s.pipe === 'function' &&
+    // node core Writable streams have a pipe() method, but it throws
+    s.pipe !== Stream$1.Writable.prototype.pipe;
+/**
+ * Return true if the argument is a valid {@link Minipass.Writable}
+ */
+const isWritable = (s) => !!s &&
+    typeof s === 'object' &&
+    s instanceof EventEmitter$4 &&
+    typeof s.write === 'function' &&
+    typeof s.end === 'function';
+const EOF = Symbol('EOF');
+const MAYBE_EMIT_END = Symbol('maybeEmitEnd');
+const EMITTED_END = Symbol('emittedEnd');
+const EMITTING_END = Symbol('emittingEnd');
+const EMITTED_ERROR = Symbol('emittedError');
+const CLOSED$1 = Symbol('closed');
+const READ = Symbol('read');
+const FLUSH = Symbol('flush');
+const FLUSHCHUNK = Symbol('flushChunk');
+const ENCODING$1 = Symbol('encoding');
+const DECODER = Symbol('decoder');
+const FLOWING = Symbol('flowing');
+const PAUSED = Symbol('paused');
+const RESUME = Symbol('resume');
+const BUFFER = Symbol('buffer');
+const PIPES = Symbol('pipes');
+const BUFFERLENGTH = Symbol('bufferLength');
+const BUFFERPUSH = Symbol('bufferPush');
+const BUFFERSHIFT = Symbol('bufferShift');
+const OBJECTMODE = Symbol('objectMode');
+// internal event when stream is destroyed
+const DESTROYED = Symbol('destroyed');
+// internal event when stream has an error
+const ERROR = Symbol('error');
+const EMITDATA = Symbol('emitData');
+const EMITEND = Symbol('emitEnd');
+const EMITEND2 = Symbol('emitEnd2');
+const ASYNC = Symbol('async');
+const ABORT = Symbol('abort');
+const ABORTED = Symbol('aborted');
+const SIGNAL = Symbol('signal');
+const DATALISTENERS = Symbol('dataListeners');
+const DISCARDED = Symbol('discarded');
+const defer$3 = (fn) => Promise.resolve().then(fn);
+const nodefer = (fn) => fn();
+const isEndish = (ev) => ev === 'end' || ev === 'finish' || ev === 'prefinish';
+const isArrayBufferLike = (b) => b instanceof ArrayBuffer ||
+    (!!b &&
+        typeof b === 'object' &&
+        b.constructor &&
+        b.constructor.name === 'ArrayBuffer' &&
+        b.byteLength >= 0);
+const isArrayBufferView = (b) => !Buffer.isBuffer(b) && ArrayBuffer.isView(b);
+/**
+ * Internal class representing a pipe to a destination stream.
+ *
+ * @internal
+ */
+class Pipe {
+    src;
+    dest;
+    opts;
+    ondrain;
+    constructor(src, dest, opts) {
+        this.src = src;
+        this.dest = dest;
+        this.opts = opts;
+        this.ondrain = () => src[RESUME]();
+        this.dest.on('drain', this.ondrain);
+    }
+    unpipe() {
+        this.dest.removeListener('drain', this.ondrain);
+    }
+    // only here for the prototype
+    /* c8 ignore start */
+    proxyErrors(_er) { }
+    /* c8 ignore stop */
+    end() {
+        this.unpipe();
+        if (this.opts.end)
+            this.dest.end();
+    }
+}
+/**
+ * Internal class representing a pipe to a destination stream where
+ * errors are proxied.
+ *
+ * @internal
+ */
+class PipeProxyErrors extends Pipe {
+    unpipe() {
+        this.src.removeListener('error', this.proxyErrors);
+        super.unpipe();
+    }
+    constructor(src, dest, opts) {
+        super(src, dest, opts);
+        this.proxyErrors = er => dest.emit('error', er);
+        src.on('error', this.proxyErrors);
+    }
+}
+const isObjectModeOptions = (o) => !!o.objectMode;
+const isEncodingOptions = (o) => !o.objectMode && !!o.encoding && o.encoding !== 'buffer';
+/**
+ * Main export, the Minipass class
+ *
+ * `RType` is the type of data emitted, defaults to Buffer
+ *
+ * `WType` is the type of data to be written, if RType is buffer or string,
+ * then any {@link Minipass.ContiguousData} is allowed.
+ *
+ * `Events` is the set of event handler signatures that this object
+ * will emit, see {@link Minipass.Events}
+ */
+class Minipass extends EventEmitter$4 {
+    [FLOWING] = false;
+    [PAUSED] = false;
+    [PIPES] = [];
+    [BUFFER] = [];
+    [OBJECTMODE];
+    [ENCODING$1];
+    [ASYNC];
+    [DECODER];
+    [EOF] = false;
+    [EMITTED_END] = false;
+    [EMITTING_END] = false;
+    [CLOSED$1] = false;
+    [EMITTED_ERROR] = null;
+    [BUFFERLENGTH] = 0;
+    [DESTROYED] = false;
+    [SIGNAL];
+    [ABORTED] = false;
+    [DATALISTENERS] = 0;
+    [DISCARDED] = false;
+    /**
+     * true if the stream can be written
+     */
+    writable = true;
+    /**
+     * true if the stream can be read
+     */
+    readable = true;
+    /**
+     * If `RType` is Buffer, then options do not need to be provided.
+     * Otherwise, an options object must be provided to specify either
+     * {@link Minipass.SharedOptions.objectMode} or
+     * {@link Minipass.SharedOptions.encoding}, as appropriate.
+     */
+    constructor(...args) {
+        const options = (args[0] ||
+            {});
+        super();
+        if (options.objectMode && typeof options.encoding === 'string') {
+            throw new TypeError('Encoding and objectMode may not be used together');
+        }
+        if (isObjectModeOptions(options)) {
+            this[OBJECTMODE] = true;
+            this[ENCODING$1] = null;
+        }
+        else if (isEncodingOptions(options)) {
+            this[ENCODING$1] = options.encoding;
+            this[OBJECTMODE] = false;
+        }
+        else {
+            this[OBJECTMODE] = false;
+            this[ENCODING$1] = null;
+        }
+        this[ASYNC] = !!options.async;
+        this[DECODER] = this[ENCODING$1]
+            ? new StringDecoder(this[ENCODING$1])
+            : null;
+        //@ts-ignore - private option for debugging and testing
+        if (options && options.debugExposeBuffer === true) {
+            Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] });
+        }
+        //@ts-ignore - private option for debugging and testing
+        if (options && options.debugExposePipes === true) {
+            Object.defineProperty(this, 'pipes', { get: () => this[PIPES] });
+        }
+        const { signal } = options;
+        if (signal) {
+            this[SIGNAL] = signal;
+            if (signal.aborted) {
+                this[ABORT]();
+            }
+            else {
+                signal.addEventListener('abort', () => this[ABORT]());
+            }
+        }
+    }
+    /**
+     * The amount of data stored in the buffer waiting to be read.
+     *
+     * For Buffer strings, this will be the total byte length.
+     * For string encoding streams, this will be the string character length,
+     * according to JavaScript's `string.length` logic.
+     * For objectMode streams, this is a count of the items waiting to be
+     * emitted.
+     */
+    get bufferLength() {
+        return this[BUFFERLENGTH];
+    }
+    /**
+     * The `BufferEncoding` currently in use, or `null`
+     */
+    get encoding() {
+        return this[ENCODING$1];
+    }
+    /**
+     * @deprecated - This is a read only property
+     */
+    set encoding(_enc) {
+        throw new Error('Encoding must be set at instantiation time');
+    }
+    /**
+     * @deprecated - Encoding may only be set at instantiation time
+     */
+    setEncoding(_enc) {
+        throw new Error('Encoding must be set at instantiation time');
+    }
+    /**
+     * True if this is an objectMode stream
+     */
+    get objectMode() {
+        return this[OBJECTMODE];
+    }
+    /**
+     * @deprecated - This is a read-only property
+     */
+    set objectMode(_om) {
+        throw new Error('objectMode must be set at instantiation time');
+    }
+    /**
+     * true if this is an async stream
+     */
+    get ['async']() {
+        return this[ASYNC];
+    }
+    /**
+     * Set to true to make this stream async.
+     *
+     * Once set, it cannot be unset, as this would potentially cause incorrect
+     * behavior.  Ie, a sync stream can be made async, but an async stream
+     * cannot be safely made sync.
+     */
+    set ['async'](a) {
+        this[ASYNC] = this[ASYNC] || !!a;
+    }
+    // drop everything and get out of the flow completely
+    [ABORT]() {
+        this[ABORTED] = true;
+        this.emit('abort', this[SIGNAL]?.reason);
+        this.destroy(this[SIGNAL]?.reason);
+    }
+    /**
+     * True if the stream has been aborted.
+     */
+    get aborted() {
+        return this[ABORTED];
+    }
+    /**
+     * No-op setter. Stream aborted status is set via the AbortSignal provided
+     * in the constructor options.
+     */
+    set aborted(_) { }
+    write(chunk, encoding, cb) {
+        if (this[ABORTED])
+            return false;
+        if (this[EOF])
+            throw new Error('write after end');
+        if (this[DESTROYED]) {
+            this.emit('error', Object.assign(new Error('Cannot call write after a stream was destroyed'), { code: 'ERR_STREAM_DESTROYED' }));
+            return true;
+        }
+        if (typeof encoding === 'function') {
+            cb = encoding;
+            encoding = 'utf8';
+        }
+        if (!encoding)
+            encoding = 'utf8';
+        const fn = this[ASYNC] ? defer$3 : nodefer;
+        // convert array buffers and typed array views into buffers
+        // at some point in the future, we may want to do the opposite!
+        // leave strings and buffers as-is
+        // anything is only allowed if in object mode, so throw
+        if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {
+            if (isArrayBufferView(chunk)) {
+                //@ts-ignore - sinful unsafe type changing
+                chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength);
+            }
+            else if (isArrayBufferLike(chunk)) {
+                //@ts-ignore - sinful unsafe type changing
+                chunk = Buffer.from(chunk);
+            }
+            else if (typeof chunk !== 'string') {
+                throw new Error('Non-contiguous data written to non-objectMode stream');
+            }
+        }
+        // handle object mode up front, since it's simpler
+        // this yields better performance, fewer checks later.
+        if (this[OBJECTMODE]) {
+            // maybe impossible?
+            /* c8 ignore start */
+            if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
+                this[FLUSH](true);
+            /* c8 ignore stop */
+            if (this[FLOWING])
+                this.emit('data', chunk);
+            else
+                this[BUFFERPUSH](chunk);
+            if (this[BUFFERLENGTH] !== 0)
+                this.emit('readable');
+            if (cb)
+                fn(cb);
+            return this[FLOWING];
+        }
+        // at this point the chunk is a buffer or string
+        // don't buffer it up or send it to the decoder
+        if (!chunk.length) {
+            if (this[BUFFERLENGTH] !== 0)
+                this.emit('readable');
+            if (cb)
+                fn(cb);
+            return this[FLOWING];
+        }
+        // fast-path writing strings of same encoding to a stream with
+        // an empty buffer, skipping the buffer/decoder dance
+        if (typeof chunk === 'string' &&
+            // unless it is a string already ready for us to use
+            !(encoding === this[ENCODING$1] && !this[DECODER]?.lastNeed)) {
+            //@ts-ignore - sinful unsafe type change
+            chunk = Buffer.from(chunk, encoding);
+        }
+        if (Buffer.isBuffer(chunk) && this[ENCODING$1]) {
+            //@ts-ignore - sinful unsafe type change
+            chunk = this[DECODER].write(chunk);
+        }
+        // Note: flushing CAN potentially switch us into not-flowing mode
+        if (this[FLOWING] && this[BUFFERLENGTH] !== 0)
+            this[FLUSH](true);
+        if (this[FLOWING])
+            this.emit('data', chunk);
+        else
+            this[BUFFERPUSH](chunk);
+        if (this[BUFFERLENGTH] !== 0)
+            this.emit('readable');
+        if (cb)
+            fn(cb);
+        return this[FLOWING];
+    }
+    /**
+     * Low-level explicit read method.
+     *
+     * In objectMode, the argument is ignored, and one item is returned if
+     * available.
+     *
+     * `n` is the number of bytes (or in the case of encoding streams,
+     * characters) to consume. If `n` is not provided, then the entire buffer
+     * is returned, or `null` is returned if no data is available.
+     *
+     * If `n` is greater that the amount of data in the internal buffer,
+     * then `null` is returned.
+     */
+    read(n) {
+        if (this[DESTROYED])
+            return null;
+        this[DISCARDED] = false;
+        if (this[BUFFERLENGTH] === 0 ||
+            n === 0 ||
+            (n && n > this[BUFFERLENGTH])) {
+            this[MAYBE_EMIT_END]();
+            return null;
+        }
+        if (this[OBJECTMODE])
+            n = null;
+        if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {
+            // not object mode, so if we have an encoding, then RType is string
+            // otherwise, must be Buffer
+            this[BUFFER] = [
+                (this[ENCODING$1]
+                    ? this[BUFFER].join('')
+                    : Buffer.concat(this[BUFFER], this[BUFFERLENGTH])),
+            ];
+        }
+        const ret = this[READ](n || null, this[BUFFER][0]);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [READ](n, chunk) {
+        if (this[OBJECTMODE])
+            this[BUFFERSHIFT]();
+        else {
+            const c = chunk;
+            if (n === c.length || n === null)
+                this[BUFFERSHIFT]();
+            else if (typeof c === 'string') {
+                this[BUFFER][0] = c.slice(n);
+                chunk = c.slice(0, n);
+                this[BUFFERLENGTH] -= n;
+            }
+            else {
+                this[BUFFER][0] = c.subarray(n);
+                chunk = c.subarray(0, n);
+                this[BUFFERLENGTH] -= n;
+            }
+        }
+        this.emit('data', chunk);
+        if (!this[BUFFER].length && !this[EOF])
+            this.emit('drain');
+        return chunk;
+    }
+    end(chunk, encoding, cb) {
+        if (typeof chunk === 'function') {
+            cb = chunk;
+            chunk = undefined;
+        }
+        if (typeof encoding === 'function') {
+            cb = encoding;
+            encoding = 'utf8';
+        }
+        if (chunk !== undefined)
+            this.write(chunk, encoding);
+        if (cb)
+            this.once('end', cb);
+        this[EOF] = true;
+        this.writable = false;
+        // if we haven't written anything, then go ahead and emit,
+        // even if we're not reading.
+        // we'll re-emit if a new 'end' listener is added anyway.
+        // This makes MP more suitable to write-only use cases.
+        if (this[FLOWING] || !this[PAUSED])
+            this[MAYBE_EMIT_END]();
+        return this;
+    }
+    // don't let the internal resume be overwritten
+    [RESUME]() {
+        if (this[DESTROYED])
+            return;
+        if (!this[DATALISTENERS] && !this[PIPES].length) {
+            this[DISCARDED] = true;
+        }
+        this[PAUSED] = false;
+        this[FLOWING] = true;
+        this.emit('resume');
+        if (this[BUFFER].length)
+            this[FLUSH]();
+        else if (this[EOF])
+            this[MAYBE_EMIT_END]();
+        else
+            this.emit('drain');
+    }
+    /**
+     * Resume the stream if it is currently in a paused state
+     *
+     * If called when there are no pipe destinations or `data` event listeners,
+     * this will place the stream in a "discarded" state, where all data will
+     * be thrown away. The discarded state is removed if a pipe destination or
+     * data handler is added, if pause() is called, or if any synchronous or
+     * asynchronous iteration is started.
+     */
+    resume() {
+        return this[RESUME]();
+    }
+    /**
+     * Pause the stream
+     */
+    pause() {
+        this[FLOWING] = false;
+        this[PAUSED] = true;
+        this[DISCARDED] = false;
+    }
+    /**
+     * true if the stream has been forcibly destroyed
+     */
+    get destroyed() {
+        return this[DESTROYED];
+    }
+    /**
+     * true if the stream is currently in a flowing state, meaning that
+     * any writes will be immediately emitted.
+     */
+    get flowing() {
+        return this[FLOWING];
+    }
+    /**
+     * true if the stream is currently in a paused state
+     */
+    get paused() {
+        return this[PAUSED];
+    }
+    [BUFFERPUSH](chunk) {
+        if (this[OBJECTMODE])
+            this[BUFFERLENGTH] += 1;
+        else
+            this[BUFFERLENGTH] += chunk.length;
+        this[BUFFER].push(chunk);
+    }
+    [BUFFERSHIFT]() {
+        if (this[OBJECTMODE])
+            this[BUFFERLENGTH] -= 1;
+        else
+            this[BUFFERLENGTH] -= this[BUFFER][0].length;
+        return this[BUFFER].shift();
+    }
+    [FLUSH](noDrain = false) {
+        do { } while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) &&
+            this[BUFFER].length);
+        if (!noDrain && !this[BUFFER].length && !this[EOF])
+            this.emit('drain');
+    }
+    [FLUSHCHUNK](chunk) {
+        this.emit('data', chunk);
+        return this[FLOWING];
+    }
+    /**
+     * Pipe all data emitted by this stream into the destination provided.
+     *
+     * Triggers the flow of data.
+     */
+    pipe(dest, opts) {
+        if (this[DESTROYED])
+            return dest;
+        this[DISCARDED] = false;
+        const ended = this[EMITTED_END];
+        opts = opts || {};
+        if (dest === proc.stdout || dest === proc.stderr)
+            opts.end = false;
+        else
+            opts.end = opts.end !== false;
+        opts.proxyErrors = !!opts.proxyErrors;
+        // piping an ended stream ends immediately
+        if (ended) {
+            if (opts.end)
+                dest.end();
+        }
+        else {
+            // "as" here just ignores the WType, which pipes don't care about,
+            // since they're only consuming from us, and writing to the dest
+            this[PIPES].push(!opts.proxyErrors
+                ? new Pipe(this, dest, opts)
+                : new PipeProxyErrors(this, dest, opts));
+            if (this[ASYNC])
+                defer$3(() => this[RESUME]());
+            else
+                this[RESUME]();
+        }
+        return dest;
+    }
+    /**
+     * Fully unhook a piped destination stream.
+     *
+     * If the destination stream was the only consumer of this stream (ie,
+     * there are no other piped destinations or `'data'` event listeners)
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    unpipe(dest) {
+        const p = this[PIPES].find(p => p.dest === dest);
+        if (p) {
+            if (this[PIPES].length === 1) {
+                if (this[FLOWING] && this[DATALISTENERS] === 0) {
+                    this[FLOWING] = false;
+                }
+                this[PIPES] = [];
+            }
+            else
+                this[PIPES].splice(this[PIPES].indexOf(p), 1);
+            p.unpipe();
+        }
+    }
+    /**
+     * Alias for {@link Minipass#on}
+     */
+    addListener(ev, handler) {
+        return this.on(ev, handler);
+    }
+    /**
+     * Mostly identical to `EventEmitter.on`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * - Adding a 'data' event handler will trigger the flow of data
+     *
+     * - Adding a 'readable' event handler when there is data waiting to be read
+     *   will cause 'readable' to be emitted immediately.
+     *
+     * - Adding an 'endish' event handler ('end', 'finish', etc.) which has
+     *   already passed will cause the event to be emitted immediately and all
+     *   handlers removed.
+     *
+     * - Adding an 'error' event handler after an error has been emitted will
+     *   cause the event to be re-emitted immediately with the error previously
+     *   raised.
+     */
+    on(ev, handler) {
+        const ret = super.on(ev, handler);
+        if (ev === 'data') {
+            this[DISCARDED] = false;
+            this[DATALISTENERS]++;
+            if (!this[PIPES].length && !this[FLOWING]) {
+                this[RESUME]();
+            }
+        }
+        else if (ev === 'readable' && this[BUFFERLENGTH] !== 0) {
+            super.emit('readable');
+        }
+        else if (isEndish(ev) && this[EMITTED_END]) {
+            super.emit(ev);
+            this.removeAllListeners(ev);
+        }
+        else if (ev === 'error' && this[EMITTED_ERROR]) {
+            const h = handler;
+            if (this[ASYNC])
+                defer$3(() => h.call(this, this[EMITTED_ERROR]));
+            else
+                h.call(this, this[EMITTED_ERROR]);
+        }
+        return ret;
+    }
+    /**
+     * Alias for {@link Minipass#off}
+     */
+    removeListener(ev, handler) {
+        return this.off(ev, handler);
+    }
+    /**
+     * Mostly identical to `EventEmitter.off`
+     *
+     * If a 'data' event handler is removed, and it was the last consumer
+     * (ie, there are no pipe destinations or other 'data' event listeners),
+     * then the flow of data will stop until there is another consumer or
+     * {@link Minipass#resume} is explicitly called.
+     */
+    off(ev, handler) {
+        const ret = super.off(ev, handler);
+        // if we previously had listeners, and now we don't, and we don't
+        // have any pipes, then stop the flow, unless it's been explicitly
+        // put in a discarded flowing state via stream.resume().
+        if (ev === 'data') {
+            this[DATALISTENERS] = this.listeners('data').length;
+            if (this[DATALISTENERS] === 0 &&
+                !this[DISCARDED] &&
+                !this[PIPES].length) {
+                this[FLOWING] = false;
+            }
+        }
+        return ret;
+    }
+    /**
+     * Mostly identical to `EventEmitter.removeAllListeners`
+     *
+     * If all 'data' event handlers are removed, and they were the last consumer
+     * (ie, there are no pipe destinations), then the flow of data will stop
+     * until there is another consumer or {@link Minipass#resume} is explicitly
+     * called.
+     */
+    removeAllListeners(ev) {
+        const ret = super.removeAllListeners(ev);
+        if (ev === 'data' || ev === undefined) {
+            this[DATALISTENERS] = 0;
+            if (!this[DISCARDED] && !this[PIPES].length) {
+                this[FLOWING] = false;
+            }
+        }
+        return ret;
+    }
+    /**
+     * true if the 'end' event has been emitted
+     */
+    get emittedEnd() {
+        return this[EMITTED_END];
+    }
+    [MAYBE_EMIT_END]() {
+        if (!this[EMITTING_END] &&
+            !this[EMITTED_END] &&
+            !this[DESTROYED] &&
+            this[BUFFER].length === 0 &&
+            this[EOF]) {
+            this[EMITTING_END] = true;
+            this.emit('end');
+            this.emit('prefinish');
+            this.emit('finish');
+            if (this[CLOSED$1])
+                this.emit('close');
+            this[EMITTING_END] = false;
+        }
+    }
+    /**
+     * Mostly identical to `EventEmitter.emit`, with the following
+     * behavior differences to prevent data loss and unnecessary hangs:
+     *
+     * If the stream has been destroyed, and the event is something other
+     * than 'close' or 'error', then `false` is returned and no handlers
+     * are called.
+     *
+     * If the event is 'end', and has already been emitted, then the event
+     * is ignored. If the stream is in a paused or non-flowing state, then
+     * the event will be deferred until data flow resumes. If the stream is
+     * async, then handlers will be called on the next tick rather than
+     * immediately.
+     *
+     * If the event is 'close', and 'end' has not yet been emitted, then
+     * the event will be deferred until after 'end' is emitted.
+     *
+     * If the event is 'error', and an AbortSignal was provided for the stream,
+     * and there are no listeners, then the event is ignored, matching the
+     * behavior of node core streams in the presense of an AbortSignal.
+     *
+     * If the event is 'finish' or 'prefinish', then all listeners will be
+     * removed after emitting the event, to prevent double-firing.
+     */
+    emit(ev, ...args) {
+        const data = args[0];
+        // error and close are only events allowed after calling destroy()
+        if (ev !== 'error' &&
+            ev !== 'close' &&
+            ev !== DESTROYED &&
+            this[DESTROYED]) {
+            return false;
+        }
+        else if (ev === 'data') {
+            return !this[OBJECTMODE] && !data
+                ? false
+                : this[ASYNC]
+                    ? (defer$3(() => this[EMITDATA](data)), true)
+                    : this[EMITDATA](data);
+        }
+        else if (ev === 'end') {
+            return this[EMITEND]();
+        }
+        else if (ev === 'close') {
+            this[CLOSED$1] = true;
+            // don't emit close before 'end' and 'finish'
+            if (!this[EMITTED_END] && !this[DESTROYED])
+                return false;
+            const ret = super.emit('close');
+            this.removeAllListeners('close');
+            return ret;
+        }
+        else if (ev === 'error') {
+            this[EMITTED_ERROR] = data;
+            super.emit(ERROR, data);
+            const ret = !this[SIGNAL] || this.listeners('error').length
+                ? super.emit('error', data)
+                : false;
+            this[MAYBE_EMIT_END]();
+            return ret;
+        }
+        else if (ev === 'resume') {
+            const ret = super.emit('resume');
+            this[MAYBE_EMIT_END]();
+            return ret;
+        }
+        else if (ev === 'finish' || ev === 'prefinish') {
+            const ret = super.emit(ev);
+            this.removeAllListeners(ev);
+            return ret;
+        }
+        // Some other unknown event
+        const ret = super.emit(ev, ...args);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [EMITDATA](data) {
+        for (const p of this[PIPES]) {
+            if (p.dest.write(data) === false)
+                this.pause();
+        }
+        const ret = this[DISCARDED] ? false : super.emit('data', data);
+        this[MAYBE_EMIT_END]();
+        return ret;
+    }
+    [EMITEND]() {
+        if (this[EMITTED_END])
+            return false;
+        this[EMITTED_END] = true;
+        this.readable = false;
+        return this[ASYNC]
+            ? (defer$3(() => this[EMITEND2]()), true)
+            : this[EMITEND2]();
+    }
+    [EMITEND2]() {
+        if (this[DECODER]) {
+            const data = this[DECODER].end();
+            if (data) {
+                for (const p of this[PIPES]) {
+                    p.dest.write(data);
+                }
+                if (!this[DISCARDED])
+                    super.emit('data', data);
+            }
+        }
+        for (const p of this[PIPES]) {
+            p.end();
+        }
+        const ret = super.emit('end');
+        this.removeAllListeners('end');
+        return ret;
+    }
+    /**
+     * Return a Promise that resolves to an array of all emitted data once
+     * the stream ends.
+     */
+    async collect() {
+        const buf = Object.assign([], {
+            dataLength: 0,
+        });
+        if (!this[OBJECTMODE])
+            buf.dataLength = 0;
+        // set the promise first, in case an error is raised
+        // by triggering the flow here.
+        const p = this.promise();
+        this.on('data', c => {
+            buf.push(c);
+            if (!this[OBJECTMODE])
+                buf.dataLength += c.length;
+        });
+        await p;
+        return buf;
+    }
+    /**
+     * Return a Promise that resolves to the concatenation of all emitted data
+     * once the stream ends.
+     *
+     * Not allowed on objectMode streams.
+     */
+    async concat() {
+        if (this[OBJECTMODE]) {
+            throw new Error('cannot concat in objectMode');
+        }
+        const buf = await this.collect();
+        return (this[ENCODING$1]
+            ? buf.join('')
+            : Buffer.concat(buf, buf.dataLength));
+    }
+    /**
+     * Return a void Promise that resolves once the stream ends.
+     */
+    async promise() {
+        return new Promise((resolve, reject) => {
+            this.on(DESTROYED, () => reject(new Error('stream destroyed')));
+            this.on('error', er => reject(er));
+            this.on('end', () => resolve());
+        });
+    }
+    /**
+     * Asynchronous `for await of` iteration.
+     *
+     * This will continue emitting all chunks until the stream terminates.
+     */
+    [Symbol.asyncIterator]() {
+        // set this up front, in case the consumer doesn't call next()
+        // right away.
+        this[DISCARDED] = false;
+        let stopped = false;
+        const stop = async () => {
+            this.pause();
+            stopped = true;
+            return { value: undefined, done: true };
+        };
+        const next = () => {
+            if (stopped)
+                return stop();
+            const res = this.read();
+            if (res !== null)
+                return Promise.resolve({ done: false, value: res });
+            if (this[EOF])
+                return stop();
+            let resolve;
+            let reject;
+            const onerr = (er) => {
+                this.off('data', ondata);
+                this.off('end', onend);
+                this.off(DESTROYED, ondestroy);
+                stop();
+                reject(er);
+            };
+            const ondata = (value) => {
+                this.off('error', onerr);
+                this.off('end', onend);
+                this.off(DESTROYED, ondestroy);
+                this.pause();
+                resolve({ value, done: !!this[EOF] });
+            };
+            const onend = () => {
+                this.off('error', onerr);
+                this.off('data', ondata);
+                this.off(DESTROYED, ondestroy);
+                stop();
+                resolve({ done: true, value: undefined });
+            };
+            const ondestroy = () => onerr(new Error('stream destroyed'));
+            return new Promise((res, rej) => {
+                reject = rej;
+                resolve = res;
+                this.once(DESTROYED, ondestroy);
+                this.once('error', onerr);
+                this.once('end', onend);
+                this.once('data', ondata);
+            });
+        };
+        return {
+            next,
+            throw: stop,
+            return: stop,
+            [Symbol.asyncIterator]() {
+                return this;
+            },
+        };
+    }
+    /**
+     * Synchronous `for of` iteration.
+     *
+     * The iteration will terminate when the internal buffer runs out, even
+     * if the stream has not yet terminated.
+     */
+    [Symbol.iterator]() {
+        // set this up front, in case the consumer doesn't call next()
+        // right away.
+        this[DISCARDED] = false;
+        let stopped = false;
+        const stop = () => {
+            this.pause();
+            this.off(ERROR, stop);
+            this.off(DESTROYED, stop);
+            this.off('end', stop);
+            stopped = true;
+            return { done: true, value: undefined };
+        };
+        const next = () => {
+            if (stopped)
+                return stop();
+            const value = this.read();
+            return value === null ? stop() : { done: false, value };
+        };
+        this.once('end', stop);
+        this.once(ERROR, stop);
+        this.once(DESTROYED, stop);
+        return {
+            next,
+            throw: stop,
+            return: stop,
+            [Symbol.iterator]() {
+                return this;
+            },
+        };
+    }
+    /**
+     * Destroy a stream, preventing it from being used for any further purpose.
+     *
+     * If the stream has a `close()` method, then it will be called on
+     * destruction.
+     *
+     * After destruction, any attempt to write data, read data, or emit most
+     * events will be ignored.
+     *
+     * If an error argument is provided, then it will be emitted in an
+     * 'error' event.
+     */
+    destroy(er) {
+        if (this[DESTROYED]) {
+            if (er)
+                this.emit('error', er);
+            else
+                this.emit(DESTROYED);
+            return this;
+        }
+        this[DESTROYED] = true;
+        this[DISCARDED] = true;
+        // throw away all buffered data, it's never coming out
+        this[BUFFER].length = 0;
+        this[BUFFERLENGTH] = 0;
+        const wc = this;
+        if (typeof wc.close === 'function' && !this[CLOSED$1])
+            wc.close();
+        if (er)
+            this.emit('error', er);
+        // if no error to emit, still reject pending promises
+        else
+            this.emit(DESTROYED);
+        return this;
+    }
+    /**
+     * Alias for {@link isStream}
+     *
+     * Former export location, maintained for backwards compatibility.
+     *
+     * @deprecated
+     */
+    static get isStream() {
+        return isStream;
+    }
+}
+
+const realpathSync = realpathSync$1.native;
+const defaultFS = {
+    lstatSync,
+    readdir: readdir$4,
+    readdirSync,
+    readlinkSync,
+    realpathSync,
+    promises: {
+        lstat: lstat$3,
+        readdir: readdir$5,
+        readlink,
+        realpath: realpath$2,
+    },
+};
+// if they just gave us require('fs') then use our default
+const fsFromOption = (fsOption) => !fsOption || fsOption === defaultFS || fsOption === fs$j ?
+    defaultFS
+    : {
+        ...defaultFS,
+        ...fsOption,
+        promises: {
+            ...defaultFS.promises,
+            ...(fsOption.promises || {}),
+        },
+    };
+// turn something like //?/c:/ into c:\
+const uncDriveRegexp = /^\\\\\?\\([a-z]:)\\?$/i;
+const uncToDrive = (rootPath) => rootPath.replace(/\//g, '\\').replace(uncDriveRegexp, '$1\\');
+// windows paths are separated by either / or \
+const eitherSep = /[\\\/]/;
+const UNKNOWN = 0; // may not even exist, for all we know
+const IFIFO = 0b0001;
+const IFCHR = 0b0010;
+const IFDIR = 0b0100;
+const IFBLK = 0b0110;
+const IFREG = 0b1000;
+const IFLNK = 0b1010;
+const IFSOCK = 0b1100;
+const IFMT = 0b1111;
+// mask to unset low 4 bits
+const IFMT_UNKNOWN = ~IFMT;
+// set after successfully calling readdir() and getting entries.
+const READDIR_CALLED = 0b0000_0001_0000;
+// set after a successful lstat()
+const LSTAT_CALLED = 0b0000_0010_0000;
+// set if an entry (or one of its parents) is definitely not a dir
+const ENOTDIR = 0b0000_0100_0000;
+// set if an entry (or one of its parents) does not exist
+// (can also be set on lstat errors like EACCES or ENAMETOOLONG)
+const ENOENT = 0b0000_1000_0000;
+// cannot have child entries -- also verify &IFMT is either IFDIR or IFLNK
+// set if we fail to readlink
+const ENOREADLINK = 0b0001_0000_0000;
+// set if we know realpath() will fail
+const ENOREALPATH = 0b0010_0000_0000;
+const ENOCHILD = ENOTDIR | ENOENT | ENOREALPATH;
+const TYPEMASK = 0b0011_1111_1111;
+const entToType = (s) => s.isFile() ? IFREG
+    : s.isDirectory() ? IFDIR
+        : s.isSymbolicLink() ? IFLNK
+            : s.isCharacterDevice() ? IFCHR
+                : s.isBlockDevice() ? IFBLK
+                    : s.isSocket() ? IFSOCK
+                        : s.isFIFO() ? IFIFO
+                            : UNKNOWN;
+// normalize unicode path names
+const normalizeCache = new Map();
+const normalize = (s) => {
+    const c = normalizeCache.get(s);
+    if (c)
+        return c;
+    const n = s.normalize('NFKD');
+    normalizeCache.set(s, n);
+    return n;
+};
+const normalizeNocaseCache = new Map();
+const normalizeNocase = (s) => {
+    const c = normalizeNocaseCache.get(s);
+    if (c)
+        return c;
+    const n = normalize(s.toLowerCase());
+    normalizeNocaseCache.set(s, n);
+    return n;
+};
+/**
+ * An LRUCache for storing resolved path strings or Path objects.
+ * @internal
+ */
+class ResolveCache extends LRUCache {
+    constructor() {
+        super({ max: 256 });
+    }
+}
+// In order to prevent blowing out the js heap by allocating hundreds of
+// thousands of Path entries when walking extremely large trees, the "children"
+// in this tree are represented by storing an array of Path entries in an
+// LRUCache, indexed by the parent.  At any time, Path.children() may return an
+// empty array, indicating that it doesn't know about any of its children, and
+// thus has to rebuild that cache.  This is fine, it just means that we don't
+// benefit as much from having the cached entries, but huge directory walks
+// don't blow out the stack, and smaller ones are still as fast as possible.
+//
+//It does impose some complexity when building up the readdir data, because we
+//need to pass a reference to the children array that we started with.
+/**
+ * an LRUCache for storing child entries.
+ * @internal
+ */
+class ChildrenCache extends LRUCache {
+    constructor(maxSize = 16 * 1024) {
+        super({
+            maxSize,
+            // parent + children
+            sizeCalculation: a => a.length + 1,
+        });
+    }
+}
+const setAsCwd = Symbol('PathScurry setAsCwd');
+/**
+ * Path objects are sort of like a super-powered
+ * {@link https://nodejs.org/docs/latest/api/fs.html#class-fsdirent fs.Dirent}
+ *
+ * Each one represents a single filesystem entry on disk, which may or may not
+ * exist. It includes methods for reading various types of information via
+ * lstat, readlink, and readdir, and caches all information to the greatest
+ * degree possible.
+ *
+ * Note that fs operations that would normally throw will instead return an
+ * "empty" value. This is in order to prevent excessive overhead from error
+ * stack traces.
+ */
+class PathBase {
+    /**
+     * the basename of this path
+     *
+     * **Important**: *always* test the path name against any test string
+     * usingthe {@link isNamed} method, and not by directly comparing this
+     * string. Otherwise, unicode path strings that the system sees as identical
+     * will not be properly treated as the same path, leading to incorrect
+     * behavior and possible security issues.
+     */
+    name;
+    /**
+     * the Path entry corresponding to the path root.
+     *
+     * @internal
+     */
+    root;
+    /**
+     * All roots found within the current PathScurry family
+     *
+     * @internal
+     */
+    roots;
+    /**
+     * a reference to the parent path, or undefined in the case of root entries
+     *
+     * @internal
+     */
+    parent;
+    /**
+     * boolean indicating whether paths are compared case-insensitively
+     * @internal
+     */
+    nocase;
+    /**
+     * boolean indicating that this path is the current working directory
+     * of the PathScurry collection that contains it.
+     */
+    isCWD = false;
+    // potential default fs override
+    #fs;
+    // Stats fields
+    #dev;
+    get dev() {
+        return this.#dev;
+    }
+    #mode;
+    get mode() {
+        return this.#mode;
+    }
+    #nlink;
+    get nlink() {
+        return this.#nlink;
+    }
+    #uid;
+    get uid() {
+        return this.#uid;
+    }
+    #gid;
+    get gid() {
+        return this.#gid;
+    }
+    #rdev;
+    get rdev() {
+        return this.#rdev;
+    }
+    #blksize;
+    get blksize() {
+        return this.#blksize;
+    }
+    #ino;
+    get ino() {
+        return this.#ino;
+    }
+    #size;
+    get size() {
+        return this.#size;
+    }
+    #blocks;
+    get blocks() {
+        return this.#blocks;
+    }
+    #atimeMs;
+    get atimeMs() {
+        return this.#atimeMs;
+    }
+    #mtimeMs;
+    get mtimeMs() {
+        return this.#mtimeMs;
+    }
+    #ctimeMs;
+    get ctimeMs() {
+        return this.#ctimeMs;
+    }
+    #birthtimeMs;
+    get birthtimeMs() {
+        return this.#birthtimeMs;
+    }
+    #atime;
+    get atime() {
+        return this.#atime;
+    }
+    #mtime;
+    get mtime() {
+        return this.#mtime;
+    }
+    #ctime;
+    get ctime() {
+        return this.#ctime;
+    }
+    #birthtime;
+    get birthtime() {
+        return this.#birthtime;
+    }
+    #matchName;
+    #depth;
+    #fullpath;
+    #fullpathPosix;
+    #relative;
+    #relativePosix;
+    #type;
+    #children;
+    #linkTarget;
+    #realpath;
+    /**
+     * This property is for compatibility with the Dirent class as of
+     * Node v20, where Dirent['parentPath'] refers to the path of the
+     * directory that was passed to readdir. For root entries, it's the path
+     * to the entry itself.
+     */
+    get parentPath() {
+        return (this.parent || this).fullpath();
+    }
+    /**
+     * Deprecated alias for Dirent['parentPath'] Somewhat counterintuitively,
+     * this property refers to the *parent* path, not the path object itself.
+     */
+    get path() {
+        return this.parentPath;
+    }
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        this.name = name;
+        this.#matchName = nocase ? normalizeNocase(name) : normalize(name);
+        this.#type = type & TYPEMASK;
+        this.nocase = nocase;
+        this.roots = roots;
+        this.root = root || this;
+        this.#children = children;
+        this.#fullpath = opts.fullpath;
+        this.#relative = opts.relative;
+        this.#relativePosix = opts.relativePosix;
+        this.parent = opts.parent;
+        if (this.parent) {
+            this.#fs = this.parent.#fs;
+        }
+        else {
+            this.#fs = fsFromOption(opts.fs);
+        }
+    }
+    /**
+     * Returns the depth of the Path object from its root.
+     *
+     * For example, a path at `/foo/bar` would have a depth of 2.
+     */
+    depth() {
+        if (this.#depth !== undefined)
+            return this.#depth;
+        if (!this.parent)
+            return (this.#depth = 0);
+        return (this.#depth = this.parent.depth() + 1);
+    }
+    /**
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Get the Path object referenced by the string path, resolved from this Path
+     */
+    resolve(path) {
+        if (!path) {
+            return this;
+        }
+        const rootPath = this.getRootString(path);
+        const dir = path.substring(rootPath.length);
+        const dirParts = dir.split(this.splitSep);
+        const result = rootPath ?
+            this.getRoot(rootPath).#resolveParts(dirParts)
+            : this.#resolveParts(dirParts);
+        return result;
+    }
+    #resolveParts(dirParts) {
+        let p = this;
+        for (const part of dirParts) {
+            p = p.child(part);
+        }
+        return p;
+    }
+    /**
+     * Returns the cached children Path objects, if still available.  If they
+     * have fallen out of the cache, then returns an empty array, and resets the
+     * READDIR_CALLED bit, so that future calls to readdir() will require an fs
+     * lookup.
+     *
+     * @internal
+     */
+    children() {
+        const cached = this.#children.get(this);
+        if (cached) {
+            return cached;
+        }
+        const children = Object.assign([], { provisional: 0 });
+        this.#children.set(this, children);
+        this.#type &= ~READDIR_CALLED;
+        return children;
+    }
+    /**
+     * Resolves a path portion and returns or creates the child Path.
+     *
+     * Returns `this` if pathPart is `''` or `'.'`, or `parent` if pathPart is
+     * `'..'`.
+     *
+     * This should not be called directly.  If `pathPart` contains any path
+     * separators, it will lead to unsafe undefined behavior.
+     *
+     * Use `Path.resolve()` instead.
+     *
+     * @internal
+     */
+    child(pathPart, opts) {
+        if (pathPart === '' || pathPart === '.') {
+            return this;
+        }
+        if (pathPart === '..') {
+            return this.parent || this;
+        }
+        // find the child
+        const children = this.children();
+        const name = this.nocase ? normalizeNocase(pathPart) : normalize(pathPart);
+        for (const p of children) {
+            if (p.#matchName === name) {
+                return p;
+            }
+        }
+        // didn't find it, create provisional child, since it might not
+        // actually exist.  If we know the parent isn't a dir, then
+        // in fact it CAN'T exist.
+        const s = this.parent ? this.sep : '';
+        const fullpath = this.#fullpath ? this.#fullpath + s + pathPart : undefined;
+        const pchild = this.newChild(pathPart, UNKNOWN, {
+            ...opts,
+            parent: this,
+            fullpath,
+        });
+        if (!this.canReaddir()) {
+            pchild.#type |= ENOENT;
+        }
+        // don't have to update provisional, because if we have real children,
+        // then provisional is set to children.length, otherwise a lower number
+        children.push(pchild);
+        return pchild;
+    }
+    /**
+     * The relative path from the cwd. If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpath()
+     */
+    relative() {
+        if (this.isCWD)
+            return '';
+        if (this.#relative !== undefined) {
+            return this.#relative;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relative = this.name);
+        }
+        const pv = p.relative();
+        return pv + (!pv || !p.parent ? '' : this.sep) + name;
+    }
+    /**
+     * The relative path from the cwd, using / as the path separator.
+     * If it does not share an ancestor with
+     * the cwd, then this ends up being equivalent to the fullpathPosix()
+     * On posix systems, this is identical to relative().
+     */
+    relativePosix() {
+        if (this.sep === '/')
+            return this.relative();
+        if (this.isCWD)
+            return '';
+        if (this.#relativePosix !== undefined)
+            return this.#relativePosix;
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#relativePosix = this.fullpathPosix());
+        }
+        const pv = p.relativePosix();
+        return pv + (!pv || !p.parent ? '' : '/') + name;
+    }
+    /**
+     * The fully resolved path string for this Path entry
+     */
+    fullpath() {
+        if (this.#fullpath !== undefined) {
+            return this.#fullpath;
+        }
+        const name = this.name;
+        const p = this.parent;
+        if (!p) {
+            return (this.#fullpath = this.name);
+        }
+        const pv = p.fullpath();
+        const fp = pv + (!p.parent ? '' : this.sep) + name;
+        return (this.#fullpath = fp);
+    }
+    /**
+     * On platforms other than windows, this is identical to fullpath.
+     *
+     * On windows, this is overridden to return the forward-slash form of the
+     * full UNC path.
+     */
+    fullpathPosix() {
+        if (this.#fullpathPosix !== undefined)
+            return this.#fullpathPosix;
+        if (this.sep === '/')
+            return (this.#fullpathPosix = this.fullpath());
+        if (!this.parent) {
+            const p = this.fullpath().replace(/\\/g, '/');
+            if (/^[a-z]:\//i.test(p)) {
+                return (this.#fullpathPosix = `//?/${p}`);
+            }
+            else {
+                return (this.#fullpathPosix = p);
+            }
+        }
+        const p = this.parent;
+        const pfpp = p.fullpathPosix();
+        const fpp = pfpp + (!pfpp || !p.parent ? '' : '/') + this.name;
+        return (this.#fullpathPosix = fpp);
+    }
+    /**
+     * Is the Path of an unknown type?
+     *
+     * Note that we might know *something* about it if there has been a previous
+     * filesystem operation, for example that it does not exist, or is not a
+     * link, or whether it has child entries.
+     */
+    isUnknown() {
+        return (this.#type & IFMT) === UNKNOWN;
+    }
+    isType(type) {
+        return this[`is${type}`]();
+    }
+    getType() {
+        return (this.isUnknown() ? 'Unknown'
+            : this.isDirectory() ? 'Directory'
+                : this.isFile() ? 'File'
+                    : this.isSymbolicLink() ? 'SymbolicLink'
+                        : this.isFIFO() ? 'FIFO'
+                            : this.isCharacterDevice() ? 'CharacterDevice'
+                                : this.isBlockDevice() ? 'BlockDevice'
+                                    : /* c8 ignore start */ this.isSocket() ? 'Socket'
+                                        : 'Unknown');
+        /* c8 ignore stop */
+    }
+    /**
+     * Is the Path a regular file?
+     */
+    isFile() {
+        return (this.#type & IFMT) === IFREG;
+    }
+    /**
+     * Is the Path a directory?
+     */
+    isDirectory() {
+        return (this.#type & IFMT) === IFDIR;
+    }
+    /**
+     * Is the path a character device?
+     */
+    isCharacterDevice() {
+        return (this.#type & IFMT) === IFCHR;
+    }
+    /**
+     * Is the path a block device?
+     */
+    isBlockDevice() {
+        return (this.#type & IFMT) === IFBLK;
+    }
+    /**
+     * Is the path a FIFO pipe?
+     */
+    isFIFO() {
+        return (this.#type & IFMT) === IFIFO;
+    }
+    /**
+     * Is the path a socket?
+     */
+    isSocket() {
+        return (this.#type & IFMT) === IFSOCK;
+    }
+    /**
+     * Is the path a symbolic link?
+     */
+    isSymbolicLink() {
+        return (this.#type & IFLNK) === IFLNK;
+    }
+    /**
+     * Return the entry if it has been subject of a successful lstat, or
+     * undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* simply
+     * mean that we haven't called lstat on it.
+     */
+    lstatCached() {
+        return this.#type & LSTAT_CALLED ? this : undefined;
+    }
+    /**
+     * Return the cached link target if the entry has been the subject of a
+     * successful readlink, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readlink() has been called at some point.
+     */
+    readlinkCached() {
+        return this.#linkTarget;
+    }
+    /**
+     * Returns the cached realpath target if the entry has been the subject
+     * of a successful realpath, or undefined otherwise.
+     *
+     * Does not read the filesystem, so an undefined result *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * realpath() has been called at some point.
+     */
+    realpathCached() {
+        return this.#realpath;
+    }
+    /**
+     * Returns the cached child Path entries array if the entry has been the
+     * subject of a successful readdir(), or [] otherwise.
+     *
+     * Does not read the filesystem, so an empty array *could* just mean we
+     * don't have any cached data. Only use it if you are very sure that a
+     * readdir() has been called recently enough to still be valid.
+     */
+    readdirCached() {
+        const children = this.children();
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * Return true if it's worth trying to readlink.  Ie, we don't (yet) have
+     * any indication that readlink will definitely fail.
+     *
+     * Returns false if the path is known to not be a symlink, if a previous
+     * readlink failed, or if the entry does not exist.
+     */
+    canReadlink() {
+        if (this.#linkTarget)
+            return true;
+        if (!this.parent)
+            return false;
+        // cases where it cannot possibly succeed
+        const ifmt = this.#type & IFMT;
+        return !((ifmt !== UNKNOWN && ifmt !== IFLNK) ||
+            this.#type & ENOREADLINK ||
+            this.#type & ENOENT);
+    }
+    /**
+     * Return true if readdir has previously been successfully called on this
+     * path, indicating that cachedReaddir() is likely valid.
+     */
+    calledReaddir() {
+        return !!(this.#type & READDIR_CALLED);
+    }
+    /**
+     * Returns true if the path is known to not exist. That is, a previous lstat
+     * or readdir failed to verify its existence when that would have been
+     * expected, or a parent entry was marked either enoent or enotdir.
+     */
+    isENOENT() {
+        return !!(this.#type & ENOENT);
+    }
+    /**
+     * Return true if the path is a match for the given path name.  This handles
+     * case sensitivity and unicode normalization.
+     *
+     * Note: even on case-sensitive systems, it is **not** safe to test the
+     * equality of the `.name` property to determine whether a given pathname
+     * matches, due to unicode normalization mismatches.
+     *
+     * Always use this method instead of testing the `path.name` property
+     * directly.
+     */
+    isNamed(n) {
+        return !this.nocase ?
+            this.#matchName === normalize(n)
+            : this.#matchName === normalizeNocase(n);
+    }
+    /**
+     * Return the Path object corresponding to the target of a symbolic link.
+     *
+     * If the Path is not a symbolic link, or if the readlink call fails for any
+     * reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     */
+    async readlink() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = await this.#fs.promises.readlink(this.fullpath());
+            const linkTarget = (await this.parent.realpath())?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    /**
+     * Synchronous {@link PathBase.readlink}
+     */
+    readlinkSync() {
+        const target = this.#linkTarget;
+        if (target) {
+            return target;
+        }
+        if (!this.canReadlink()) {
+            return undefined;
+        }
+        /* c8 ignore start */
+        // already covered by the canReadlink test, here for ts grumples
+        if (!this.parent) {
+            return undefined;
+        }
+        /* c8 ignore stop */
+        try {
+            const read = this.#fs.readlinkSync(this.fullpath());
+            const linkTarget = this.parent.realpathSync()?.resolve(read);
+            if (linkTarget) {
+                return (this.#linkTarget = linkTarget);
+            }
+        }
+        catch (er) {
+            this.#readlinkFail(er.code);
+            return undefined;
+        }
+    }
+    #readdirSuccess(children) {
+        // succeeded, mark readdir called bit
+        this.#type |= READDIR_CALLED;
+        // mark all remaining provisional children as ENOENT
+        for (let p = children.provisional; p < children.length; p++) {
+            const c = children[p];
+            if (c)
+                c.#markENOENT();
+        }
+    }
+    #markENOENT() {
+        // mark as UNKNOWN and ENOENT
+        if (this.#type & ENOENT)
+            return;
+        this.#type = (this.#type | ENOENT) & IFMT_UNKNOWN;
+        this.#markChildrenENOENT();
+    }
+    #markChildrenENOENT() {
+        // all children are provisional and do not exist
+        const children = this.children();
+        children.provisional = 0;
+        for (const p of children) {
+            p.#markENOENT();
+        }
+    }
+    #markENOREALPATH() {
+        this.#type |= ENOREALPATH;
+        this.#markENOTDIR();
+    }
+    // save the information when we know the entry is not a dir
+    #markENOTDIR() {
+        // entry is not a directory, so any children can't exist.
+        // this *should* be impossible, since any children created
+        // after it's been marked ENOTDIR should be marked ENOENT,
+        // so it won't even get to this point.
+        /* c8 ignore start */
+        if (this.#type & ENOTDIR)
+            return;
+        /* c8 ignore stop */
+        let t = this.#type;
+        // this could happen if we stat a dir, then delete it,
+        // then try to read it or one of its children.
+        if ((t & IFMT) === IFDIR)
+            t &= IFMT_UNKNOWN;
+        this.#type = t | ENOTDIR;
+        this.#markChildrenENOENT();
+    }
+    #readdirFail(code = '') {
+        // markENOTDIR and markENOENT also set provisional=0
+        if (code === 'ENOTDIR' || code === 'EPERM') {
+            this.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            this.#markENOENT();
+        }
+        else {
+            this.children().provisional = 0;
+        }
+    }
+    #lstatFail(code = '') {
+        // Windows just raises ENOENT in this case, disable for win CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR') {
+            // already know it has a parent by this point
+            const p = this.parent;
+            p.#markENOTDIR();
+        }
+        else if (code === 'ENOENT') {
+            /* c8 ignore stop */
+            this.#markENOENT();
+        }
+    }
+    #readlinkFail(code = '') {
+        let ter = this.#type;
+        ter |= ENOREADLINK;
+        if (code === 'ENOENT')
+            ter |= ENOENT;
+        // windows gets a weird error when you try to readlink a file
+        if (code === 'EINVAL' || code === 'UNKNOWN') {
+            // exists, but not a symlink, we don't know WHAT it is, so remove
+            // all IFMT bits.
+            ter &= IFMT_UNKNOWN;
+        }
+        this.#type = ter;
+        // windows just gets ENOENT in this case.  We do cover the case,
+        // just disabled because it's impossible on Windows CI
+        /* c8 ignore start */
+        if (code === 'ENOTDIR' && this.parent) {
+            this.parent.#markENOTDIR();
+        }
+        /* c8 ignore stop */
+    }
+    #readdirAddChild(e, c) {
+        return (this.#readdirMaybePromoteChild(e, c) ||
+            this.#readdirAddNewChild(e, c));
+    }
+    #readdirAddNewChild(e, c) {
+        // alloc new entry at head, so it's never provisional
+        const type = entToType(e);
+        const child = this.newChild(e.name, type, { parent: this });
+        const ifmt = child.#type & IFMT;
+        if (ifmt !== IFDIR && ifmt !== IFLNK && ifmt !== UNKNOWN) {
+            child.#type |= ENOTDIR;
+        }
+        c.unshift(child);
+        c.provisional++;
+        return child;
+    }
+    #readdirMaybePromoteChild(e, c) {
+        for (let p = c.provisional; p < c.length; p++) {
+            const pchild = c[p];
+            const name = this.nocase ? normalizeNocase(e.name) : normalize(e.name);
+            if (name !== pchild.#matchName) {
+                continue;
+            }
+            return this.#readdirPromoteChild(e, pchild, p, c);
+        }
+    }
+    #readdirPromoteChild(e, p, index, c) {
+        const v = p.name;
+        // retain any other flags, but set ifmt from dirent
+        p.#type = (p.#type & IFMT_UNKNOWN) | entToType(e);
+        // case sensitivity fixing when we learn the true name.
+        if (v !== e.name)
+            p.name = e.name;
+        // just advance provisional index (potentially off the list),
+        // otherwise we have to splice/pop it out and re-insert at head
+        if (index !== c.provisional) {
+            if (index === c.length - 1)
+                c.pop();
+            else
+                c.splice(index, 1);
+            c.unshift(p);
+        }
+        c.provisional++;
+        return p;
+    }
+    /**
+     * Call lstat() on this Path, and update all known information that can be
+     * determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(await this.#fs.promises.lstat(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    /**
+     * synchronous {@link PathBase.lstat}
+     */
+    lstatSync() {
+        if ((this.#type & ENOENT) === 0) {
+            try {
+                this.#applyStat(this.#fs.lstatSync(this.fullpath()));
+                return this;
+            }
+            catch (er) {
+                this.#lstatFail(er.code);
+            }
+        }
+    }
+    #applyStat(st) {
+        const { atime, atimeMs, birthtime, birthtimeMs, blksize, blocks, ctime, ctimeMs, dev, gid, ino, mode, mtime, mtimeMs, nlink, rdev, size, uid, } = st;
+        this.#atime = atime;
+        this.#atimeMs = atimeMs;
+        this.#birthtime = birthtime;
+        this.#birthtimeMs = birthtimeMs;
+        this.#blksize = blksize;
+        this.#blocks = blocks;
+        this.#ctime = ctime;
+        this.#ctimeMs = ctimeMs;
+        this.#dev = dev;
+        this.#gid = gid;
+        this.#ino = ino;
+        this.#mode = mode;
+        this.#mtime = mtime;
+        this.#mtimeMs = mtimeMs;
+        this.#nlink = nlink;
+        this.#rdev = rdev;
+        this.#size = size;
+        this.#uid = uid;
+        const ifmt = entToType(st);
+        // retain any other flags, but set the ifmt
+        this.#type = (this.#type & IFMT_UNKNOWN) | ifmt | LSTAT_CALLED;
+        if (ifmt !== UNKNOWN && ifmt !== IFDIR && ifmt !== IFLNK) {
+            this.#type |= ENOTDIR;
+        }
+    }
+    #onReaddirCB = [];
+    #readdirCBInFlight = false;
+    #callOnReaddirCB(children) {
+        this.#readdirCBInFlight = false;
+        const cbs = this.#onReaddirCB.slice();
+        this.#onReaddirCB.length = 0;
+        cbs.forEach(cb => cb(null, children));
+    }
+    /**
+     * Standard node-style callback interface to get list of directory entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     *
+     * @param cb The callback called with (er, entries).  Note that the `er`
+     * param is somewhat extraneous, as all readdir() errors are handled and
+     * simply result in an empty set of entries being returned.
+     * @param allowZalgo Boolean indicating that immediately known results should
+     * *not* be deferred with `queueMicrotask`. Defaults to `false`. Release
+     * zalgo at your peril, the dark pony lord is devious and unforgiving.
+     */
+    readdirCB(cb, allowZalgo = false) {
+        if (!this.canReaddir()) {
+            if (allowZalgo)
+                cb(null, []);
+            else
+                queueMicrotask(() => cb(null, []));
+            return;
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            const c = children.slice(0, children.provisional);
+            if (allowZalgo)
+                cb(null, c);
+            else
+                queueMicrotask(() => cb(null, c));
+            return;
+        }
+        // don't have to worry about zalgo at this point.
+        this.#onReaddirCB.push(cb);
+        if (this.#readdirCBInFlight) {
+            return;
+        }
+        this.#readdirCBInFlight = true;
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        this.#fs.readdir(fullpath, { withFileTypes: true }, (er, entries) => {
+            if (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            else {
+                // if we didn't get an error, we always get entries.
+                //@ts-ignore
+                for (const e of entries) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            this.#callOnReaddirCB(children.slice(0, children.provisional));
+            return;
+        });
+    }
+    #asyncReaddirInFlight;
+    /**
+     * Return an array of known child entries.
+     *
+     * If the Path cannot or does not contain any children, then an empty array
+     * is returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async readdir() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        if (this.#asyncReaddirInFlight) {
+            await this.#asyncReaddirInFlight;
+        }
+        else {
+            /* c8 ignore start */
+            let resolve = () => { };
+            /* c8 ignore stop */
+            this.#asyncReaddirInFlight = new Promise(res => (resolve = res));
+            try {
+                for (const e of await this.#fs.promises.readdir(fullpath, {
+                    withFileTypes: true,
+                })) {
+                    this.#readdirAddChild(e, children);
+                }
+                this.#readdirSuccess(children);
+            }
+            catch (er) {
+                this.#readdirFail(er.code);
+                children.provisional = 0;
+            }
+            this.#asyncReaddirInFlight = undefined;
+            resolve();
+        }
+        return children.slice(0, children.provisional);
+    }
+    /**
+     * synchronous {@link PathBase.readdir}
+     */
+    readdirSync() {
+        if (!this.canReaddir()) {
+            return [];
+        }
+        const children = this.children();
+        if (this.calledReaddir()) {
+            return children.slice(0, children.provisional);
+        }
+        // else read the directory, fill up children
+        // de-provisionalize any provisional children.
+        const fullpath = this.fullpath();
+        try {
+            for (const e of this.#fs.readdirSync(fullpath, {
+                withFileTypes: true,
+            })) {
+                this.#readdirAddChild(e, children);
+            }
+            this.#readdirSuccess(children);
+        }
+        catch (er) {
+            this.#readdirFail(er.code);
+            children.provisional = 0;
+        }
+        return children.slice(0, children.provisional);
+    }
+    canReaddir() {
+        if (this.#type & ENOCHILD)
+            return false;
+        const ifmt = IFMT & this.#type;
+        // we always set ENOTDIR when setting IFMT, so should be impossible
+        /* c8 ignore start */
+        if (!(ifmt === UNKNOWN || ifmt === IFDIR || ifmt === IFLNK)) {
+            return false;
+        }
+        /* c8 ignore stop */
+        return true;
+    }
+    shouldWalk(dirs, walkFilter) {
+        return ((this.#type & IFDIR) === IFDIR &&
+            !(this.#type & ENOCHILD) &&
+            !dirs.has(this) &&
+            (!walkFilter || walkFilter(this)));
+    }
+    /**
+     * Return the Path object corresponding to path as resolved
+     * by realpath(3).
+     *
+     * If the realpath call fails for any reason, `undefined` is returned.
+     *
+     * Result is cached, and thus may be outdated if the filesystem is mutated.
+     * On success, returns a Path object.
+     */
+    async realpath() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = await this.#fs.promises.realpath(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Synchronous {@link realpath}
+     */
+    realpathSync() {
+        if (this.#realpath)
+            return this.#realpath;
+        if ((ENOREALPATH | ENOREADLINK | ENOENT) & this.#type)
+            return undefined;
+        try {
+            const rp = this.#fs.realpathSync(this.fullpath());
+            return (this.#realpath = this.resolve(rp));
+        }
+        catch (_) {
+            this.#markENOREALPATH();
+        }
+    }
+    /**
+     * Internal method to mark this Path object as the scurry cwd,
+     * called by {@link PathScurry#chdir}
+     *
+     * @internal
+     */
+    [setAsCwd](oldCwd) {
+        if (oldCwd === this)
+            return;
+        oldCwd.isCWD = false;
+        this.isCWD = true;
+        const changed = new Set([]);
+        let rp = [];
+        let p = this;
+        while (p && p.parent) {
+            changed.add(p);
+            p.#relative = rp.join(this.sep);
+            p.#relativePosix = rp.join('/');
+            p = p.parent;
+            rp.push('..');
+        }
+        // now un-memoize parents of old cwd
+        p = oldCwd;
+        while (p && p.parent && !changed.has(p)) {
+            p.#relative = undefined;
+            p.#relativePosix = undefined;
+            p = p.parent;
+        }
+    }
+}
+/**
+ * Path class used on win32 systems
+ *
+ * Uses `'\\'` as the path separator for returned paths, either `'\\'` or `'/'`
+ * as the path separator for parsing paths.
+ */
+class PathWin32 extends PathBase {
+    /**
+     * Separator for generating path strings.
+     */
+    sep = '\\';
+    /**
+     * Separator for parsing path strings.
+     */
+    splitSep = eitherSep;
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathWin32(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return win32$1.parse(path).root;
+    }
+    /**
+     * @internal
+     */
+    getRoot(rootPath) {
+        rootPath = uncToDrive(rootPath.toUpperCase());
+        if (rootPath === this.root.name) {
+            return this.root;
+        }
+        // ok, not that one, check if it matches another we know about
+        for (const [compare, root] of Object.entries(this.roots)) {
+            if (this.sameRoot(rootPath, compare)) {
+                return (this.roots[rootPath] = root);
+            }
+        }
+        // otherwise, have to create a new one.
+        return (this.roots[rootPath] = new PathScurryWin32(rootPath, this).root);
+    }
+    /**
+     * @internal
+     */
+    sameRoot(rootPath, compare = this.root.name) {
+        // windows can (rarely) have case-sensitive filesystem, but
+        // UNC and drive letters are always case-insensitive, and canonically
+        // represented uppercase.
+        rootPath = rootPath
+            .toUpperCase()
+            .replace(/\//g, '\\')
+            .replace(uncDriveRegexp, '$1\\');
+        return rootPath === compare;
+    }
+}
+/**
+ * Path class used on all posix systems.
+ *
+ * Uses `'/'` as the path separator.
+ */
+class PathPosix extends PathBase {
+    /**
+     * separator for parsing path strings
+     */
+    splitSep = '/';
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    /**
+     * Do not create new Path objects directly.  They should always be accessed
+     * via the PathScurry class or other methods on the Path class.
+     *
+     * @internal
+     */
+    constructor(name, type = UNKNOWN, root, roots, nocase, children, opts) {
+        super(name, type, root, roots, nocase, children, opts);
+    }
+    /**
+     * @internal
+     */
+    getRootString(path) {
+        return path.startsWith('/') ? '/' : '';
+    }
+    /**
+     * @internal
+     */
+    getRoot(_rootPath) {
+        return this.root;
+    }
+    /**
+     * @internal
+     */
+    newChild(name, type = UNKNOWN, opts = {}) {
+        return new PathPosix(name, type, this.root, this.roots, this.nocase, this.childrenCache(), opts);
+    }
+}
+/**
+ * The base class for all PathScurry classes, providing the interface for path
+ * resolution and filesystem operations.
+ *
+ * Typically, you should *not* instantiate this class directly, but rather one
+ * of the platform-specific classes, or the exported {@link PathScurry} which
+ * defaults to the current platform.
+ */
+class PathScurryBase {
+    /**
+     * The root Path entry for the current working directory of this Scurry
+     */
+    root;
+    /**
+     * The string path for the root of this Scurry's current working directory
+     */
+    rootPath;
+    /**
+     * A collection of all roots encountered, referenced by rootPath
+     */
+    roots;
+    /**
+     * The Path entry corresponding to this PathScurry's current working directory.
+     */
+    cwd;
+    #resolveCache;
+    #resolvePosixCache;
+    #children;
+    /**
+     * Perform path comparisons case-insensitively.
+     *
+     * Defaults true on Darwin and Windows systems, false elsewhere.
+     */
+    nocase;
+    #fs;
+    /**
+     * This class should not be instantiated directly.
+     *
+     * Use PathScurryWin32, PathScurryDarwin, PathScurryPosix, or PathScurry
+     *
+     * @internal
+     */
+    constructor(cwd = process.cwd(), pathImpl, sep, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS, } = {}) {
+        this.#fs = fsFromOption(fs);
+        if (cwd instanceof URL || cwd.startsWith('file://')) {
+            cwd = fileURLToPath(cwd);
+        }
+        // resolve and split root, and then add to the store.
+        // this is the only time we call path.resolve()
+        const cwdPath = pathImpl.resolve(cwd);
+        this.roots = Object.create(null);
+        this.rootPath = this.parseRootPath(cwdPath);
+        this.#resolveCache = new ResolveCache();
+        this.#resolvePosixCache = new ResolveCache();
+        this.#children = new ChildrenCache(childrenCacheSize);
+        const split = cwdPath.substring(this.rootPath.length).split(sep);
+        // resolve('/') leaves '', splits to [''], we don't want that.
+        if (split.length === 1 && !split[0]) {
+            split.pop();
+        }
+        /* c8 ignore start */
+        if (nocase === undefined) {
+            throw new TypeError('must provide nocase setting to PathScurryBase ctor');
+        }
+        /* c8 ignore stop */
+        this.nocase = nocase;
+        this.root = this.newRoot(this.#fs);
+        this.roots[this.rootPath] = this.root;
+        let prev = this.root;
+        let len = split.length - 1;
+        const joinSep = pathImpl.sep;
+        let abs = this.rootPath;
+        let sawFirst = false;
+        for (const part of split) {
+            const l = len--;
+            prev = prev.child(part, {
+                relative: new Array(l).fill('..').join(joinSep),
+                relativePosix: new Array(l).fill('..').join('/'),
+                fullpath: (abs += (sawFirst ? '' : joinSep) + part),
+            });
+            sawFirst = true;
+        }
+        this.cwd = prev;
+    }
+    /**
+     * Get the depth of a provided path, string, or the cwd
+     */
+    depth(path = this.cwd) {
+        if (typeof path === 'string') {
+            path = this.cwd.resolve(path);
+        }
+        return path.depth();
+    }
+    /**
+     * Return the cache of child entries.  Exposed so subclasses can create
+     * child Path objects in a platform-specific way.
+     *
+     * @internal
+     */
+    childrenCache() {
+        return this.#children;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolve(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolveCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpath();
+        this.#resolveCache.set(r, result);
+        return result;
+    }
+    /**
+     * Resolve one or more path strings to a resolved string, returning
+     * the posix path.  Identical to .resolve() on posix systems, but on
+     * windows will return a forward-slash separated UNC path.
+     *
+     * Same interface as require('path').resolve.
+     *
+     * Much faster than path.resolve() when called multiple times for the same
+     * path, because the resolved Path objects are cached.  Much slower
+     * otherwise.
+     */
+    resolvePosix(...paths) {
+        // first figure out the minimum number of paths we have to test
+        // we always start at cwd, but any absolutes will bump the start
+        let r = '';
+        for (let i = paths.length - 1; i >= 0; i--) {
+            const p = paths[i];
+            if (!p || p === '.')
+                continue;
+            r = r ? `${p}/${r}` : p;
+            if (this.isAbsolute(p)) {
+                break;
+            }
+        }
+        const cached = this.#resolvePosixCache.get(r);
+        if (cached !== undefined) {
+            return cached;
+        }
+        const result = this.cwd.resolve(r).fullpathPosix();
+        this.#resolvePosixCache.set(r, result);
+        return result;
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or entry
+     */
+    relative(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relative();
+    }
+    /**
+     * find the relative path from the cwd to the supplied path string or
+     * entry, using / as the path delimiter, even on Windows.
+     */
+    relativePosix(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.relativePosix();
+    }
+    /**
+     * Return the basename for the provided string or Path object
+     */
+    basename(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.name;
+    }
+    /**
+     * Return the dirname for the provided string or Path object
+     */
+    dirname(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return (entry.parent || entry).fullpath();
+    }
+    async readdir(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else {
+            const p = await entry.readdir();
+            return withFileTypes ? p : p.map(e => e.name);
+        }
+    }
+    readdirSync(entry = this.cwd, opts = {
+        withFileTypes: true,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true } = opts;
+        if (!entry.canReaddir()) {
+            return [];
+        }
+        else if (withFileTypes) {
+            return entry.readdirSync();
+        }
+        else {
+            return entry.readdirSync().map(e => e.name);
+        }
+    }
+    /**
+     * Call lstat() on the string or Path object, and update all known
+     * information that can be determined.
+     *
+     * Note that unlike `fs.lstat()`, the returned value does not contain some
+     * information, such as `mode`, `dev`, `nlink`, and `ino`.  If that
+     * information is required, you will need to call `fs.lstat` yourself.
+     *
+     * If the Path refers to a nonexistent file, or if the lstat call fails for
+     * any reason, `undefined` is returned.  Otherwise the updated Path object is
+     * returned.
+     *
+     * Results are cached, and thus may be out of date if the filesystem is
+     * mutated.
+     */
+    async lstat(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstat();
+    }
+    /**
+     * synchronous {@link PathScurryBase.lstat}
+     */
+    lstatSync(entry = this.cwd) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        return entry.lstatSync();
+    }
+    async readlink(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.readlink();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    readlinkSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.readlinkSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async realpath(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = await entry.realpath();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    realpathSync(entry = this.cwd, { withFileTypes } = {
+        withFileTypes: false,
+    }) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            withFileTypes = entry.withFileTypes;
+            entry = this.cwd;
+        }
+        const e = entry.realpathSync();
+        return withFileTypes ? e : e?.fullpath();
+    }
+    async walk(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const walk = (dir, cb) => {
+            dirs.add(dir);
+            dir.readdirCB((er, entries) => {
+                /* c8 ignore start */
+                if (er) {
+                    return cb(er);
+                }
+                /* c8 ignore stop */
+                let len = entries.length;
+                if (!len)
+                    return cb();
+                const next = () => {
+                    if (--len === 0) {
+                        cb();
+                    }
+                };
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        results.push(withFileTypes ? e : e.fullpath());
+                    }
+                    if (follow && e.isSymbolicLink()) {
+                        e.realpath()
+                            .then(r => (r?.isUnknown() ? r.lstat() : r))
+                            .then(r => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
+                    }
+                    else {
+                        if (e.shouldWalk(dirs, walkFilter)) {
+                            walk(e, next);
+                        }
+                        else {
+                            next();
+                        }
+                    }
+                }
+            }, true); // zalgooooooo
+        };
+        const start = entry;
+        return new Promise((res, rej) => {
+            walk(start, er => {
+                /* c8 ignore start */
+                if (er)
+                    return rej(er);
+                /* c8 ignore stop */
+                res(results);
+            });
+        });
+    }
+    walkSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = [];
+        if (!filter || filter(entry)) {
+            results.push(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    results.push(withFileTypes ? e : e.fullpath());
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+        return results;
+    }
+    /**
+     * Support for `for await`
+     *
+     * Alias for {@link PathScurryBase.iterate}
+     *
+     * Note: As of Node 19, this is very slow, compared to other methods of
+     * walking.  Consider using {@link PathScurryBase.stream} if memory overhead
+     * and backpressure are concerns, or {@link PathScurryBase.walk} if not.
+     */
+    [Symbol.asyncIterator]() {
+        return this.iterate();
+    }
+    iterate(entry = this.cwd, options = {}) {
+        // iterating async over the stream is significantly more performant,
+        // especially in the warm-cache scenario, because it buffers up directory
+        // entries in the background instead of waiting for a yield for each one.
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            options = entry;
+            entry = this.cwd;
+        }
+        return this.stream(entry, options)[Symbol.asyncIterator]();
+    }
+    /**
+     * Iterating over a PathScurry performs a synchronous walk.
+     *
+     * Alias for {@link PathScurryBase.iterateSync}
+     */
+    [Symbol.iterator]() {
+        return this.iterateSync();
+    }
+    *iterateSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        if (!filter || filter(entry)) {
+            yield withFileTypes ? entry : entry.fullpath();
+        }
+        const dirs = new Set([entry]);
+        for (const dir of dirs) {
+            const entries = dir.readdirSync();
+            for (const e of entries) {
+                if (!filter || filter(e)) {
+                    yield withFileTypes ? e : e.fullpath();
+                }
+                let r = e;
+                if (e.isSymbolicLink()) {
+                    if (!(follow && (r = e.realpathSync())))
+                        continue;
+                    if (r.isUnknown())
+                        r.lstatSync();
+                }
+                if (r.shouldWalk(dirs, walkFilter)) {
+                    dirs.add(r);
+                }
+            }
+        }
+    }
+    stream(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new Minipass({ objectMode: true });
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const dirs = new Set();
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const onReaddir = (er, entries, didRealpaths = false) => {
+                    /* c8 ignore start */
+                    if (er)
+                        return results.emit('error', er);
+                    /* c8 ignore stop */
+                    if (follow && !didRealpaths) {
+                        const promises = [];
+                        for (const e of entries) {
+                            if (e.isSymbolicLink()) {
+                                promises.push(e
+                                    .realpath()
+                                    .then((r) => r?.isUnknown() ? r.lstat() : r));
+                            }
+                        }
+                        if (promises.length) {
+                            Promise.all(promises).then(() => onReaddir(null, entries, true));
+                            return;
+                        }
+                    }
+                    for (const e of entries) {
+                        if (e && (!filter || filter(e))) {
+                            if (!results.write(withFileTypes ? e : e.fullpath())) {
+                                paused = true;
+                            }
+                        }
+                    }
+                    processing--;
+                    for (const e of entries) {
+                        const r = e.realpathCached() || e;
+                        if (r.shouldWalk(dirs, walkFilter)) {
+                            queue.push(r);
+                        }
+                    }
+                    if (paused && !results.flowing) {
+                        results.once('drain', process);
+                    }
+                    else if (!sync) {
+                        process();
+                    }
+                };
+                // zalgo containment
+                let sync = true;
+                dir.readdirCB(onReaddir, true);
+                sync = false;
+            }
+        };
+        process();
+        return results;
+    }
+    streamSync(entry = this.cwd, opts = {}) {
+        if (typeof entry === 'string') {
+            entry = this.cwd.resolve(entry);
+        }
+        else if (!(entry instanceof PathBase)) {
+            opts = entry;
+            entry = this.cwd;
+        }
+        const { withFileTypes = true, follow = false, filter, walkFilter, } = opts;
+        const results = new Minipass({ objectMode: true });
+        const dirs = new Set();
+        if (!filter || filter(entry)) {
+            results.write(withFileTypes ? entry : entry.fullpath());
+        }
+        const queue = [entry];
+        let processing = 0;
+        const process = () => {
+            let paused = false;
+            while (!paused) {
+                const dir = queue.shift();
+                if (!dir) {
+                    if (processing === 0)
+                        results.end();
+                    return;
+                }
+                processing++;
+                dirs.add(dir);
+                const entries = dir.readdirSync();
+                for (const e of entries) {
+                    if (!filter || filter(e)) {
+                        if (!results.write(withFileTypes ? e : e.fullpath())) {
+                            paused = true;
+                        }
+                    }
+                }
+                processing--;
+                for (const e of entries) {
+                    let r = e;
+                    if (e.isSymbolicLink()) {
+                        if (!(follow && (r = e.realpathSync())))
+                            continue;
+                        if (r.isUnknown())
+                            r.lstatSync();
+                    }
+                    if (r.shouldWalk(dirs, walkFilter)) {
+                        queue.push(r);
+                    }
+                }
+            }
+            if (paused && !results.flowing)
+                results.once('drain', process);
+        };
+        process();
+        return results;
+    }
+    chdir(path = this.cwd) {
+        const oldCwd = this.cwd;
+        this.cwd = typeof path === 'string' ? this.cwd.resolve(path) : path;
+        this.cwd[setAsCwd](oldCwd);
+    }
+}
+/**
+ * Windows implementation of {@link PathScurryBase}
+ *
+ * Defaults to case insensitve, uses `'\\'` to generate path strings.  Uses
+ * {@link PathWin32} for Path objects.
+ */
+class PathScurryWin32 extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '\\';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, win32$1, '\\', { ...opts, nocase });
+        this.nocase = nocase;
+        for (let p = this.cwd; p; p = p.parent) {
+            p.nocase = this.nocase;
+        }
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(dir) {
+        // if the path starts with a single separator, it's not a UNC, and we'll
+        // just get separator as the root, and driveFromUNC will return \
+        // In that case, mount \ on the root from the cwd.
+        return win32$1.parse(dir).root.toUpperCase();
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathWin32(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return (p.startsWith('/') || p.startsWith('\\') || /^[a-z]:(\/|\\)/i.test(p));
+    }
+}
+/**
+ * {@link PathScurryBase} implementation for all posix systems other than Darwin.
+ *
+ * Defaults to case-sensitive matching, uses `'/'` to generate path strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+class PathScurryPosix extends PathScurryBase {
+    /**
+     * separator for generating path strings
+     */
+    sep = '/';
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = false } = opts;
+        super(cwd, posix$1, '/', { ...opts, nocase });
+        this.nocase = nocase;
+    }
+    /**
+     * @internal
+     */
+    parseRootPath(_dir) {
+        return '/';
+    }
+    /**
+     * @internal
+     */
+    newRoot(fs) {
+        return new PathPosix(this.rootPath, IFDIR, undefined, this.roots, this.nocase, this.childrenCache(), { fs });
+    }
+    /**
+     * Return true if the provided path string is an absolute path
+     */
+    isAbsolute(p) {
+        return p.startsWith('/');
+    }
+}
+/**
+ * {@link PathScurryBase} implementation for Darwin (macOS) systems.
+ *
+ * Defaults to case-insensitive matching, uses `'/'` for generating path
+ * strings.
+ *
+ * Uses {@link PathPosix} for Path objects.
+ */
+class PathScurryDarwin extends PathScurryPosix {
+    constructor(cwd = process.cwd(), opts = {}) {
+        const { nocase = true } = opts;
+        super(cwd, { ...opts, nocase });
+    }
+}
+/**
+ * Default {@link PathBase} implementation for the current platform.
+ *
+ * {@link PathWin32} on Windows systems, {@link PathPosix} on all others.
+ */
+process.platform === 'win32' ? PathWin32 : PathPosix;
+/**
+ * Default {@link PathScurryBase} implementation for the current platform.
+ *
+ * {@link PathScurryWin32} on Windows systems, {@link PathScurryDarwin} on
+ * Darwin (macOS) systems, {@link PathScurryPosix} on all others.
+ */
+const PathScurry = process.platform === 'win32' ? PathScurryWin32
+    : process.platform === 'darwin' ? PathScurryDarwin
+        : PathScurryPosix;
+
+// this is just a very light wrapper around 2 arrays with an offset index
+const isPatternList = (pl) => pl.length >= 1;
+const isGlobList = (gl) => gl.length >= 1;
+/**
+ * An immutable-ish view on an array of glob parts and their parsed
+ * results
+ */
+class Pattern {
+    #patternList;
+    #globList;
+    #index;
+    length;
+    #platform;
+    #rest;
+    #globString;
+    #isDrive;
+    #isUNC;
+    #isAbsolute;
+    #followGlobstar = true;
+    constructor(patternList, globList, index, platform) {
+        if (!isPatternList(patternList)) {
+            throw new TypeError('empty pattern list');
+        }
+        if (!isGlobList(globList)) {
+            throw new TypeError('empty glob list');
+        }
+        if (globList.length !== patternList.length) {
+            throw new TypeError('mismatched pattern list and glob list lengths');
+        }
+        this.length = patternList.length;
+        if (index < 0 || index >= this.length) {
+            throw new TypeError('index out of range');
+        }
+        this.#patternList = patternList;
+        this.#globList = globList;
+        this.#index = index;
+        this.#platform = platform;
+        // normalize root entries of absolute patterns on initial creation.
+        if (this.#index === 0) {
+            // c: => ['c:/']
+            // C:/ => ['C:/']
+            // C:/x => ['C:/', 'x']
+            // //host/share => ['//host/share/']
+            // //host/share/ => ['//host/share/']
+            // //host/share/x => ['//host/share/', 'x']
+            // /etc => ['/', 'etc']
+            // / => ['/']
+            if (this.isUNC()) {
+                // '' / '' / 'host' / 'share'
+                const [p0, p1, p2, p3, ...prest] = this.#patternList;
+                const [g0, g1, g2, g3, ...grest] = this.#globList;
+                if (prest[0] === '') {
+                    // ends in /
+                    prest.shift();
+                    grest.shift();
+                }
+                const p = [p0, p1, p2, p3, ''].join('/');
+                const g = [g0, g1, g2, g3, ''].join('/');
+                this.#patternList = [p, ...prest];
+                this.#globList = [g, ...grest];
+                this.length = this.#patternList.length;
+            }
+            else if (this.isDrive() || this.isAbsolute()) {
+                const [p1, ...prest] = this.#patternList;
+                const [g1, ...grest] = this.#globList;
+                if (prest[0] === '') {
+                    // ends in /
+                    prest.shift();
+                    grest.shift();
+                }
+                const p = p1 + '/';
+                const g = g1 + '/';
+                this.#patternList = [p, ...prest];
+                this.#globList = [g, ...grest];
+                this.length = this.#patternList.length;
+            }
+        }
+    }
+    /**
+     * The first entry in the parsed list of patterns
+     */
+    pattern() {
+        return this.#patternList[this.#index];
+    }
+    /**
+     * true of if pattern() returns a string
+     */
+    isString() {
+        return typeof this.#patternList[this.#index] === 'string';
+    }
+    /**
+     * true of if pattern() returns GLOBSTAR
+     */
+    isGlobstar() {
+        return this.#patternList[this.#index] === GLOBSTAR$2;
+    }
+    /**
+     * true if pattern() returns a regexp
+     */
+    isRegExp() {
+        return this.#patternList[this.#index] instanceof RegExp;
+    }
+    /**
+     * The /-joined set of glob parts that make up this pattern
+     */
+    globString() {
+        return (this.#globString =
+            this.#globString ||
+                (this.#index === 0 ?
+                    this.isAbsolute() ?
+                        this.#globList[0] + this.#globList.slice(1).join('/')
+                        : this.#globList.join('/')
+                    : this.#globList.slice(this.#index).join('/')));
+    }
+    /**
+     * true if there are more pattern parts after this one
+     */
+    hasMore() {
+        return this.length > this.#index + 1;
+    }
+    /**
+     * The rest of the pattern after this part, or null if this is the end
+     */
+    rest() {
+        if (this.#rest !== undefined)
+            return this.#rest;
+        if (!this.hasMore())
+            return (this.#rest = null);
+        this.#rest = new Pattern(this.#patternList, this.#globList, this.#index + 1, this.#platform);
+        this.#rest.#isAbsolute = this.#isAbsolute;
+        this.#rest.#isUNC = this.#isUNC;
+        this.#rest.#isDrive = this.#isDrive;
+        return this.#rest;
+    }
+    /**
+     * true if the pattern represents a //unc/path/ on windows
+     */
+    isUNC() {
+        const pl = this.#patternList;
+        return this.#isUNC !== undefined ?
+            this.#isUNC
+            : (this.#isUNC =
+                this.#platform === 'win32' &&
+                    this.#index === 0 &&
+                    pl[0] === '' &&
+                    pl[1] === '' &&
+                    typeof pl[2] === 'string' &&
+                    !!pl[2] &&
+                    typeof pl[3] === 'string' &&
+                    !!pl[3]);
+    }
+    // pattern like C:/...
+    // split = ['C:', ...]
+    // XXX: would be nice to handle patterns like `c:*` to test the cwd
+    // in c: for *, but I don't know of a way to even figure out what that
+    // cwd is without actually chdir'ing into it?
+    /**
+     * True if the pattern starts with a drive letter on Windows
+     */
+    isDrive() {
+        const pl = this.#patternList;
+        return this.#isDrive !== undefined ?
+            this.#isDrive
+            : (this.#isDrive =
+                this.#platform === 'win32' &&
+                    this.#index === 0 &&
+                    this.length > 1 &&
+                    typeof pl[0] === 'string' &&
+                    /^[a-z]:$/i.test(pl[0]));
+    }
+    // pattern = '/' or '/...' or '/x/...'
+    // split = ['', ''] or ['', ...] or ['', 'x', ...]
+    // Drive and UNC both considered absolute on windows
+    /**
+     * True if the pattern is rooted on an absolute path
+     */
+    isAbsolute() {
+        const pl = this.#patternList;
+        return this.#isAbsolute !== undefined ?
+            this.#isAbsolute
+            : (this.#isAbsolute =
+                (pl[0] === '' && pl.length > 1) ||
+                    this.isDrive() ||
+                    this.isUNC());
+    }
+    /**
+     * consume the root of the pattern, and return it
+     */
+    root() {
+        const p = this.#patternList[0];
+        return (typeof p === 'string' && this.isAbsolute() && this.#index === 0) ?
+            p
+            : '';
+    }
+    /**
+     * Check to see if the current globstar pattern is allowed to follow
+     * a symbolic link.
+     */
+    checkFollowGlobstar() {
+        return !(this.#index === 0 ||
+            !this.isGlobstar() ||
+            !this.#followGlobstar);
+    }
+    /**
+     * Mark that the current globstar pattern is following a symbolic link
+     */
+    markFollowGlobstar() {
+        if (this.#index === 0 || !this.isGlobstar() || !this.#followGlobstar)
+            return false;
+        this.#followGlobstar = false;
+        return true;
+    }
+}
+
+// give it a pattern, and it'll be able to tell you if
+// a given path should be ignored.
+// Ignoring a path ignores its children if the pattern ends in /**
+// Ignores are always parsed in dot:true mode
+const defaultPlatform$1 = (typeof process === 'object' &&
+    process &&
+    typeof process.platform === 'string') ?
+    process.platform
+    : 'linux';
+/**
+ * Class used to process ignored patterns
+ */
+class Ignore {
+    relative;
+    relativeChildren;
+    absolute;
+    absoluteChildren;
+    platform;
+    mmopts;
+    constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform$1, }) {
+        this.relative = [];
+        this.absolute = [];
+        this.relativeChildren = [];
+        this.absoluteChildren = [];
+        this.platform = platform;
+        this.mmopts = {
+            dot: true,
+            nobrace,
+            nocase,
+            noext,
+            noglobstar,
+            optimizationLevel: 2,
+            platform,
+            nocomment: true,
+            nonegate: true,
+        };
+        for (const ign of ignored)
+            this.add(ign);
+    }
+    add(ign) {
+        // this is a little weird, but it gives us a clean set of optimized
+        // minimatch matchers, without getting tripped up if one of them
+        // ends in /** inside a brace section, and it's only inefficient at
+        // the start of the walk, not along it.
+        // It'd be nice if the Pattern class just had a .test() method, but
+        // handling globstars is a bit of a pita, and that code already lives
+        // in minimatch anyway.
+        // Another way would be if maybe Minimatch could take its set/globParts
+        // as an option, and then we could at least just use Pattern to test
+        // for absolute-ness.
+        // Yet another way, Minimatch could take an array of glob strings, and
+        // a cwd option, and do the right thing.
+        const mm = new Minimatch(ign, this.mmopts);
+        for (let i = 0; i < mm.set.length; i++) {
+            const parsed = mm.set[i];
+            const globParts = mm.globParts[i];
+            /* c8 ignore start */
+            if (!parsed || !globParts) {
+                throw new Error('invalid pattern object');
+            }
+            // strip off leading ./ portions
+            // https://github.com/isaacs/node-glob/issues/570
+            while (parsed[0] === '.' && globParts[0] === '.') {
+                parsed.shift();
+                globParts.shift();
+            }
+            /* c8 ignore stop */
+            const p = new Pattern(parsed, globParts, 0, this.platform);
+            const m = new Minimatch(p.globString(), this.mmopts);
+            const children = globParts[globParts.length - 1] === '**';
+            const absolute = p.isAbsolute();
+            if (absolute)
+                this.absolute.push(m);
+            else
+                this.relative.push(m);
+            if (children) {
+                if (absolute)
+                    this.absoluteChildren.push(m);
+                else
+                    this.relativeChildren.push(m);
+            }
+        }
+    }
+    ignored(p) {
+        const fullpath = p.fullpath();
+        const fullpaths = `${fullpath}/`;
+        const relative = p.relative() || '.';
+        const relatives = `${relative}/`;
+        for (const m of this.relative) {
+            if (m.match(relative) || m.match(relatives))
+                return true;
+        }
+        for (const m of this.absolute) {
+            if (m.match(fullpath) || m.match(fullpaths))
+                return true;
+        }
+        return false;
+    }
+    childrenIgnored(p) {
+        const fullpath = p.fullpath() + '/';
+        const relative = (p.relative() || '.') + '/';
+        for (const m of this.relativeChildren) {
+            if (m.match(relative))
+                return true;
+        }
+        for (const m of this.absoluteChildren) {
+            if (m.match(fullpath))
+                return true;
+        }
+        return false;
+    }
+}
+
+// synchronous utility for filtering entries and calculating subwalks
+/**
+ * A cache of which patterns have been processed for a given Path
+ */
+class HasWalkedCache {
+    store;
+    constructor(store = new Map()) {
+        this.store = store;
+    }
+    copy() {
+        return new HasWalkedCache(new Map(this.store));
+    }
+    hasWalked(target, pattern) {
+        return this.store.get(target.fullpath())?.has(pattern.globString());
+    }
+    storeWalked(target, pattern) {
+        const fullpath = target.fullpath();
+        const cached = this.store.get(fullpath);
+        if (cached)
+            cached.add(pattern.globString());
+        else
+            this.store.set(fullpath, new Set([pattern.globString()]));
+    }
+}
+/**
+ * A record of which paths have been matched in a given walk step,
+ * and whether they only are considered a match if they are a directory,
+ * and whether their absolute or relative path should be returned.
+ */
+class MatchRecord {
+    store = new Map();
+    add(target, absolute, ifDir) {
+        const n = (absolute ? 2 : 0) | (ifDir ? 1 : 0);
+        const current = this.store.get(target);
+        this.store.set(target, current === undefined ? n : n & current);
+    }
+    // match, absolute, ifdir
+    entries() {
+        return [...this.store.entries()].map(([path, n]) => [
+            path,
+            !!(n & 2),
+            !!(n & 1),
+        ]);
+    }
+}
+/**
+ * A collection of patterns that must be processed in a subsequent step
+ * for a given path.
+ */
+class SubWalks {
+    store = new Map();
+    add(target, pattern) {
+        if (!target.canReaddir()) {
+            return;
+        }
+        const subs = this.store.get(target);
+        if (subs) {
+            if (!subs.find(p => p.globString() === pattern.globString())) {
+                subs.push(pattern);
+            }
+        }
+        else
+            this.store.set(target, [pattern]);
+    }
+    get(target) {
+        const subs = this.store.get(target);
+        /* c8 ignore start */
+        if (!subs) {
+            throw new Error('attempting to walk unknown path');
+        }
+        /* c8 ignore stop */
+        return subs;
+    }
+    entries() {
+        return this.keys().map(k => [k, this.store.get(k)]);
+    }
+    keys() {
+        return [...this.store.keys()].filter(t => t.canReaddir());
+    }
+}
+/**
+ * The class that processes patterns for a given path.
+ *
+ * Handles child entry filtering, and determining whether a path's
+ * directory contents must be read.
+ */
+class Processor {
+    hasWalkedCache;
+    matches = new MatchRecord();
+    subwalks = new SubWalks();
+    patterns;
+    follow;
+    dot;
+    opts;
+    constructor(opts, hasWalkedCache) {
+        this.opts = opts;
+        this.follow = !!opts.follow;
+        this.dot = !!opts.dot;
+        this.hasWalkedCache =
+            hasWalkedCache ? hasWalkedCache.copy() : new HasWalkedCache();
+    }
+    processPatterns(target, patterns) {
+        this.patterns = patterns;
+        const processingSet = patterns.map(p => [target, p]);
+        // map of paths to the magic-starting subwalks they need to walk
+        // first item in patterns is the filter
+        for (let [t, pattern] of processingSet) {
+            this.hasWalkedCache.storeWalked(t, pattern);
+            const root = pattern.root();
+            const absolute = pattern.isAbsolute() && this.opts.absolute !== false;
+            // start absolute patterns at root
+            if (root) {
+                t = t.resolve(root === '/' && this.opts.root !== undefined ?
+                    this.opts.root
+                    : root);
+                const rest = pattern.rest();
+                if (!rest) {
+                    this.matches.add(t, true, false);
+                    continue;
+                }
+                else {
+                    pattern = rest;
+                }
+            }
+            if (t.isENOENT())
+                continue;
+            let p;
+            let rest;
+            let changed = false;
+            while (typeof (p = pattern.pattern()) === 'string' &&
+                (rest = pattern.rest())) {
+                const c = t.resolve(p);
+                t = c;
+                pattern = rest;
+                changed = true;
+            }
+            p = pattern.pattern();
+            rest = pattern.rest();
+            if (changed) {
+                if (this.hasWalkedCache.hasWalked(t, pattern))
+                    continue;
+                this.hasWalkedCache.storeWalked(t, pattern);
+            }
+            // now we have either a final string for a known entry,
+            // more strings for an unknown entry,
+            // or a pattern starting with magic, mounted on t.
+            if (typeof p === 'string') {
+                // must not be final entry, otherwise we would have
+                // concatenated it earlier.
+                const ifDir = p === '..' || p === '' || p === '.';
+                this.matches.add(t.resolve(p), absolute, ifDir);
+                continue;
+            }
+            else if (p === GLOBSTAR$2) {
+                // if no rest, match and subwalk pattern
+                // if rest, process rest and subwalk pattern
+                // if it's a symlink, but we didn't get here by way of a
+                // globstar match (meaning it's the first time THIS globstar
+                // has traversed a symlink), then we follow it. Otherwise, stop.
+                if (!t.isSymbolicLink() ||
+                    this.follow ||
+                    pattern.checkFollowGlobstar()) {
+                    this.subwalks.add(t, pattern);
+                }
+                const rp = rest?.pattern();
+                const rrest = rest?.rest();
+                if (!rest || ((rp === '' || rp === '.') && !rrest)) {
+                    // only HAS to be a dir if it ends in **/ or **/.
+                    // but ending in ** will match files as well.
+                    this.matches.add(t, absolute, rp === '' || rp === '.');
+                }
+                else {
+                    if (rp === '..') {
+                        // this would mean you're matching **/.. at the fs root,
+                        // and no thanks, I'm not gonna test that specific case.
+                        /* c8 ignore start */
+                        const tp = t.parent || t;
+                        /* c8 ignore stop */
+                        if (!rrest)
+                            this.matches.add(tp, absolute, true);
+                        else if (!this.hasWalkedCache.hasWalked(tp, rrest)) {
+                            this.subwalks.add(tp, rrest);
+                        }
+                    }
+                }
+            }
+            else if (p instanceof RegExp) {
+                this.subwalks.add(t, pattern);
+            }
+        }
+        return this;
+    }
+    subwalkTargets() {
+        return this.subwalks.keys();
+    }
+    child() {
+        return new Processor(this.opts, this.hasWalkedCache);
+    }
+    // return a new Processor containing the subwalks for each
+    // child entry, and a set of matches, and
+    // a hasWalkedCache that's a copy of this one
+    // then we're going to call
+    filterEntries(parent, entries) {
+        const patterns = this.subwalks.get(parent);
+        // put matches and entry walks into the results processor
+        const results = this.child();
+        for (const e of entries) {
+            for (const pattern of patterns) {
+                const absolute = pattern.isAbsolute();
+                const p = pattern.pattern();
+                const rest = pattern.rest();
+                if (p === GLOBSTAR$2) {
+                    results.testGlobstar(e, pattern, rest, absolute);
+                }
+                else if (p instanceof RegExp) {
+                    results.testRegExp(e, p, rest, absolute);
+                }
+                else {
+                    results.testString(e, p, rest, absolute);
+                }
+            }
+        }
+        return results;
+    }
+    testGlobstar(e, pattern, rest, absolute) {
+        if (this.dot || !e.name.startsWith('.')) {
+            if (!pattern.hasMore()) {
+                this.matches.add(e, absolute, false);
+            }
+            if (e.canReaddir()) {
+                // if we're in follow mode or it's not a symlink, just keep
+                // testing the same pattern. If there's more after the globstar,
+                // then this symlink consumes the globstar. If not, then we can
+                // follow at most ONE symlink along the way, so we mark it, which
+                // also checks to ensure that it wasn't already marked.
+                if (this.follow || !e.isSymbolicLink()) {
+                    this.subwalks.add(e, pattern);
+                }
+                else if (e.isSymbolicLink()) {
+                    if (rest && pattern.checkFollowGlobstar()) {
+                        this.subwalks.add(e, rest);
+                    }
+                    else if (pattern.markFollowGlobstar()) {
+                        this.subwalks.add(e, pattern);
+                    }
+                }
+            }
+        }
+        // if the NEXT thing matches this entry, then also add
+        // the rest.
+        if (rest) {
+            const rp = rest.pattern();
+            if (typeof rp === 'string' &&
+                // dots and empty were handled already
+                rp !== '..' &&
+                rp !== '' &&
+                rp !== '.') {
+                this.testString(e, rp, rest.rest(), absolute);
+            }
+            else if (rp === '..') {
+                /* c8 ignore start */
+                const ep = e.parent || e;
+                /* c8 ignore stop */
+                this.subwalks.add(ep, rest);
+            }
+            else if (rp instanceof RegExp) {
+                this.testRegExp(e, rp, rest.rest(), absolute);
+            }
+        }
+    }
+    testRegExp(e, p, rest, absolute) {
+        if (!p.test(e.name))
+            return;
+        if (!rest) {
+            this.matches.add(e, absolute, false);
+        }
+        else {
+            this.subwalks.add(e, rest);
+        }
+    }
+    testString(e, p, rest, absolute) {
+        // should never happen?
+        if (!e.isNamed(p))
+            return;
+        if (!rest) {
+            this.matches.add(e, absolute, false);
+        }
+        else {
+            this.subwalks.add(e, rest);
+        }
+    }
+}
+
+/**
+ * Single-use utility classes to provide functionality to the {@link Glob}
+ * methods.
+ *
+ * @module
+ */
+const makeIgnore = (ignore, opts) => typeof ignore === 'string' ? new Ignore([ignore], opts)
+    : Array.isArray(ignore) ? new Ignore(ignore, opts)
+        : ignore;
+/**
+ * basic walking utilities that all the glob walker types use
+ */
+class GlobUtil {
+    path;
+    patterns;
+    opts;
+    seen = new Set();
+    paused = false;
+    aborted = false;
+    #onResume = [];
+    #ignore;
+    #sep;
+    signal;
+    maxDepth;
+    includeChildMatches;
+    constructor(patterns, path, opts) {
+        this.patterns = patterns;
+        this.path = path;
+        this.opts = opts;
+        this.#sep = !opts.posix && opts.platform === 'win32' ? '\\' : '/';
+        this.includeChildMatches = opts.includeChildMatches !== false;
+        if (opts.ignore || !this.includeChildMatches) {
+            this.#ignore = makeIgnore(opts.ignore ?? [], opts);
+            if (!this.includeChildMatches &&
+                typeof this.#ignore.add !== 'function') {
+                const m = 'cannot ignore child matches, ignore lacks add() method.';
+                throw new Error(m);
+            }
+        }
+        // ignore, always set with maxDepth, but it's optional on the
+        // GlobOptions type
+        /* c8 ignore start */
+        this.maxDepth = opts.maxDepth || Infinity;
+        /* c8 ignore stop */
+        if (opts.signal) {
+            this.signal = opts.signal;
+            this.signal.addEventListener('abort', () => {
+                this.#onResume.length = 0;
+            });
+        }
+    }
+    #ignored(path) {
+        return this.seen.has(path) || !!this.#ignore?.ignored?.(path);
+    }
+    #childrenIgnored(path) {
+        return !!this.#ignore?.childrenIgnored?.(path);
+    }
+    // backpressure mechanism
+    pause() {
+        this.paused = true;
+    }
+    resume() {
+        /* c8 ignore start */
+        if (this.signal?.aborted)
+            return;
+        /* c8 ignore stop */
+        this.paused = false;
+        let fn = undefined;
+        while (!this.paused && (fn = this.#onResume.shift())) {
+            fn();
+        }
+    }
+    onResume(fn) {
+        if (this.signal?.aborted)
+            return;
+        /* c8 ignore start */
+        if (!this.paused) {
+            fn();
+        }
+        else {
+            /* c8 ignore stop */
+            this.#onResume.push(fn);
+        }
+    }
+    // do the requisite realpath/stat checking, and return the path
+    // to add or undefined to filter it out.
+    async matchCheck(e, ifDir) {
+        if (ifDir && this.opts.nodir)
+            return undefined;
+        let rpc;
+        if (this.opts.realpath) {
+            rpc = e.realpathCached() || (await e.realpath());
+            if (!rpc)
+                return undefined;
+            e = rpc;
+        }
+        const needStat = e.isUnknown() || this.opts.stat;
+        const s = needStat ? await e.lstat() : e;
+        if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
+            const target = await s.realpath();
+            /* c8 ignore start */
+            if (target && (target.isUnknown() || this.opts.stat)) {
+                await target.lstat();
+            }
+            /* c8 ignore stop */
+        }
+        return this.matchCheckTest(s, ifDir);
+    }
+    matchCheckTest(e, ifDir) {
+        return (e &&
+            (this.maxDepth === Infinity || e.depth() <= this.maxDepth) &&
+            (!ifDir || e.canReaddir()) &&
+            (!this.opts.nodir || !e.isDirectory()) &&
+            (!this.opts.nodir ||
+                !this.opts.follow ||
+                !e.isSymbolicLink() ||
+                !e.realpathCached()?.isDirectory()) &&
+            !this.#ignored(e)) ?
+            e
+            : undefined;
+    }
+    matchCheckSync(e, ifDir) {
+        if (ifDir && this.opts.nodir)
+            return undefined;
+        let rpc;
+        if (this.opts.realpath) {
+            rpc = e.realpathCached() || e.realpathSync();
+            if (!rpc)
+                return undefined;
+            e = rpc;
+        }
+        const needStat = e.isUnknown() || this.opts.stat;
+        const s = needStat ? e.lstatSync() : e;
+        if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
+            const target = s.realpathSync();
+            if (target && (target?.isUnknown() || this.opts.stat)) {
+                target.lstatSync();
+            }
+        }
+        return this.matchCheckTest(s, ifDir);
+    }
+    matchFinish(e, absolute) {
+        if (this.#ignored(e))
+            return;
+        // we know we have an ignore if this is false, but TS doesn't
+        if (!this.includeChildMatches && this.#ignore?.add) {
+            const ign = `${e.relativePosix()}/**`;
+            this.#ignore.add(ign);
+        }
+        const abs = this.opts.absolute === undefined ? absolute : this.opts.absolute;
+        this.seen.add(e);
+        const mark = this.opts.mark && e.isDirectory() ? this.#sep : '';
+        // ok, we have what we need!
+        if (this.opts.withFileTypes) {
+            this.matchEmit(e);
+        }
+        else if (abs) {
+            const abs = this.opts.posix ? e.fullpathPosix() : e.fullpath();
+            this.matchEmit(abs + mark);
+        }
+        else {
+            const rel = this.opts.posix ? e.relativePosix() : e.relative();
+            const pre = this.opts.dotRelative && !rel.startsWith('..' + this.#sep) ?
+                '.' + this.#sep
+                : '';
+            this.matchEmit(!rel ? '.' + mark : pre + rel + mark);
+        }
+    }
+    async match(e, absolute, ifDir) {
+        const p = await this.matchCheck(e, ifDir);
+        if (p)
+            this.matchFinish(p, absolute);
+    }
+    matchSync(e, absolute, ifDir) {
+        const p = this.matchCheckSync(e, ifDir);
+        if (p)
+            this.matchFinish(p, absolute);
+    }
+    walkCB(target, patterns, cb) {
+        /* c8 ignore start */
+        if (this.signal?.aborted)
+            cb();
+        /* c8 ignore stop */
+        this.walkCB2(target, patterns, new Processor(this.opts), cb);
+    }
+    walkCB2(target, patterns, processor, cb) {
+        if (this.#childrenIgnored(target))
+            return cb();
+        if (this.signal?.aborted)
+            cb();
+        if (this.paused) {
+            this.onResume(() => this.walkCB2(target, patterns, processor, cb));
+            return;
+        }
+        processor.processPatterns(target, patterns);
+        // done processing.  all of the above is sync, can be abstracted out.
+        // subwalks is a map of paths to the entry filters they need
+        // matches is a map of paths to [absolute, ifDir] tuples.
+        let tasks = 1;
+        const next = () => {
+            if (--tasks === 0)
+                cb();
+        };
+        for (const [m, absolute, ifDir] of processor.matches.entries()) {
+            if (this.#ignored(m))
+                continue;
+            tasks++;
+            this.match(m, absolute, ifDir).then(() => next());
+        }
+        for (const t of processor.subwalkTargets()) {
+            if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
+                continue;
+            }
+            tasks++;
+            const childrenCached = t.readdirCached();
+            if (t.calledReaddir())
+                this.walkCB3(t, childrenCached, processor, next);
+            else {
+                t.readdirCB((_, entries) => this.walkCB3(t, entries, processor, next), true);
+            }
+        }
+        next();
+    }
+    walkCB3(target, entries, processor, cb) {
+        processor = processor.filterEntries(target, entries);
+        let tasks = 1;
+        const next = () => {
+            if (--tasks === 0)
+                cb();
+        };
+        for (const [m, absolute, ifDir] of processor.matches.entries()) {
+            if (this.#ignored(m))
+                continue;
+            tasks++;
+            this.match(m, absolute, ifDir).then(() => next());
+        }
+        for (const [target, patterns] of processor.subwalks.entries()) {
+            tasks++;
+            this.walkCB2(target, patterns, processor.child(), next);
+        }
+        next();
+    }
+    walkCBSync(target, patterns, cb) {
+        /* c8 ignore start */
+        if (this.signal?.aborted)
+            cb();
+        /* c8 ignore stop */
+        this.walkCB2Sync(target, patterns, new Processor(this.opts), cb);
+    }
+    walkCB2Sync(target, patterns, processor, cb) {
+        if (this.#childrenIgnored(target))
+            return cb();
+        if (this.signal?.aborted)
+            cb();
+        if (this.paused) {
+            this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
+            return;
+        }
+        processor.processPatterns(target, patterns);
+        // done processing.  all of the above is sync, can be abstracted out.
+        // subwalks is a map of paths to the entry filters they need
+        // matches is a map of paths to [absolute, ifDir] tuples.
+        let tasks = 1;
+        const next = () => {
+            if (--tasks === 0)
+                cb();
+        };
+        for (const [m, absolute, ifDir] of processor.matches.entries()) {
+            if (this.#ignored(m))
+                continue;
+            this.matchSync(m, absolute, ifDir);
+        }
+        for (const t of processor.subwalkTargets()) {
+            if (this.maxDepth !== Infinity && t.depth() >= this.maxDepth) {
+                continue;
+            }
+            tasks++;
+            const children = t.readdirSync();
+            this.walkCB3Sync(t, children, processor, next);
+        }
+        next();
+    }
+    walkCB3Sync(target, entries, processor, cb) {
+        processor = processor.filterEntries(target, entries);
+        let tasks = 1;
+        const next = () => {
+            if (--tasks === 0)
+                cb();
+        };
+        for (const [m, absolute, ifDir] of processor.matches.entries()) {
+            if (this.#ignored(m))
+                continue;
+            this.matchSync(m, absolute, ifDir);
+        }
+        for (const [target, patterns] of processor.subwalks.entries()) {
+            tasks++;
+            this.walkCB2Sync(target, patterns, processor.child(), next);
+        }
+        next();
+    }
+}
+class GlobWalker extends GlobUtil {
+    matches = new Set();
+    constructor(patterns, path, opts) {
+        super(patterns, path, opts);
+    }
+    matchEmit(e) {
+        this.matches.add(e);
+    }
+    async walk() {
+        if (this.signal?.aborted)
+            throw this.signal.reason;
+        if (this.path.isUnknown()) {
+            await this.path.lstat();
+        }
+        await new Promise((res, rej) => {
+            this.walkCB(this.path, this.patterns, () => {
+                if (this.signal?.aborted) {
+                    rej(this.signal.reason);
+                }
+                else {
+                    res(this.matches);
+                }
+            });
+        });
+        return this.matches;
+    }
+    walkSync() {
+        if (this.signal?.aborted)
+            throw this.signal.reason;
+        if (this.path.isUnknown()) {
+            this.path.lstatSync();
+        }
+        // nothing for the callback to do, because this never pauses
+        this.walkCBSync(this.path, this.patterns, () => {
+            if (this.signal?.aborted)
+                throw this.signal.reason;
+        });
+        return this.matches;
+    }
+}
+class GlobStream extends GlobUtil {
+    results;
+    constructor(patterns, path, opts) {
+        super(patterns, path, opts);
+        this.results = new Minipass({
+            signal: this.signal,
+            objectMode: true,
+        });
+        this.results.on('drain', () => this.resume());
+        this.results.on('resume', () => this.resume());
+    }
+    matchEmit(e) {
+        this.results.write(e);
+        if (!this.results.flowing)
+            this.pause();
+    }
+    stream() {
+        const target = this.path;
+        if (target.isUnknown()) {
+            target.lstat().then(() => {
+                this.walkCB(target, this.patterns, () => this.results.end());
+            });
+        }
+        else {
+            this.walkCB(target, this.patterns, () => this.results.end());
+        }
+        return this.results;
+    }
+    streamSync() {
+        if (this.path.isUnknown()) {
+            this.path.lstatSync();
+        }
+        this.walkCBSync(this.path, this.patterns, () => this.results.end());
+        return this.results;
+    }
+}
+
+// if no process global, just call it linux.
+// so we default to case-sensitive, / separators
+const defaultPlatform = (typeof process === 'object' &&
+    process &&
+    typeof process.platform === 'string') ?
+    process.platform
+    : 'linux';
+/**
+ * An object that can perform glob pattern traversals.
+ */
+class Glob {
+    absolute;
+    cwd;
+    root;
+    dot;
+    dotRelative;
+    follow;
+    ignore;
+    magicalBraces;
+    mark;
+    matchBase;
+    maxDepth;
+    nobrace;
+    nocase;
+    nodir;
+    noext;
+    noglobstar;
+    pattern;
+    platform;
+    realpath;
+    scurry;
+    stat;
+    signal;
+    windowsPathsNoEscape;
+    withFileTypes;
+    includeChildMatches;
+    /**
+     * The options provided to the constructor.
+     */
+    opts;
+    /**
+     * An array of parsed immutable {@link Pattern} objects.
+     */
+    patterns;
+    /**
+     * All options are stored as properties on the `Glob` object.
+     *
+     * See {@link GlobOptions} for full options descriptions.
+     *
+     * Note that a previous `Glob` object can be passed as the
+     * `GlobOptions` to another `Glob` instantiation to re-use settings
+     * and caches with a new pattern.
+     *
+     * Traversal functions can be called multiple times to run the walk
+     * again.
+     */
+    constructor(pattern, opts) {
+        /* c8 ignore start */
+        if (!opts)
+            throw new TypeError('glob options required');
+        /* c8 ignore stop */
+        this.withFileTypes = !!opts.withFileTypes;
+        this.signal = opts.signal;
+        this.follow = !!opts.follow;
+        this.dot = !!opts.dot;
+        this.dotRelative = !!opts.dotRelative;
+        this.nodir = !!opts.nodir;
+        this.mark = !!opts.mark;
+        if (!opts.cwd) {
+            this.cwd = '';
+        }
+        else if (opts.cwd instanceof URL || opts.cwd.startsWith('file://')) {
+            opts.cwd = fileURLToPath(opts.cwd);
+        }
+        this.cwd = opts.cwd || '';
+        this.root = opts.root;
+        this.magicalBraces = !!opts.magicalBraces;
+        this.nobrace = !!opts.nobrace;
+        this.noext = !!opts.noext;
+        this.realpath = !!opts.realpath;
+        this.absolute = opts.absolute;
+        this.includeChildMatches = opts.includeChildMatches !== false;
+        this.noglobstar = !!opts.noglobstar;
+        this.matchBase = !!opts.matchBase;
+        this.maxDepth =
+            typeof opts.maxDepth === 'number' ? opts.maxDepth : Infinity;
+        this.stat = !!opts.stat;
+        this.ignore = opts.ignore;
+        if (this.withFileTypes && this.absolute !== undefined) {
+            throw new Error('cannot set absolute and withFileTypes:true');
+        }
+        if (typeof pattern === 'string') {
+            pattern = [pattern];
+        }
+        this.windowsPathsNoEscape =
+            !!opts.windowsPathsNoEscape ||
+                opts.allowWindowsEscape ===
+                    false;
+        if (this.windowsPathsNoEscape) {
+            pattern = pattern.map(p => p.replace(/\\/g, '/'));
+        }
+        if (this.matchBase) {
+            if (opts.noglobstar) {
+                throw new TypeError('base matching requires globstar');
+            }
+            pattern = pattern.map(p => (p.includes('/') ? p : `./**/${p}`));
+        }
+        this.pattern = pattern;
+        this.platform = opts.platform || defaultPlatform;
+        this.opts = { ...opts, platform: this.platform };
+        if (opts.scurry) {
+            this.scurry = opts.scurry;
+            if (opts.nocase !== undefined &&
+                opts.nocase !== opts.scurry.nocase) {
+                throw new Error('nocase option contradicts provided scurry option');
+            }
+        }
+        else {
+            const Scurry = opts.platform === 'win32' ? PathScurryWin32
+                : opts.platform === 'darwin' ? PathScurryDarwin
+                    : opts.platform ? PathScurryPosix
+                        : PathScurry;
+            this.scurry = new Scurry(this.cwd, {
+                nocase: opts.nocase,
+                fs: opts.fs,
+            });
+        }
+        this.nocase = this.scurry.nocase;
+        // If you do nocase:true on a case-sensitive file system, then
+        // we need to use regexps instead of strings for non-magic
+        // path portions, because statting `aBc` won't return results
+        // for the file `AbC` for example.
+        const nocaseMagicOnly = this.platform === 'darwin' || this.platform === 'win32';
+        const mmo = {
+            // default nocase based on platform
+            ...opts,
+            dot: this.dot,
+            matchBase: this.matchBase,
+            nobrace: this.nobrace,
+            nocase: this.nocase,
+            nocaseMagicOnly,
+            nocomment: true,
+            noext: this.noext,
+            nonegate: true,
+            optimizationLevel: 2,
+            platform: this.platform,
+            windowsPathsNoEscape: this.windowsPathsNoEscape,
+            debug: !!this.opts.debug,
+        };
+        const mms = this.pattern.map(p => new Minimatch(p, mmo));
+        const [matchSet, globParts] = mms.reduce((set, m) => {
+            set[0].push(...m.set);
+            set[1].push(...m.globParts);
+            return set;
+        }, [[], []]);
+        this.patterns = matchSet.map((set, i) => {
+            const g = globParts[i];
+            /* c8 ignore start */
+            if (!g)
+                throw new Error('invalid pattern object');
+            /* c8 ignore stop */
+            return new Pattern(set, g, 0, this.platform);
+        });
+    }
+    async walk() {
+        // Walkers always return array of Path objects, so we just have to
+        // coerce them into the right shape.  It will have already called
+        // realpath() if the option was set to do so, so we know that's cached.
+        // start out knowing the cwd, at least
+        return [
+            ...(await new GlobWalker(this.patterns, this.scurry.cwd, {
+                ...this.opts,
+                maxDepth: this.maxDepth !== Infinity ?
+                    this.maxDepth + this.scurry.cwd.depth()
+                    : Infinity,
+                platform: this.platform,
+                nocase: this.nocase,
+                includeChildMatches: this.includeChildMatches,
+            }).walk()),
+        ];
+    }
+    walkSync() {
+        return [
+            ...new GlobWalker(this.patterns, this.scurry.cwd, {
+                ...this.opts,
+                maxDepth: this.maxDepth !== Infinity ?
+                    this.maxDepth + this.scurry.cwd.depth()
+                    : Infinity,
+                platform: this.platform,
+                nocase: this.nocase,
+                includeChildMatches: this.includeChildMatches,
+            }).walkSync(),
+        ];
+    }
+    stream() {
+        return new GlobStream(this.patterns, this.scurry.cwd, {
+            ...this.opts,
+            maxDepth: this.maxDepth !== Infinity ?
+                this.maxDepth + this.scurry.cwd.depth()
+                : Infinity,
+            platform: this.platform,
+            nocase: this.nocase,
+            includeChildMatches: this.includeChildMatches,
+        }).stream();
+    }
+    streamSync() {
+        return new GlobStream(this.patterns, this.scurry.cwd, {
+            ...this.opts,
+            maxDepth: this.maxDepth !== Infinity ?
+                this.maxDepth + this.scurry.cwd.depth()
+                : Infinity,
+            platform: this.platform,
+            nocase: this.nocase,
+            includeChildMatches: this.includeChildMatches,
+        }).streamSync();
+    }
+    /**
+     * Default sync iteration function. Returns a Generator that
+     * iterates over the results.
+     */
+    iterateSync() {
+        return this.streamSync()[Symbol.iterator]();
+    }
+    [Symbol.iterator]() {
+        return this.iterateSync();
+    }
+    /**
+     * Default async iteration function. Returns an AsyncGenerator that
+     * iterates over the results.
+     */
+    iterate() {
+        return this.stream()[Symbol.asyncIterator]();
+    }
+    [Symbol.asyncIterator]() {
+        return this.iterate();
+    }
+}
+
+/**
+ * Return true if the patterns provided contain any magic glob characters,
+ * given the options provided.
+ *
+ * Brace expansion is not considered "magic" unless the `magicalBraces` option
+ * is set, as brace expansion just turns one string into an array of strings.
+ * So a pattern like `'x{a,b}y'` would return `false`, because `'xay'` and
+ * `'xby'` both do not contain any magic glob characters, and it's treated the
+ * same as if you had called it on `['xay', 'xby']`. When `magicalBraces:true`
+ * is in the options, brace expansion _is_ treated as a pattern having magic.
+ */
+const hasMagic = (pattern, options = {}) => {
+    if (!Array.isArray(pattern)) {
+        pattern = [pattern];
+    }
+    for (const p of pattern) {
+        if (new Minimatch(p, options).hasMagic())
+            return true;
+    }
+    return false;
+};
+
+function globStreamSync(pattern, options = {}) {
+    return new Glob(pattern, options).streamSync();
+}
+function globStream(pattern, options = {}) {
+    return new Glob(pattern, options).stream();
+}
+function globSync(pattern, options = {}) {
+    return new Glob(pattern, options).walkSync();
+}
+async function glob_(pattern, options = {}) {
+    return new Glob(pattern, options).walk();
+}
+function globIterateSync(pattern, options = {}) {
+    return new Glob(pattern, options).iterateSync();
+}
+function globIterate(pattern, options = {}) {
+    return new Glob(pattern, options).iterate();
+}
+// aliases: glob.sync.stream() glob.stream.sync() glob.sync() etc
+const streamSync = globStreamSync;
+const stream$5 = Object.assign(globStream, { sync: globStreamSync });
+const iterateSync = globIterateSync;
+const iterate = Object.assign(globIterate, {
+    sync: globIterateSync,
+});
+const sync$9 = Object.assign(globSync, {
+    stream: globStreamSync,
+    iterate: globIterateSync,
+});
+const glob$1 = Object.assign(glob_, {
+    glob: glob_,
+    globSync,
+    sync: sync$9,
+    globStream,
+    stream: stream$5,
+    globStreamSync,
+    streamSync,
+    globIterate,
+    iterate,
+    globIterateSync,
+    iterateSync,
+    Glob,
+    hasMagic,
+    escape: escape$2,
+    unescape: unescape$1,
+});
+glob$1.glob = glob$1;
+
+const comma = ','.charCodeAt(0);
+const semicolon = ';'.charCodeAt(0);
+const chars$1 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+const intToChar = new Uint8Array(64); // 64 possible chars.
+const charToInt = new Uint8Array(128); // z is 122 in ASCII
+for (let i = 0; i < chars$1.length; i++) {
+    const c = chars$1.charCodeAt(i);
+    intToChar[i] = c;
+    charToInt[c] = i;
+}
+function decodeInteger(reader, relative) {
+    let value = 0;
+    let shift = 0;
+    let integer = 0;
+    do {
+        const c = reader.next();
+        integer = charToInt[c];
+        value |= (integer & 31) << shift;
+        shift += 5;
+    } while (integer & 32);
+    const shouldNegate = value & 1;
+    value >>>= 1;
+    if (shouldNegate) {
+        value = -0x80000000 | -value;
+    }
+    return relative + value;
+}
+function encodeInteger(builder, num, relative) {
+    let delta = num - relative;
+    delta = delta < 0 ? (-delta << 1) | 1 : delta << 1;
+    do {
+        let clamped = delta & 0b011111;
+        delta >>>= 5;
+        if (delta > 0)
+            clamped |= 0b100000;
+        builder.write(intToChar[clamped]);
+    } while (delta > 0);
+    return num;
+}
+function hasMoreVlq(reader, max) {
+    if (reader.pos >= max)
+        return false;
+    return reader.peek() !== comma;
+}
+
+const bufLength = 1024 * 16;
+// Provide a fallback for older environments.
+const td = typeof TextDecoder !== 'undefined'
+    ? /* #__PURE__ */ new TextDecoder()
+    : typeof Buffer !== 'undefined'
+        ? {
+            decode(buf) {
+                const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
+                return out.toString();
+            },
+        }
+        : {
+            decode(buf) {
+                let out = '';
+                for (let i = 0; i < buf.length; i++) {
+                    out += String.fromCharCode(buf[i]);
+                }
+                return out;
+            },
+        };
+class StringWriter {
+    constructor() {
+        this.pos = 0;
+        this.out = '';
+        this.buffer = new Uint8Array(bufLength);
+    }
+    write(v) {
+        const { buffer } = this;
+        buffer[this.pos++] = v;
+        if (this.pos === bufLength) {
+            this.out += td.decode(buffer);
+            this.pos = 0;
+        }
+    }
+    flush() {
+        const { buffer, out, pos } = this;
+        return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
+    }
+}
+class StringReader {
+    constructor(buffer) {
+        this.pos = 0;
+        this.buffer = buffer;
+    }
+    next() {
+        return this.buffer.charCodeAt(this.pos++);
+    }
+    peek() {
+        return this.buffer.charCodeAt(this.pos);
+    }
+    indexOf(char) {
+        const { buffer, pos } = this;
+        const idx = buffer.indexOf(char, pos);
+        return idx === -1 ? buffer.length : idx;
+    }
+}
+
+function decode(mappings) {
+    const { length } = mappings;
+    const reader = new StringReader(mappings);
+    const decoded = [];
+    let genColumn = 0;
+    let sourcesIndex = 0;
+    let sourceLine = 0;
+    let sourceColumn = 0;
+    let namesIndex = 0;
+    do {
+        const semi = reader.indexOf(';');
+        const line = [];
+        let sorted = true;
+        let lastCol = 0;
+        genColumn = 0;
+        while (reader.pos < semi) {
+            let seg;
+            genColumn = decodeInteger(reader, genColumn);
+            if (genColumn < lastCol)
+                sorted = false;
+            lastCol = genColumn;
+            if (hasMoreVlq(reader, semi)) {
+                sourcesIndex = decodeInteger(reader, sourcesIndex);
+                sourceLine = decodeInteger(reader, sourceLine);
+                sourceColumn = decodeInteger(reader, sourceColumn);
+                if (hasMoreVlq(reader, semi)) {
+                    namesIndex = decodeInteger(reader, namesIndex);
+                    seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
+                }
+                else {
+                    seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
+                }
+            }
+            else {
+                seg = [genColumn];
+            }
+            line.push(seg);
+            reader.pos++;
+        }
+        if (!sorted)
+            sort(line);
+        decoded.push(line);
+        reader.pos = semi + 1;
+    } while (reader.pos <= length);
+    return decoded;
+}
+function sort(line) {
+    line.sort(sortComparator$1);
+}
+function sortComparator$1(a, b) {
+    return a[0] - b[0];
+}
+function encode$1(decoded) {
+    const writer = new StringWriter();
+    let sourcesIndex = 0;
+    let sourceLine = 0;
+    let sourceColumn = 0;
+    let namesIndex = 0;
+    for (let i = 0; i < decoded.length; i++) {
+        const line = decoded[i];
+        if (i > 0)
+            writer.write(semicolon);
+        if (line.length === 0)
+            continue;
+        let genColumn = 0;
+        for (let j = 0; j < line.length; j++) {
+            const segment = line[j];
+            if (j > 0)
+                writer.write(comma);
+            genColumn = encodeInteger(writer, segment[0], genColumn);
+            if (segment.length === 1)
+                continue;
+            sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
+            sourceLine = encodeInteger(writer, segment[2], sourceLine);
+            sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
+            if (segment.length === 4)
+                continue;
+            namesIndex = encodeInteger(writer, segment[4], namesIndex);
+        }
+    }
+    return writer.flush();
+}
+
+class BitSet {
+	constructor(arg) {
+		this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
+	}
+
+	add(n) {
+		this.bits[n >> 5] |= 1 << (n & 31);
+	}
+
+	has(n) {
+		return !!(this.bits[n >> 5] & (1 << (n & 31)));
+	}
+}
+
+class Chunk {
+	constructor(start, end, content) {
+		this.start = start;
+		this.end = end;
+		this.original = content;
+
+		this.intro = '';
+		this.outro = '';
+
+		this.content = content;
+		this.storeName = false;
+		this.edited = false;
+
+		{
+			this.previous = null;
+			this.next = null;
+		}
+	}
+
+	appendLeft(content) {
+		this.outro += content;
+	}
+
+	appendRight(content) {
+		this.intro = this.intro + content;
+	}
+
+	clone() {
+		const chunk = new Chunk(this.start, this.end, this.original);
+
+		chunk.intro = this.intro;
+		chunk.outro = this.outro;
+		chunk.content = this.content;
+		chunk.storeName = this.storeName;
+		chunk.edited = this.edited;
+
+		return chunk;
+	}
+
+	contains(index) {
+		return this.start < index && index < this.end;
+	}
+
+	eachNext(fn) {
+		let chunk = this;
+		while (chunk) {
+			fn(chunk);
+			chunk = chunk.next;
+		}
+	}
+
+	eachPrevious(fn) {
+		let chunk = this;
+		while (chunk) {
+			fn(chunk);
+			chunk = chunk.previous;
+		}
+	}
+
+	edit(content, storeName, contentOnly) {
+		this.content = content;
+		if (!contentOnly) {
+			this.intro = '';
+			this.outro = '';
+		}
+		this.storeName = storeName;
+
+		this.edited = true;
+
+		return this;
+	}
+
+	prependLeft(content) {
+		this.outro = content + this.outro;
+	}
+
+	prependRight(content) {
+		this.intro = content + this.intro;
+	}
+
+	reset() {
+		this.intro = '';
+		this.outro = '';
+		if (this.edited) {
+			this.content = this.original;
+			this.storeName = false;
+			this.edited = false;
+		}
+	}
+
+	split(index) {
+		const sliceIndex = index - this.start;
+
+		const originalBefore = this.original.slice(0, sliceIndex);
+		const originalAfter = this.original.slice(sliceIndex);
+
+		this.original = originalBefore;
+
+		const newChunk = new Chunk(index, this.end, originalAfter);
+		newChunk.outro = this.outro;
+		this.outro = '';
+
+		this.end = index;
+
+		if (this.edited) {
+			// after split we should save the edit content record into the correct chunk
+			// to make sure sourcemap correct
+			// For example:
+			// '  test'.trim()
+			//     split   -> '  ' + 'test'
+			//   ✔️ edit    -> '' + 'test'
+			//   ✖️ edit    -> 'test' + '' 
+			// TODO is this block necessary?...
+			newChunk.edit('', false);
+			this.content = '';
+		} else {
+			this.content = originalBefore;
+		}
+
+		newChunk.next = this.next;
+		if (newChunk.next) newChunk.next.previous = newChunk;
+		newChunk.previous = this;
+		this.next = newChunk;
+
+		return newChunk;
+	}
+
+	toString() {
+		return this.intro + this.content + this.outro;
+	}
+
+	trimEnd(rx) {
+		this.outro = this.outro.replace(rx, '');
+		if (this.outro.length) return true;
+
+		const trimmed = this.content.replace(rx, '');
+
+		if (trimmed.length) {
+			if (trimmed !== this.content) {
+				this.split(this.start + trimmed.length).edit('', undefined, true);
+				if (this.edited) {
+					// save the change, if it has been edited
+					this.edit(trimmed, this.storeName, true);
+				}
+			}
+			return true;
+		} else {
+			this.edit('', undefined, true);
+
+			this.intro = this.intro.replace(rx, '');
+			if (this.intro.length) return true;
+		}
+	}
+
+	trimStart(rx) {
+		this.intro = this.intro.replace(rx, '');
+		if (this.intro.length) return true;
+
+		const trimmed = this.content.replace(rx, '');
+
+		if (trimmed.length) {
+			if (trimmed !== this.content) {
+				const newChunk = this.split(this.end - trimmed.length);
+				if (this.edited) {
+					// save the change, if it has been edited
+					newChunk.edit(trimmed, this.storeName, true);
+				}
+				this.edit('', undefined, true);
+			}
+			return true;
+		} else {
+			this.edit('', undefined, true);
+
+			this.outro = this.outro.replace(rx, '');
+			if (this.outro.length) return true;
+		}
+	}
+}
+
+function getBtoa() {
+	if (typeof globalThis !== 'undefined' && typeof globalThis.btoa === 'function') {
+		return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
+	} else if (typeof Buffer === 'function') {
+		return (str) => Buffer.from(str, 'utf-8').toString('base64');
+	} else {
+		return () => {
+			throw new Error('Unsupported environment: `window.btoa` or `Buffer` should be supported.');
+		};
+	}
+}
+
+const btoa$1 = /*#__PURE__*/ getBtoa();
+
+let SourceMap$1 = class SourceMap {
+	constructor(properties) {
+		this.version = 3;
+		this.file = properties.file;
+		this.sources = properties.sources;
+		this.sourcesContent = properties.sourcesContent;
+		this.names = properties.names;
+		this.mappings = encode$1(properties.mappings);
+		if (typeof properties.x_google_ignoreList !== 'undefined') {
+			this.x_google_ignoreList = properties.x_google_ignoreList;
+		}
+	}
+
+	toString() {
+		return JSON.stringify(this);
+	}
+
+	toUrl() {
+		return 'data:application/json;charset=utf-8;base64,' + btoa$1(this.toString());
+	}
+};
+
+function guessIndent(code) {
+	const lines = code.split('\n');
+
+	const tabbed = lines.filter((line) => /^\t+/.test(line));
+	const spaced = lines.filter((line) => /^ {2,}/.test(line));
+
+	if (tabbed.length === 0 && spaced.length === 0) {
+		return null;
+	}
+
+	// More lines tabbed than spaced? Assume tabs, and
+	// default to tabs in the case of a tie (or nothing
+	// to go on)
+	if (tabbed.length >= spaced.length) {
+		return '\t';
+	}
+
+	// Otherwise, we need to guess the multiple
+	const min = spaced.reduce((previous, current) => {
+		const numSpaces = /^ +/.exec(current)[0].length;
+		return Math.min(numSpaces, previous);
+	}, Infinity);
+
+	return new Array(min + 1).join(' ');
+}
+
+function getRelativePath(from, to) {
+	const fromParts = from.split(/[/\\]/);
+	const toParts = to.split(/[/\\]/);
+
+	fromParts.pop(); // get dirname
+
+	while (fromParts[0] === toParts[0]) {
+		fromParts.shift();
+		toParts.shift();
+	}
+
+	if (fromParts.length) {
+		let i = fromParts.length;
+		while (i--) fromParts[i] = '..';
+	}
+
+	return fromParts.concat(toParts).join('/');
+}
+
+const toString$1 = Object.prototype.toString;
+
+function isObject$2(thing) {
+	return toString$1.call(thing) === '[object Object]';
+}
+
+function getLocator(source) {
+	const originalLines = source.split('\n');
+	const lineOffsets = [];
+
+	for (let i = 0, pos = 0; i < originalLines.length; i++) {
+		lineOffsets.push(pos);
+		pos += originalLines[i].length + 1;
+	}
+
+	return function locate(index) {
+		let i = 0;
+		let j = lineOffsets.length;
+		while (i < j) {
+			const m = (i + j) >> 1;
+			if (index < lineOffsets[m]) {
+				j = m;
+			} else {
+				i = m + 1;
+			}
+		}
+		const line = i - 1;
+		const column = index - lineOffsets[line];
+		return { line, column };
+	};
+}
+
+const wordRegex = /\w/;
+
+class Mappings {
+	constructor(hires) {
+		this.hires = hires;
+		this.generatedCodeLine = 0;
+		this.generatedCodeColumn = 0;
+		this.raw = [];
+		this.rawSegments = this.raw[this.generatedCodeLine] = [];
+		this.pending = null;
+	}
+
+	addEdit(sourceIndex, content, loc, nameIndex) {
+		if (content.length) {
+			const contentLengthMinusOne = content.length - 1;
+			let contentLineEnd = content.indexOf('\n', 0);
+			let previousContentLineEnd = -1;
+			// Loop through each line in the content and add a segment, but stop if the last line is empty,
+			// else code afterwards would fill one line too many
+			while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
+				const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
+				if (nameIndex >= 0) {
+					segment.push(nameIndex);
+				}
+				this.rawSegments.push(segment);
+
+				this.generatedCodeLine += 1;
+				this.raw[this.generatedCodeLine] = this.rawSegments = [];
+				this.generatedCodeColumn = 0;
+
+				previousContentLineEnd = contentLineEnd;
+				contentLineEnd = content.indexOf('\n', contentLineEnd + 1);
+			}
+
+			const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
+			if (nameIndex >= 0) {
+				segment.push(nameIndex);
+			}
+			this.rawSegments.push(segment);
+
+			this.advance(content.slice(previousContentLineEnd + 1));
+		} else if (this.pending) {
+			this.rawSegments.push(this.pending);
+			this.advance(content);
+		}
+
+		this.pending = null;
+	}
+
+	addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
+		let originalCharIndex = chunk.start;
+		let first = true;
+		// when iterating each char, check if it's in a word boundary
+		let charInHiresBoundary = false;
+
+		while (originalCharIndex < chunk.end) {
+			if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
+				const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
+
+				if (this.hires === 'boundary') {
+					// in hires "boundary", group segments per word boundary than per char
+					if (wordRegex.test(original[originalCharIndex])) {
+						// for first char in the boundary found, start the boundary by pushing a segment
+						if (!charInHiresBoundary) {
+							this.rawSegments.push(segment);
+							charInHiresBoundary = true;
+						}
+					} else {
+						// for non-word char, end the boundary by pushing a segment
+						this.rawSegments.push(segment);
+						charInHiresBoundary = false;
+					}
+				} else {
+					this.rawSegments.push(segment);
+				}
+			}
+
+			if (original[originalCharIndex] === '\n') {
+				loc.line += 1;
+				loc.column = 0;
+				this.generatedCodeLine += 1;
+				this.raw[this.generatedCodeLine] = this.rawSegments = [];
+				this.generatedCodeColumn = 0;
+				first = true;
+			} else {
+				loc.column += 1;
+				this.generatedCodeColumn += 1;
+				first = false;
+			}
+
+			originalCharIndex += 1;
+		}
+
+		this.pending = null;
+	}
+
+	advance(str) {
+		if (!str) return;
+
+		const lines = str.split('\n');
+
+		if (lines.length > 1) {
+			for (let i = 0; i < lines.length - 1; i++) {
+				this.generatedCodeLine++;
+				this.raw[this.generatedCodeLine] = this.rawSegments = [];
+			}
+			this.generatedCodeColumn = 0;
+		}
+
+		this.generatedCodeColumn += lines[lines.length - 1].length;
+	}
+}
+
+const n$1 = '\n';
+
+const warned = {
+	insertLeft: false,
+	insertRight: false,
+	storeName: false,
+};
+
+class MagicString {
+	constructor(string, options = {}) {
+		const chunk = new Chunk(0, string.length, string);
+
+		Object.defineProperties(this, {
+			original: { writable: true, value: string },
+			outro: { writable: true, value: '' },
+			intro: { writable: true, value: '' },
+			firstChunk: { writable: true, value: chunk },
+			lastChunk: { writable: true, value: chunk },
+			lastSearchedChunk: { writable: true, value: chunk },
+			byStart: { writable: true, value: {} },
+			byEnd: { writable: true, value: {} },
+			filename: { writable: true, value: options.filename },
+			indentExclusionRanges: { writable: true, value: options.indentExclusionRanges },
+			sourcemapLocations: { writable: true, value: new BitSet() },
+			storedNames: { writable: true, value: {} },
+			indentStr: { writable: true, value: undefined },
+			ignoreList: { writable: true, value: options.ignoreList },
+		});
+
+		this.byStart[0] = chunk;
+		this.byEnd[string.length] = chunk;
+	}
+
+	addSourcemapLocation(char) {
+		this.sourcemapLocations.add(char);
+	}
+
+	append(content) {
+		if (typeof content !== 'string') throw new TypeError('outro content must be a string');
+
+		this.outro += content;
+		return this;
+	}
+
+	appendLeft(index, content) {
+		if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
+
+		this._split(index);
+
+		const chunk = this.byEnd[index];
+
+		if (chunk) {
+			chunk.appendLeft(content);
+		} else {
+			this.intro += content;
+		}
+		return this;
+	}
+
+	appendRight(index, content) {
+		if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
+
+		this._split(index);
+
+		const chunk = this.byStart[index];
+
+		if (chunk) {
+			chunk.appendRight(content);
+		} else {
+			this.outro += content;
+		}
+		return this;
+	}
+
+	clone() {
+		const cloned = new MagicString(this.original, { filename: this.filename });
+
+		let originalChunk = this.firstChunk;
+		let clonedChunk = (cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone());
+
+		while (originalChunk) {
+			cloned.byStart[clonedChunk.start] = clonedChunk;
+			cloned.byEnd[clonedChunk.end] = clonedChunk;
+
+			const nextOriginalChunk = originalChunk.next;
+			const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
+
+			if (nextClonedChunk) {
+				clonedChunk.next = nextClonedChunk;
+				nextClonedChunk.previous = clonedChunk;
+
+				clonedChunk = nextClonedChunk;
+			}
+
+			originalChunk = nextOriginalChunk;
+		}
+
+		cloned.lastChunk = clonedChunk;
+
+		if (this.indentExclusionRanges) {
+			cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
+		}
+
+		cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
+
+		cloned.intro = this.intro;
+		cloned.outro = this.outro;
+
+		return cloned;
+	}
+
+	generateDecodedMap(options) {
+		options = options || {};
+
+		const sourceIndex = 0;
+		const names = Object.keys(this.storedNames);
+		const mappings = new Mappings(options.hires);
+
+		const locate = getLocator(this.original);
+
+		if (this.intro) {
+			mappings.advance(this.intro);
+		}
+
+		this.firstChunk.eachNext((chunk) => {
+			const loc = locate(chunk.start);
+
+			if (chunk.intro.length) mappings.advance(chunk.intro);
+
+			if (chunk.edited) {
+				mappings.addEdit(
+					sourceIndex,
+					chunk.content,
+					loc,
+					chunk.storeName ? names.indexOf(chunk.original) : -1,
+				);
+			} else {
+				mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
+			}
+
+			if (chunk.outro.length) mappings.advance(chunk.outro);
+		});
+
+		return {
+			file: options.file ? options.file.split(/[/\\]/).pop() : undefined,
+			sources: [
+				options.source ? getRelativePath(options.file || '', options.source) : options.file || '',
+			],
+			sourcesContent: options.includeContent ? [this.original] : undefined,
+			names,
+			mappings: mappings.raw,
+			x_google_ignoreList: this.ignoreList ? [sourceIndex] : undefined,
+		};
+	}
+
+	generateMap(options) {
+		return new SourceMap$1(this.generateDecodedMap(options));
+	}
+
+	_ensureindentStr() {
+		if (this.indentStr === undefined) {
+			this.indentStr = guessIndent(this.original);
+		}
+	}
+
+	_getRawIndentString() {
+		this._ensureindentStr();
+		return this.indentStr;
+	}
+
+	getIndentString() {
+		this._ensureindentStr();
+		return this.indentStr === null ? '\t' : this.indentStr;
+	}
+
+	indent(indentStr, options) {
+		const pattern = /^[^\r\n]/gm;
+
+		if (isObject$2(indentStr)) {
+			options = indentStr;
+			indentStr = undefined;
+		}
+
+		if (indentStr === undefined) {
+			this._ensureindentStr();
+			indentStr = this.indentStr || '\t';
+		}
+
+		if (indentStr === '') return this; // noop
+
+		options = options || {};
+
+		// Process exclusion ranges
+		const isExcluded = {};
+
+		if (options.exclude) {
+			const exclusions =
+				typeof options.exclude[0] === 'number' ? [options.exclude] : options.exclude;
+			exclusions.forEach((exclusion) => {
+				for (let i = exclusion[0]; i < exclusion[1]; i += 1) {
+					isExcluded[i] = true;
+				}
+			});
+		}
+
+		let shouldIndentNextCharacter = options.indentStart !== false;
+		const replacer = (match) => {
+			if (shouldIndentNextCharacter) return `${indentStr}${match}`;
+			shouldIndentNextCharacter = true;
+			return match;
+		};
+
+		this.intro = this.intro.replace(pattern, replacer);
+
+		let charIndex = 0;
+		let chunk = this.firstChunk;
+
+		while (chunk) {
+			const end = chunk.end;
+
+			if (chunk.edited) {
+				if (!isExcluded[charIndex]) {
+					chunk.content = chunk.content.replace(pattern, replacer);
+
+					if (chunk.content.length) {
+						shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === '\n';
+					}
+				}
+			} else {
+				charIndex = chunk.start;
+
+				while (charIndex < end) {
+					if (!isExcluded[charIndex]) {
+						const char = this.original[charIndex];
+
+						if (char === '\n') {
+							shouldIndentNextCharacter = true;
+						} else if (char !== '\r' && shouldIndentNextCharacter) {
+							shouldIndentNextCharacter = false;
+
+							if (charIndex === chunk.start) {
+								chunk.prependRight(indentStr);
+							} else {
+								this._splitChunk(chunk, charIndex);
+								chunk = chunk.next;
+								chunk.prependRight(indentStr);
+							}
+						}
+					}
+
+					charIndex += 1;
+				}
+			}
+
+			charIndex = chunk.end;
+			chunk = chunk.next;
+		}
+
+		this.outro = this.outro.replace(pattern, replacer);
+
+		return this;
+	}
+
+	insert() {
+		throw new Error(
+			'magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)',
+		);
+	}
+
+	insertLeft(index, content) {
+		if (!warned.insertLeft) {
+			console.warn(
+				'magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead',
+			); // eslint-disable-line no-console
+			warned.insertLeft = true;
+		}
+
+		return this.appendLeft(index, content);
+	}
+
+	insertRight(index, content) {
+		if (!warned.insertRight) {
+			console.warn(
+				'magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead',
+			); // eslint-disable-line no-console
+			warned.insertRight = true;
+		}
+
+		return this.prependRight(index, content);
+	}
+
+	move(start, end, index) {
+		if (index >= start && index <= end) throw new Error('Cannot move a selection inside itself');
+
+		this._split(start);
+		this._split(end);
+		this._split(index);
+
+		const first = this.byStart[start];
+		const last = this.byEnd[end];
+
+		const oldLeft = first.previous;
+		const oldRight = last.next;
+
+		const newRight = this.byStart[index];
+		if (!newRight && last === this.lastChunk) return this;
+		const newLeft = newRight ? newRight.previous : this.lastChunk;
+
+		if (oldLeft) oldLeft.next = oldRight;
+		if (oldRight) oldRight.previous = oldLeft;
+
+		if (newLeft) newLeft.next = first;
+		if (newRight) newRight.previous = last;
+
+		if (!first.previous) this.firstChunk = last.next;
+		if (!last.next) {
+			this.lastChunk = first.previous;
+			this.lastChunk.next = null;
+		}
+
+		first.previous = newLeft;
+		last.next = newRight || null;
+
+		if (!newLeft) this.firstChunk = first;
+		if (!newRight) this.lastChunk = last;
+		return this;
+	}
+
+	overwrite(start, end, content, options) {
+		options = options || {};
+		return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
+	}
+
+	update(start, end, content, options) {
+		if (typeof content !== 'string') throw new TypeError('replacement content must be a string');
+
+		if (this.original.length !== 0) {
+			while (start < 0) start += this.original.length;
+			while (end < 0) end += this.original.length;
+		}
+
+		if (end > this.original.length) throw new Error('end is out of bounds');
+		if (start === end)
+			throw new Error(
+				'Cannot overwrite a zero-length range – use appendLeft or prependRight instead',
+			);
+
+		this._split(start);
+		this._split(end);
+
+		if (options === true) {
+			if (!warned.storeName) {
+				console.warn(
+					'The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string',
+				); // eslint-disable-line no-console
+				warned.storeName = true;
+			}
+
+			options = { storeName: true };
+		}
+		const storeName = options !== undefined ? options.storeName : false;
+		const overwrite = options !== undefined ? options.overwrite : false;
+
+		if (storeName) {
+			const original = this.original.slice(start, end);
+			Object.defineProperty(this.storedNames, original, {
+				writable: true,
+				value: true,
+				enumerable: true,
+			});
+		}
+
+		const first = this.byStart[start];
+		const last = this.byEnd[end];
+
+		if (first) {
+			let chunk = first;
+			while (chunk !== last) {
+				if (chunk.next !== this.byStart[chunk.end]) {
+					throw new Error('Cannot overwrite across a split point');
+				}
+				chunk = chunk.next;
+				chunk.edit('', false);
+			}
+
+			first.edit(content, storeName, !overwrite);
+		} else {
+			// must be inserting at the end
+			const newChunk = new Chunk(start, end, '').edit(content, storeName);
+
+			// TODO last chunk in the array may not be the last chunk, if it's moved...
+			last.next = newChunk;
+			newChunk.previous = last;
+		}
+		return this;
+	}
+
+	prepend(content) {
+		if (typeof content !== 'string') throw new TypeError('outro content must be a string');
+
+		this.intro = content + this.intro;
+		return this;
+	}
+
+	prependLeft(index, content) {
+		if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
+
+		this._split(index);
+
+		const chunk = this.byEnd[index];
+
+		if (chunk) {
+			chunk.prependLeft(content);
+		} else {
+			this.intro = content + this.intro;
+		}
+		return this;
+	}
+
+	prependRight(index, content) {
+		if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
+
+		this._split(index);
+
+		const chunk = this.byStart[index];
+
+		if (chunk) {
+			chunk.prependRight(content);
+		} else {
+			this.outro = content + this.outro;
+		}
+		return this;
+	}
+
+	remove(start, end) {
+		if (this.original.length !== 0) {
+			while (start < 0) start += this.original.length;
+			while (end < 0) end += this.original.length;
+		}
+
+		if (start === end) return this;
+
+		if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');
+		if (start > end) throw new Error('end must be greater than start');
+
+		this._split(start);
+		this._split(end);
+
+		let chunk = this.byStart[start];
+
+		while (chunk) {
+			chunk.intro = '';
+			chunk.outro = '';
+			chunk.edit('');
+
+			chunk = end > chunk.end ? this.byStart[chunk.end] : null;
+		}
+		return this;
+	}
+
+	reset(start, end) {
+		if (this.original.length !== 0) {
+			while (start < 0) start += this.original.length;
+			while (end < 0) end += this.original.length;
+		}
+
+		if (start === end) return this;
+
+		if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds');
+		if (start > end) throw new Error('end must be greater than start');
+
+		this._split(start);
+		this._split(end);
+
+		let chunk = this.byStart[start];
+
+		while (chunk) {
+			chunk.reset();
+
+			chunk = end > chunk.end ? this.byStart[chunk.end] : null;
+		}
+		return this;
+	}
+
+	lastChar() {
+		if (this.outro.length) return this.outro[this.outro.length - 1];
+		let chunk = this.lastChunk;
+		do {
+			if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
+			if (chunk.content.length) return chunk.content[chunk.content.length - 1];
+			if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
+		} while ((chunk = chunk.previous));
+		if (this.intro.length) return this.intro[this.intro.length - 1];
+		return '';
+	}
+
+	lastLine() {
+		let lineIndex = this.outro.lastIndexOf(n$1);
+		if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
+		let lineStr = this.outro;
+		let chunk = this.lastChunk;
+		do {
+			if (chunk.outro.length > 0) {
+				lineIndex = chunk.outro.lastIndexOf(n$1);
+				if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
+				lineStr = chunk.outro + lineStr;
+			}
+
+			if (chunk.content.length > 0) {
+				lineIndex = chunk.content.lastIndexOf(n$1);
+				if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
+				lineStr = chunk.content + lineStr;
+			}
+
+			if (chunk.intro.length > 0) {
+				lineIndex = chunk.intro.lastIndexOf(n$1);
+				if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
+				lineStr = chunk.intro + lineStr;
+			}
+		} while ((chunk = chunk.previous));
+		lineIndex = this.intro.lastIndexOf(n$1);
+		if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
+		return this.intro + lineStr;
+	}
+
+	slice(start = 0, end = this.original.length) {
+		if (this.original.length !== 0) {
+			while (start < 0) start += this.original.length;
+			while (end < 0) end += this.original.length;
+		}
+
+		let result = '';
+
+		// find start chunk
+		let chunk = this.firstChunk;
+		while (chunk && (chunk.start > start || chunk.end <= start)) {
+			// found end chunk before start
+			if (chunk.start < end && chunk.end >= end) {
+				return result;
+			}
+
+			chunk = chunk.next;
+		}
+
+		if (chunk && chunk.edited && chunk.start !== start)
+			throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
+
+		const startChunk = chunk;
+		while (chunk) {
+			if (chunk.intro && (startChunk !== chunk || chunk.start === start)) {
+				result += chunk.intro;
+			}
+
+			const containsEnd = chunk.start < end && chunk.end >= end;
+			if (containsEnd && chunk.edited && chunk.end !== end)
+				throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
+
+			const sliceStart = startChunk === chunk ? start - chunk.start : 0;
+			const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
+
+			result += chunk.content.slice(sliceStart, sliceEnd);
+
+			if (chunk.outro && (!containsEnd || chunk.end === end)) {
+				result += chunk.outro;
+			}
+
+			if (containsEnd) {
+				break;
+			}
+
+			chunk = chunk.next;
+		}
+
+		return result;
+	}
+
+	// TODO deprecate this? not really very useful
+	snip(start, end) {
+		const clone = this.clone();
+		clone.remove(0, start);
+		clone.remove(end, clone.original.length);
+
+		return clone;
+	}
+
+	_split(index) {
+		if (this.byStart[index] || this.byEnd[index]) return;
+
+		let chunk = this.lastSearchedChunk;
+		const searchForward = index > chunk.end;
+
+		while (chunk) {
+			if (chunk.contains(index)) return this._splitChunk(chunk, index);
+
+			chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
+		}
+	}
+
+	_splitChunk(chunk, index) {
+		if (chunk.edited && chunk.content.length) {
+			// zero-length edited chunks are a special case (overlapping replacements)
+			const loc = getLocator(this.original)(index);
+			throw new Error(
+				`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`,
+			);
+		}
+
+		const newChunk = chunk.split(index);
+
+		this.byEnd[index] = chunk;
+		this.byStart[index] = newChunk;
+		this.byEnd[newChunk.end] = newChunk;
+
+		if (chunk === this.lastChunk) this.lastChunk = newChunk;
+
+		this.lastSearchedChunk = chunk;
+		return true;
+	}
+
+	toString() {
+		let str = this.intro;
+
+		let chunk = this.firstChunk;
+		while (chunk) {
+			str += chunk.toString();
+			chunk = chunk.next;
+		}
+
+		return str + this.outro;
+	}
+
+	isEmpty() {
+		let chunk = this.firstChunk;
+		do {
+			if (
+				(chunk.intro.length && chunk.intro.trim()) ||
+				(chunk.content.length && chunk.content.trim()) ||
+				(chunk.outro.length && chunk.outro.trim())
+			)
+				return false;
+		} while ((chunk = chunk.next));
+		return true;
+	}
+
+	length() {
+		let chunk = this.firstChunk;
+		let length = 0;
+		do {
+			length += chunk.intro.length + chunk.content.length + chunk.outro.length;
+		} while ((chunk = chunk.next));
+		return length;
+	}
+
+	trimLines() {
+		return this.trim('[\\r\\n]');
+	}
+
+	trim(charType) {
+		return this.trimStart(charType).trimEnd(charType);
+	}
+
+	trimEndAborted(charType) {
+		const rx = new RegExp((charType || '\\s') + '+$');
+
+		this.outro = this.outro.replace(rx, '');
+		if (this.outro.length) return true;
+
+		let chunk = this.lastChunk;
+
+		do {
+			const end = chunk.end;
+			const aborted = chunk.trimEnd(rx);
+
+			// if chunk was trimmed, we have a new lastChunk
+			if (chunk.end !== end) {
+				if (this.lastChunk === chunk) {
+					this.lastChunk = chunk.next;
+				}
+
+				this.byEnd[chunk.end] = chunk;
+				this.byStart[chunk.next.start] = chunk.next;
+				this.byEnd[chunk.next.end] = chunk.next;
+			}
+
+			if (aborted) return true;
+			chunk = chunk.previous;
+		} while (chunk);
+
+		return false;
+	}
+
+	trimEnd(charType) {
+		this.trimEndAborted(charType);
+		return this;
+	}
+	trimStartAborted(charType) {
+		const rx = new RegExp('^' + (charType || '\\s') + '+');
+
+		this.intro = this.intro.replace(rx, '');
+		if (this.intro.length) return true;
+
+		let chunk = this.firstChunk;
+
+		do {
+			const end = chunk.end;
+			const aborted = chunk.trimStart(rx);
+
+			if (chunk.end !== end) {
+				// special case...
+				if (chunk === this.lastChunk) this.lastChunk = chunk.next;
+
+				this.byEnd[chunk.end] = chunk;
+				this.byStart[chunk.next.start] = chunk.next;
+				this.byEnd[chunk.next.end] = chunk.next;
+			}
+
+			if (aborted) return true;
+			chunk = chunk.next;
+		} while (chunk);
+
+		return false;
+	}
+
+	trimStart(charType) {
+		this.trimStartAborted(charType);
+		return this;
+	}
+
+	hasChanged() {
+		return this.original !== this.toString();
+	}
+
+	_replaceRegexp(searchValue, replacement) {
+		function getReplacement(match, str) {
+			if (typeof replacement === 'string') {
+				return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
+					// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_string_as_a_parameter
+					if (i === '$') return '$';
+					if (i === '&') return match[0];
+					const num = +i;
+					if (num < match.length) return match[+i];
+					return `$${i}`;
+				});
+			} else {
+				return replacement(...match, match.index, str, match.groups);
+			}
+		}
+		function matchAll(re, str) {
+			let match;
+			const matches = [];
+			while ((match = re.exec(str))) {
+				matches.push(match);
+			}
+			return matches;
+		}
+		if (searchValue.global) {
+			const matches = matchAll(searchValue, this.original);
+			matches.forEach((match) => {
+				if (match.index != null) {
+					const replacement = getReplacement(match, this.original);
+					if (replacement !== match[0]) {
+						this.overwrite(
+							match.index,
+							match.index + match[0].length,
+							replacement
+						);
+					}
+				}
+			});
+		} else {
+			const match = this.original.match(searchValue);
+			if (match && match.index != null) {
+				const replacement = getReplacement(match, this.original);
+				if (replacement !== match[0]) {
+					this.overwrite(
+						match.index,
+						match.index + match[0].length,
+						replacement
+					);
+				}
+			}
+		}
+		return this;
+	}
+
+	_replaceString(string, replacement) {
+		const { original } = this;
+		const index = original.indexOf(string);
+
+		if (index !== -1) {
+			this.overwrite(index, index + string.length, replacement);
+		}
+
+		return this;
+	}
+
+	replace(searchValue, replacement) {
+		if (typeof searchValue === 'string') {
+			return this._replaceString(searchValue, replacement);
+		}
+
+		return this._replaceRegexp(searchValue, replacement);
+	}
+
+	_replaceAllString(string, replacement) {
+		const { original } = this;
+		const stringLength = string.length;
+		for (
+			let index = original.indexOf(string);
+			index !== -1;
+			index = original.indexOf(string, index + stringLength)
+		) {
+			const previous = original.slice(index, index + stringLength);
+			if (previous !== replacement)
+				this.overwrite(index, index + stringLength, replacement);
+		}
+
+		return this;
+	}
+
+	replaceAll(searchValue, replacement) {
+		if (typeof searchValue === 'string') {
+			return this._replaceAllString(searchValue, replacement);
+		}
+
+		if (!searchValue.global) {
+			throw new TypeError(
+				'MagicString.prototype.replaceAll called with a non-global RegExp argument',
+			);
+		}
+
+		return this._replaceRegexp(searchValue, replacement);
+	}
+}
+
+function isReference(node, parent) {
+    if (node.type === 'MemberExpression') {
+        return !node.computed && isReference(node.object, node);
+    }
+    if (node.type === 'Identifier') {
+        if (!parent)
+            return true;
+        switch (parent.type) {
+            // disregard `bar` in `foo.bar`
+            case 'MemberExpression': return parent.computed || node === parent.object;
+            // disregard the `foo` in `class {foo(){}}` but keep it in `class {[foo](){}}`
+            case 'MethodDefinition': return parent.computed;
+            // disregard the `foo` in `class {foo=bar}` but keep it in `class {[foo]=bar}` and `class {bar=foo}`
+            case 'FieldDefinition': return parent.computed || node === parent.value;
+            // disregard the `bar` in `{ bar: foo }`, but keep it in `{ [bar]: foo }`
+            case 'Property': return parent.computed || node === parent.value;
+            // disregard the `bar` in `export { foo as bar }` or
+            // the foo in `import { foo as bar }`
+            case 'ExportSpecifier':
+            case 'ImportSpecifier': return node === parent.local;
+            // disregard the `foo` in `foo: while (...) { ... break foo; ... continue foo;}`
+            case 'LabeledStatement':
+            case 'BreakStatement':
+            case 'ContinueStatement': return false;
+            default: return true;
+        }
+    }
+    return false;
+}
+
+var version$2 = "26.0.1";
+var peerDependencies = {
+	rollup: "^2.68.0||^3.0.0||^4.0.0"
+};
+
+function tryParse(parse, code, id) {
+  try {
+    return parse(code, { allowReturnOutsideFunction: true });
+  } catch (err) {
+    err.message += ` in ${id}`;
+    throw err;
+  }
+}
+
+const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
+
+const firstpassNoGlobal = /\b(?:require|module|exports)\b/;
+
+function hasCjsKeywords(code, ignoreGlobal) {
+  const firstpass = ignoreGlobal ? firstpassNoGlobal : firstpassGlobal;
+  return firstpass.test(code);
+}
+
+/* eslint-disable no-underscore-dangle */
+
+
+function analyzeTopLevelStatements(parse, code, id) {
+  const ast = tryParse(parse, code, id);
+
+  let isEsModule = false;
+  let hasDefaultExport = false;
+  let hasNamedExports = false;
+
+  for (const node of ast.body) {
+    switch (node.type) {
+      case 'ExportDefaultDeclaration':
+        isEsModule = true;
+        hasDefaultExport = true;
+        break;
+      case 'ExportNamedDeclaration':
+        isEsModule = true;
+        if (node.declaration) {
+          hasNamedExports = true;
+        } else {
+          for (const specifier of node.specifiers) {
+            if (specifier.exported.name === 'default') {
+              hasDefaultExport = true;
+            } else {
+              hasNamedExports = true;
+            }
+          }
+        }
+        break;
+      case 'ExportAllDeclaration':
+        isEsModule = true;
+        if (node.exported && node.exported.name === 'default') {
+          hasDefaultExport = true;
+        } else {
+          hasNamedExports = true;
+        }
+        break;
+      case 'ImportDeclaration':
+        isEsModule = true;
+        break;
+    }
+  }
+
+  return { isEsModule, hasDefaultExport, hasNamedExports, ast };
+}
+
+/* eslint-disable import/prefer-default-export */
+
+
+function deconflict(scopes, globals, identifier) {
+  let i = 1;
+  let deconflicted = makeLegalIdentifier(identifier);
+  const hasConflicts = () =>
+    scopes.some((scope) => scope.contains(deconflicted)) || globals.has(deconflicted);
+
+  while (hasConflicts()) {
+    deconflicted = makeLegalIdentifier(`${identifier}_${i}`);
+    i += 1;
+  }
+
+  for (const scope of scopes) {
+    scope.declarations[deconflicted] = true;
+  }
+
+  return deconflicted;
+}
+
+function getName(id) {
+  const name = makeLegalIdentifier(basename$1(id, extname(id)));
+  if (name !== 'index') {
+    return name;
+  }
+  return makeLegalIdentifier(basename$1(dirname$1(id)));
+}
+
+function normalizePathSlashes(path) {
+  return path.replace(/\\/g, '/');
+}
+
+const getVirtualPathForDynamicRequirePath = (path, commonDir) =>
+  `/${normalizePathSlashes(relative$1(commonDir, path))}`;
+
+function capitalize(name) {
+  return name[0].toUpperCase() + name.slice(1);
+}
+
+function getStrictRequiresFilter({ strictRequires }) {
+  switch (strictRequires) {
+    case true:
+      return { strictRequiresFilter: () => true, detectCyclesAndConditional: false };
+    // eslint-disable-next-line no-undefined
+    case undefined:
+    case 'auto':
+    case 'debug':
+    case null:
+      return { strictRequiresFilter: () => false, detectCyclesAndConditional: true };
+    case false:
+      return { strictRequiresFilter: () => false, detectCyclesAndConditional: false };
+    default:
+      if (typeof strictRequires === 'string' || Array.isArray(strictRequires)) {
+        return {
+          strictRequiresFilter: createFilter$1(strictRequires),
+          detectCyclesAndConditional: false
+        };
+      }
+      throw new Error('Unexpected value for "strictRequires" option.');
+  }
+}
+
+function getPackageEntryPoint(dirPath) {
+  let entryPoint = 'index.js';
+
+  try {
+    if (existsSync(join$1(dirPath, 'package.json'))) {
+      entryPoint =
+        JSON.parse(readFileSync(join$1(dirPath, 'package.json'), { encoding: 'utf8' })).main ||
+        entryPoint;
+    }
+  } catch (ignored) {
+    // ignored
+  }
+
+  return entryPoint;
+}
+
+function isDirectory$1(path) {
+  try {
+    if (statSync$1(path).isDirectory()) return true;
+  } catch (ignored) {
+    // Nothing to do here
+  }
+  return false;
+}
+
+function getDynamicRequireModules(patterns, dynamicRequireRoot) {
+  const dynamicRequireModules = new Map();
+  const dirNames = new Set();
+  for (const pattern of !patterns || Array.isArray(patterns) ? patterns || [] : [patterns]) {
+    const isNegated = pattern.startsWith('!');
+    const modifyMap = (targetPath, resolvedPath) =>
+      isNegated
+        ? dynamicRequireModules.delete(targetPath)
+        : dynamicRequireModules.set(targetPath, resolvedPath);
+    for (const path of glob$1
+      .sync(isNegated ? pattern.substr(1) : pattern)
+      .sort((a, b) => a.localeCompare(b, 'en'))) {
+      const resolvedPath = resolve$3(path);
+      const requirePath = normalizePathSlashes(resolvedPath);
+      if (isDirectory$1(resolvedPath)) {
+        dirNames.add(resolvedPath);
+        const modulePath = resolve$3(join$1(resolvedPath, getPackageEntryPoint(path)));
+        modifyMap(requirePath, modulePath);
+        modifyMap(normalizePathSlashes(modulePath), modulePath);
+      } else {
+        dirNames.add(dirname$1(resolvedPath));
+        modifyMap(requirePath, resolvedPath);
+      }
+    }
+  }
+  return {
+    commonDir: dirNames.size ? getCommonDir([...dirNames, dynamicRequireRoot]) : null,
+    dynamicRequireModules
+  };
+}
+
+const FAILED_REQUIRE_ERROR = `throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');`;
+
+const COMMONJS_REQUIRE_EXPORT = 'commonjsRequire';
+const CREATE_COMMONJS_REQUIRE_EXPORT = 'createCommonjsRequire';
+
+function getDynamicModuleRegistry(
+  isDynamicRequireModulesEnabled,
+  dynamicRequireModules,
+  commonDir,
+  ignoreDynamicRequires
+) {
+  if (!isDynamicRequireModulesEnabled) {
+    return `export function ${COMMONJS_REQUIRE_EXPORT}(path) {
+	${FAILED_REQUIRE_ERROR}
+}`;
+  }
+  const dynamicModuleImports = [...dynamicRequireModules.values()]
+    .map(
+      (id, index) =>
+        `import ${
+          id.endsWith('.json') ? `json${index}` : `{ __require as require${index} }`
+        } from ${JSON.stringify(id)};`
+    )
+    .join('\n');
+  const dynamicModuleProps = [...dynamicRequireModules.keys()]
+    .map(
+      (id, index) =>
+        `\t\t${JSON.stringify(getVirtualPathForDynamicRequirePath(id, commonDir))}: ${
+          id.endsWith('.json') ? `function () { return json${index}; }` : `require${index}`
+        }`
+    )
+    .join(',\n');
+  return `${dynamicModuleImports}
+
+var dynamicModules;
+
+function getDynamicModules() {
+	return dynamicModules || (dynamicModules = {
+${dynamicModuleProps}
+	});
+}
+
+export function ${CREATE_COMMONJS_REQUIRE_EXPORT}(originalModuleDir) {
+	function handleRequire(path) {
+		var resolvedPath = commonjsResolve(path, originalModuleDir);
+		if (resolvedPath !== null) {
+			return getDynamicModules()[resolvedPath]();
+		}
+		${ignoreDynamicRequires ? 'return require(path);' : FAILED_REQUIRE_ERROR}
+	}
+	handleRequire.resolve = function (path) {
+		var resolvedPath = commonjsResolve(path, originalModuleDir);
+		if (resolvedPath !== null) {
+			return resolvedPath;
+		}
+		return require.resolve(path);
+	}
+	return handleRequire;
+}
+
+function commonjsResolve (path, originalModuleDir) {
+	var shouldTryNodeModules = isPossibleNodeModulesPath(path);
+	path = normalize(path);
+	var relPath;
+	if (path[0] === '/') {
+		originalModuleDir = '';
+	}
+	var modules = getDynamicModules();
+	var checkedExtensions = ['', '.js', '.json'];
+	while (true) {
+		if (!shouldTryNodeModules) {
+			relPath = normalize(originalModuleDir + '/' + path);
+		} else {
+			relPath = normalize(originalModuleDir + '/node_modules/' + path);
+		}
+
+		if (relPath.endsWith('/..')) {
+			break; // Travelled too far up, avoid infinite loop
+		}
+
+		for (var extensionIndex = 0; extensionIndex < checkedExtensions.length; extensionIndex++) {
+			var resolvedPath = relPath + checkedExtensions[extensionIndex];
+			if (modules[resolvedPath]) {
+				return resolvedPath;
+			}
+		}
+		if (!shouldTryNodeModules) break;
+		var nextDir = normalize(originalModuleDir + '/..');
+		if (nextDir === originalModuleDir) break;
+		originalModuleDir = nextDir;
+	}
+	return null;
+}
+
+function isPossibleNodeModulesPath (modulePath) {
+	var c0 = modulePath[0];
+	if (c0 === '/' || c0 === '\\\\') return false;
+	var c1 = modulePath[1], c2 = modulePath[2];
+	if ((c0 === '.' && (!c1 || c1 === '/' || c1 === '\\\\')) ||
+		(c0 === '.' && c1 === '.' && (!c2 || c2 === '/' || c2 === '\\\\'))) return false;
+	if (c1 === ':' && (c2 === '/' || c2 === '\\\\')) return false;
+	return true;
+}
+
+function normalize (path) {
+	path = path.replace(/\\\\/g, '/');
+	var parts = path.split('/');
+	var slashed = parts[0] === '';
+	for (var i = 1; i < parts.length; i++) {
+		if (parts[i] === '.' || parts[i] === '') {
+			parts.splice(i--, 1);
+		}
+	}
+	for (var i = 1; i < parts.length; i++) {
+		if (parts[i] !== '..') continue;
+		if (i > 0 && parts[i - 1] !== '..' && parts[i - 1] !== '.') {
+			parts.splice(--i, 2);
+			i--;
+		}
+	}
+	path = parts.join('/');
+	if (slashed && path[0] !== '/') path = '/' + path;
+	else if (path.length === 0) path = '.';
+	return path;
+}`;
+}
+
+const isWrappedId = (id, suffix) => id.endsWith(suffix);
+const wrapId = (id, suffix) => `\0${id}${suffix}`;
+const unwrapId = (wrappedId, suffix) => wrappedId.slice(1, -suffix.length);
+
+const PROXY_SUFFIX = '?commonjs-proxy';
+const WRAPPED_SUFFIX = '?commonjs-wrapped';
+const EXTERNAL_SUFFIX = '?commonjs-external';
+const EXPORTS_SUFFIX = '?commonjs-exports';
+const MODULE_SUFFIX = '?commonjs-module';
+const ENTRY_SUFFIX = '?commonjs-entry';
+const ES_IMPORT_SUFFIX = '?commonjs-es-import';
+
+const DYNAMIC_MODULES_ID = '\0commonjs-dynamic-modules';
+const HELPERS_ID = '\0commonjsHelpers.js';
+
+const IS_WRAPPED_COMMONJS = 'withRequireFunction';
+
+// `x['default']` is used instead of `x.default` for backward compatibility with ES3 browsers.
+// Minifiers like uglify will usually transpile it back if compatibility with ES3 is not enabled.
+// This could be improved by inspecting Rollup's "generatedCode" option
+
+const HELPERS = `
+export var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
+
+export function getDefaultExportFromCjs (x) {
+	return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
+}
+
+export function getDefaultExportFromNamespaceIfPresent (n) {
+	return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
+}
+
+export function getDefaultExportFromNamespaceIfNotNamed (n) {
+	return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
+}
+
+export function getAugmentedNamespace(n) {
+  if (n.__esModule) return n;
+  var f = n.default;
+	if (typeof f == "function") {
+		var a = function a () {
+			if (this instanceof a) {
+        return Reflect.construct(f, arguments, this.constructor);
+			}
+			return f.apply(this, arguments);
+		};
+		a.prototype = f.prototype;
+  } else a = {};
+  Object.defineProperty(a, '__esModule', {value: true});
+	Object.keys(n).forEach(function (k) {
+		var d = Object.getOwnPropertyDescriptor(n, k);
+		Object.defineProperty(a, k, d.get ? d : {
+			enumerable: true,
+			get: function () {
+				return n[k];
+			}
+		});
+	});
+	return a;
+}
+`;
+
+function getHelpersModule() {
+  return HELPERS;
+}
+
+function getUnknownRequireProxy(id, requireReturnsDefault) {
+  if (requireReturnsDefault === true || id.endsWith('.json')) {
+    return `export { default } from ${JSON.stringify(id)};`;
+  }
+  const name = getName(id);
+  const exported =
+    requireReturnsDefault === 'auto'
+      ? `import { getDefaultExportFromNamespaceIfNotNamed } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});`
+      : requireReturnsDefault === 'preferred'
+      ? `import { getDefaultExportFromNamespaceIfPresent } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});`
+      : !requireReturnsDefault
+      ? `import { getAugmentedNamespace } from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});`
+      : `export default ${name};`;
+  return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;
+}
+
+async function getStaticRequireProxy(id, requireReturnsDefault, loadModule) {
+  const name = getName(id);
+  const {
+    meta: { commonjs: commonjsMeta }
+  } = await loadModule({ id });
+  if (!commonjsMeta) {
+    return getUnknownRequireProxy(id, requireReturnsDefault);
+  }
+  if (commonjsMeta.isCommonJS) {
+    return `export { __moduleExports as default } from ${JSON.stringify(id)};`;
+  }
+  if (!requireReturnsDefault) {
+    return `import { getAugmentedNamespace } from "${HELPERS_ID}"; import * as ${name} from ${JSON.stringify(
+      id
+    )}; export default /*@__PURE__*/getAugmentedNamespace(${name});`;
+  }
+  if (
+    requireReturnsDefault !== true &&
+    (requireReturnsDefault === 'namespace' ||
+      !commonjsMeta.hasDefaultExport ||
+      (requireReturnsDefault === 'auto' && commonjsMeta.hasNamedExports))
+  ) {
+    return `import * as ${name} from ${JSON.stringify(id)}; export default ${name};`;
+  }
+  return `export { default } from ${JSON.stringify(id)};`;
+}
+
+function getEntryProxy(id, defaultIsModuleExports, getModuleInfo, shebang) {
+  const {
+    meta: { commonjs: commonjsMeta },
+    hasDefaultExport
+  } = getModuleInfo(id);
+  if (!commonjsMeta || commonjsMeta.isCommonJS !== IS_WRAPPED_COMMONJS) {
+    const stringifiedId = JSON.stringify(id);
+    let code = `export * from ${stringifiedId};`;
+    if (hasDefaultExport) {
+      code += `export { default } from ${stringifiedId};`;
+    }
+    return shebang + code;
+  }
+  const result = getEsImportProxy(id, defaultIsModuleExports);
+  return {
+    ...result,
+    code: shebang + result.code
+  };
+}
+
+function getEsImportProxy(id, defaultIsModuleExports) {
+  const name = getName(id);
+  const exportsName = `${name}Exports`;
+  const requireModule = `require${capitalize(name)}`;
+  let code =
+    `import { getDefaultExportFromCjs } from "${HELPERS_ID}";\n` +
+    `import { __require as ${requireModule} } from ${JSON.stringify(id)};\n` +
+    `var ${exportsName} = ${requireModule}();\n` +
+    `export { ${exportsName} as __moduleExports };`;
+  if (defaultIsModuleExports === true) {
+    code += `\nexport { ${exportsName} as default };`;
+  } else {
+    code += `export default /*@__PURE__*/getDefaultExportFromCjs(${exportsName});`;
+  }
+  return {
+    code,
+    syntheticNamedExports: '__moduleExports'
+  };
+}
+
+/* eslint-disable no-param-reassign, no-undefined */
+
+
+function getCandidatesForExtension(resolved, extension) {
+  return [resolved + extension, `${resolved}${sep$1}index${extension}`];
+}
+
+function getCandidates(resolved, extensions) {
+  return extensions.reduce(
+    (paths, extension) => paths.concat(getCandidatesForExtension(resolved, extension)),
+    [resolved]
+  );
+}
+
+function resolveExtensions(importee, importer, extensions) {
+  // not our problem
+  if (importee[0] !== '.' || !importer) return undefined;
+
+  const resolved = resolve$3(dirname$1(importer), importee);
+  const candidates = getCandidates(resolved, extensions);
+
+  for (let i = 0; i < candidates.length; i += 1) {
+    try {
+      const stats = statSync$1(candidates[i]);
+      if (stats.isFile()) return { id: candidates[i] };
+    } catch (err) {
+      /* noop */
+    }
+  }
+
+  return undefined;
+}
+
+function getResolveId(extensions, isPossibleCjsId) {
+  const currentlyResolving = new Map();
+
+  return {
+    /**
+     * This is a Maps of importers to Sets of require sources being resolved at
+     * the moment by resolveRequireSourcesAndUpdateMeta
+     */
+    currentlyResolving,
+    async resolveId(importee, importer, resolveOptions) {
+      const customOptions = resolveOptions.custom;
+      // All logic below is specific to ES imports.
+      // Also, if we do not skip this logic for requires that are resolved while
+      // transforming a commonjs file, it can easily lead to deadlocks.
+      if (
+        customOptions &&
+        customOptions['node-resolve'] &&
+        customOptions['node-resolve'].isRequire
+      ) {
+        return null;
+      }
+      const currentlyResolvingForParent = currentlyResolving.get(importer);
+      if (currentlyResolvingForParent && currentlyResolvingForParent.has(importee)) {
+        this.warn({
+          code: 'THIS_RESOLVE_WITHOUT_OPTIONS',
+          message:
+            'It appears a plugin has implemented a "resolveId" hook that uses "this.resolve" without forwarding the third "options" parameter of "resolveId". This is problematic as it can lead to wrong module resolutions especially for the node-resolve plugin and in certain cases cause early exit errors for the commonjs plugin.\nIn rare cases, this warning can appear if the same file is both imported and required from the same mixed ES/CommonJS module, in which case it can be ignored.',
+          url: 'https://rollupjs.org/guide/en/#resolveid'
+        });
+        return null;
+      }
+
+      if (isWrappedId(importee, WRAPPED_SUFFIX)) {
+        return unwrapId(importee, WRAPPED_SUFFIX);
+      }
+
+      if (
+        importee.endsWith(ENTRY_SUFFIX) ||
+        isWrappedId(importee, MODULE_SUFFIX) ||
+        isWrappedId(importee, EXPORTS_SUFFIX) ||
+        isWrappedId(importee, PROXY_SUFFIX) ||
+        isWrappedId(importee, ES_IMPORT_SUFFIX) ||
+        isWrappedId(importee, EXTERNAL_SUFFIX) ||
+        importee.startsWith(HELPERS_ID) ||
+        importee === DYNAMIC_MODULES_ID
+      ) {
+        return importee;
+      }
+
+      if (importer) {
+        if (
+          importer === DYNAMIC_MODULES_ID ||
+          // Proxies are only importing resolved ids, no need to resolve again
+          isWrappedId(importer, PROXY_SUFFIX) ||
+          isWrappedId(importer, ES_IMPORT_SUFFIX) ||
+          importer.endsWith(ENTRY_SUFFIX)
+        ) {
+          return importee;
+        }
+        if (isWrappedId(importer, EXTERNAL_SUFFIX)) {
+          // We need to return null for unresolved imports so that the proper warning is shown
+          if (
+            !(await this.resolve(
+              importee,
+              importer,
+              Object.assign({ skipSelf: true }, resolveOptions)
+            ))
+          ) {
+            return null;
+          }
+          // For other external imports, we need to make sure they are handled as external
+          return { id: importee, external: true };
+        }
+      }
+
+      if (importee.startsWith('\0')) {
+        return null;
+      }
+
+      // If this is an entry point or ESM import, we need to figure out if the importee is wrapped and
+      // if that is the case, we need to add a proxy.
+      const resolved =
+        (await this.resolve(
+          importee,
+          importer,
+          Object.assign({ skipSelf: true }, resolveOptions)
+        )) || resolveExtensions(importee, importer, extensions);
+      // Make sure that even if other plugins resolve again, we ignore our own proxies
+      if (
+        !resolved ||
+        resolved.external ||
+        resolved.id.endsWith(ENTRY_SUFFIX) ||
+        isWrappedId(resolved.id, ES_IMPORT_SUFFIX) ||
+        !isPossibleCjsId(resolved.id)
+      ) {
+        return resolved;
+      }
+      const moduleInfo = await this.load(resolved);
+      const {
+        meta: { commonjs: commonjsMeta }
+      } = moduleInfo;
+      if (commonjsMeta) {
+        const { isCommonJS } = commonjsMeta;
+        if (isCommonJS) {
+          if (resolveOptions.isEntry) {
+            moduleInfo.moduleSideEffects = true;
+            // We must not precede entry proxies with a `\0` as that will mess up relative external resolution
+            return resolved.id + ENTRY_SUFFIX;
+          }
+          if (isCommonJS === IS_WRAPPED_COMMONJS) {
+            return { id: wrapId(resolved.id, ES_IMPORT_SUFFIX), meta: { commonjs: { resolved } } };
+          }
+        }
+      }
+      return resolved;
+    }
+  };
+}
+
+function getRequireResolver(extensions, detectCyclesAndConditional, currentlyResolving) {
+  const knownCjsModuleTypes = Object.create(null);
+  const requiredIds = Object.create(null);
+  const unconditionallyRequiredIds = Object.create(null);
+  const dependencies = Object.create(null);
+  const getDependencies = (id) => dependencies[id] || (dependencies[id] = new Set());
+
+  const isCyclic = (id) => {
+    const dependenciesToCheck = new Set(getDependencies(id));
+    for (const dependency of dependenciesToCheck) {
+      if (dependency === id) {
+        return true;
+      }
+      for (const childDependency of getDependencies(dependency)) {
+        dependenciesToCheck.add(childDependency);
+      }
+    }
+    return false;
+  };
+
+  // Once a module is listed here, its type (wrapped or not) is fixed and may
+  // not change for the rest of the current build, to not break already
+  // transformed modules.
+  const fullyAnalyzedModules = Object.create(null);
+
+  const getTypeForFullyAnalyzedModule = (id) => {
+    const knownType = knownCjsModuleTypes[id];
+    if (knownType !== true || !detectCyclesAndConditional || fullyAnalyzedModules[id]) {
+      return knownType;
+    }
+    if (isCyclic(id)) {
+      return (knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS);
+    }
+    return knownType;
+  };
+
+  const setInitialParentType = (id, initialCommonJSType) => {
+    // Fully analyzed modules may never change type
+    if (fullyAnalyzedModules[id]) {
+      return;
+    }
+    knownCjsModuleTypes[id] = initialCommonJSType;
+    if (
+      detectCyclesAndConditional &&
+      knownCjsModuleTypes[id] === true &&
+      requiredIds[id] &&
+      !unconditionallyRequiredIds[id]
+    ) {
+      knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS;
+    }
+  };
+
+  const analyzeRequiredModule = async (parentId, resolved, isConditional, loadModule) => {
+    const childId = resolved.id;
+    requiredIds[childId] = true;
+    if (!(isConditional || knownCjsModuleTypes[parentId] === IS_WRAPPED_COMMONJS)) {
+      unconditionallyRequiredIds[childId] = true;
+    }
+
+    getDependencies(parentId).add(childId);
+    if (!isCyclic(childId)) {
+      // This makes sure the current transform handler waits for all direct
+      // dependencies to be loaded and transformed and therefore for all
+      // transitive CommonJS dependencies to be loaded as well so that all
+      // cycles have been found and knownCjsModuleTypes is reliable.
+      await loadModule(resolved);
+    }
+  };
+
+  const getTypeForImportedModule = async (resolved, loadModule) => {
+    if (resolved.id in knownCjsModuleTypes) {
+      // This handles cyclic ES dependencies
+      return knownCjsModuleTypes[resolved.id];
+    }
+    const {
+      meta: { commonjs }
+    } = await loadModule(resolved);
+    return (commonjs && commonjs.isCommonJS) || false;
+  };
+
+  return {
+    getWrappedIds: () =>
+      Object.keys(knownCjsModuleTypes).filter(
+        (id) => knownCjsModuleTypes[id] === IS_WRAPPED_COMMONJS
+      ),
+    isRequiredId: (id) => requiredIds[id],
+    async shouldTransformCachedModule({
+      id: parentId,
+      resolvedSources,
+      meta: { commonjs: parentMeta }
+    }) {
+      // We explicitly track ES modules to handle circular imports
+      if (!(parentMeta && parentMeta.isCommonJS)) knownCjsModuleTypes[parentId] = false;
+      if (isWrappedId(parentId, ES_IMPORT_SUFFIX)) return false;
+      const parentRequires = parentMeta && parentMeta.requires;
+      if (parentRequires) {
+        setInitialParentType(parentId, parentMeta.initialCommonJSType);
+        await Promise.all(
+          parentRequires.map(({ resolved, isConditional }) =>
+            analyzeRequiredModule(parentId, resolved, isConditional, this.load)
+          )
+        );
+        if (getTypeForFullyAnalyzedModule(parentId) !== parentMeta.isCommonJS) {
+          return true;
+        }
+        for (const {
+          resolved: { id }
+        } of parentRequires) {
+          if (getTypeForFullyAnalyzedModule(id) !== parentMeta.isRequiredCommonJS[id]) {
+            return true;
+          }
+        }
+        // Now that we decided to go with the cached copy, neither the parent
+        // module nor any of its children may change types anymore
+        fullyAnalyzedModules[parentId] = true;
+        for (const {
+          resolved: { id }
+        } of parentRequires) {
+          fullyAnalyzedModules[id] = true;
+        }
+      }
+      const parentRequireSet = new Set((parentRequires || []).map(({ resolved: { id } }) => id));
+      return (
+        await Promise.all(
+          Object.keys(resolvedSources)
+            .map((source) => resolvedSources[source])
+            .filter(({ id, external }) => !(external || parentRequireSet.has(id)))
+            .map(async (resolved) => {
+              if (isWrappedId(resolved.id, ES_IMPORT_SUFFIX)) {
+                return (
+                  (await getTypeForImportedModule(
+                    (
+                      await this.load({ id: resolved.id })
+                    ).meta.commonjs.resolved,
+                    this.load
+                  )) !== IS_WRAPPED_COMMONJS
+                );
+              }
+              return (await getTypeForImportedModule(resolved, this.load)) === IS_WRAPPED_COMMONJS;
+            })
+        )
+      ).some((shouldTransform) => shouldTransform);
+    },
+    /* eslint-disable no-param-reassign */
+    resolveRequireSourcesAndUpdateMeta:
+      (rollupContext) => async (parentId, isParentCommonJS, parentMeta, sources) => {
+        parentMeta.initialCommonJSType = isParentCommonJS;
+        parentMeta.requires = [];
+        parentMeta.isRequiredCommonJS = Object.create(null);
+        setInitialParentType(parentId, isParentCommonJS);
+        const currentlyResolvingForParent = currentlyResolving.get(parentId) || new Set();
+        currentlyResolving.set(parentId, currentlyResolvingForParent);
+        const requireTargets = await Promise.all(
+          sources.map(async ({ source, isConditional }) => {
+            // Never analyze or proxy internal modules
+            if (source.startsWith('\0')) {
+              return { id: source, allowProxy: false };
+            }
+            currentlyResolvingForParent.add(source);
+            const resolved =
+              (await rollupContext.resolve(source, parentId, {
+                skipSelf: false,
+                custom: { 'node-resolve': { isRequire: true } }
+              })) || resolveExtensions(source, parentId, extensions);
+            currentlyResolvingForParent.delete(source);
+            if (!resolved) {
+              return { id: wrapId(source, EXTERNAL_SUFFIX), allowProxy: false };
+            }
+            const childId = resolved.id;
+            if (resolved.external) {
+              return { id: wrapId(childId, EXTERNAL_SUFFIX), allowProxy: false };
+            }
+            parentMeta.requires.push({ resolved, isConditional });
+            await analyzeRequiredModule(parentId, resolved, isConditional, rollupContext.load);
+            return { id: childId, allowProxy: true };
+          })
+        );
+        parentMeta.isCommonJS = getTypeForFullyAnalyzedModule(parentId);
+        fullyAnalyzedModules[parentId] = true;
+        return requireTargets.map(({ id: dependencyId, allowProxy }, index) => {
+          // eslint-disable-next-line no-multi-assign
+          const isCommonJS = (parentMeta.isRequiredCommonJS[dependencyId] =
+            getTypeForFullyAnalyzedModule(dependencyId));
+          fullyAnalyzedModules[dependencyId] = true;
+          return {
+            source: sources[index].source,
+            id: allowProxy
+              ? isCommonJS === IS_WRAPPED_COMMONJS
+                ? wrapId(dependencyId, WRAPPED_SUFFIX)
+                : wrapId(dependencyId, PROXY_SUFFIX)
+              : dependencyId,
+            isCommonJS
+          };
+        });
+      },
+    isCurrentlyResolving(source, parentId) {
+      const currentlyResolvingForParent = currentlyResolving.get(parentId);
+      return currentlyResolvingForParent && currentlyResolvingForParent.has(source);
+    }
+  };
+}
+
+function validateVersion(actualVersion, peerDependencyVersion, name) {
+  const versionRegexp = /\^(\d+\.\d+\.\d+)/g;
+  let minMajor = Infinity;
+  let minMinor = Infinity;
+  let minPatch = Infinity;
+  let foundVersion;
+  // eslint-disable-next-line no-cond-assign
+  while ((foundVersion = versionRegexp.exec(peerDependencyVersion))) {
+    const [foundMajor, foundMinor, foundPatch] = foundVersion[1].split('.').map(Number);
+    if (foundMajor < minMajor) {
+      minMajor = foundMajor;
+      minMinor = foundMinor;
+      minPatch = foundPatch;
+    }
+  }
+  if (!actualVersion) {
+    throw new Error(
+      `Insufficient ${name} version: "@rollup/plugin-commonjs" requires at least ${name}@${minMajor}.${minMinor}.${minPatch}.`
+    );
+  }
+  const [major, minor, patch] = actualVersion.split('.').map(Number);
+  if (
+    major < minMajor ||
+    (major === minMajor && (minor < minMinor || (minor === minMinor && patch < minPatch)))
+  ) {
+    throw new Error(
+      `Insufficient ${name} version: "@rollup/plugin-commonjs" requires at least ${name}@${minMajor}.${minMinor}.${minPatch} but found ${name}@${actualVersion}.`
+    );
+  }
+}
+
+const operators = {
+  '==': (x) => equals(x.left, x.right, false),
+
+  '!=': (x) => not(operators['=='](x)),
+
+  '===': (x) => equals(x.left, x.right, true),
+
+  '!==': (x) => not(operators['==='](x)),
+
+  '!': (x) => isFalsy(x.argument),
+
+  '&&': (x) => isTruthy(x.left) && isTruthy(x.right),
+
+  '||': (x) => isTruthy(x.left) || isTruthy(x.right)
+};
+
+function not(value) {
+  return value === null ? value : !value;
+}
+
+function equals(a, b, strict) {
+  if (a.type !== b.type) return null;
+  // eslint-disable-next-line eqeqeq
+  if (a.type === 'Literal') return strict ? a.value === b.value : a.value == b.value;
+  return null;
+}
+
+function isTruthy(node) {
+  if (!node) return false;
+  if (node.type === 'Literal') return !!node.value;
+  if (node.type === 'ParenthesizedExpression') return isTruthy(node.expression);
+  if (node.operator in operators) return operators[node.operator](node);
+  return null;
+}
+
+function isFalsy(node) {
+  return not(isTruthy(node));
+}
+
+function getKeypath(node) {
+  const parts = [];
+
+  while (node.type === 'MemberExpression') {
+    if (node.computed) return null;
+
+    parts.unshift(node.property.name);
+    // eslint-disable-next-line no-param-reassign
+    node = node.object;
+  }
+
+  if (node.type !== 'Identifier') return null;
+
+  const { name } = node;
+  parts.unshift(name);
+
+  return { name, keypath: parts.join('.') };
+}
+
+const KEY_COMPILED_ESM = '__esModule';
+
+function getDefineCompiledEsmType(node) {
+  const definedPropertyWithExports = getDefinePropertyCallName(node, 'exports');
+  const definedProperty =
+    definedPropertyWithExports || getDefinePropertyCallName(node, 'module.exports');
+  if (definedProperty && definedProperty.key === KEY_COMPILED_ESM) {
+    return isTruthy(definedProperty.value)
+      ? definedPropertyWithExports
+        ? 'exports'
+        : 'module'
+      : false;
+  }
+  return false;
+}
+
+function getDefinePropertyCallName(node, targetName) {
+  const {
+    callee: { object, property }
+  } = node;
+  if (!object || object.type !== 'Identifier' || object.name !== 'Object') return;
+  if (!property || property.type !== 'Identifier' || property.name !== 'defineProperty') return;
+  if (node.arguments.length !== 3) return;
+
+  const targetNames = targetName.split('.');
+  const [target, key, value] = node.arguments;
+  if (targetNames.length === 1) {
+    if (target.type !== 'Identifier' || target.name !== targetNames[0]) {
+      return;
+    }
+  }
+
+  if (targetNames.length === 2) {
+    if (
+      target.type !== 'MemberExpression' ||
+      target.object.name !== targetNames[0] ||
+      target.property.name !== targetNames[1]
+    ) {
+      return;
+    }
+  }
+
+  if (value.type !== 'ObjectExpression' || !value.properties) return;
+
+  const valueProperty = value.properties.find((p) => p.key && p.key.name === 'value');
+  if (!valueProperty || !valueProperty.value) return;
+
+  // eslint-disable-next-line consistent-return
+  return { key: key.value, value: valueProperty.value };
+}
+
+function isShorthandProperty(parent) {
+  return parent && parent.type === 'Property' && parent.shorthand;
+}
+
+function wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges) {
+  const args = [];
+  const passedArgs = [];
+  if (uses.module) {
+    args.push('module');
+    passedArgs.push(moduleName);
+  }
+  if (uses.exports) {
+    args.push('exports');
+    passedArgs.push(uses.module ? `${moduleName}.exports` : exportsName);
+  }
+  magicString
+    .trim()
+    .indent('\t', { exclude: indentExclusionRanges })
+    .prepend(`(function (${args.join(', ')}) {\n`)
+    // For some reason, this line is only indented correctly when using a
+    // require-wrapper if we have this leading space
+    .append(` \n} (${passedArgs.join(', ')}));`);
+}
+
+function rewriteExportsAndGetExportsBlock(
+  magicString,
+  moduleName,
+  exportsName,
+  exportedExportsName,
+  wrapped,
+  moduleExportsAssignments,
+  firstTopLevelModuleExportsAssignment,
+  exportsAssignmentsByName,
+  topLevelAssignments,
+  defineCompiledEsmExpressions,
+  deconflictedExportNames,
+  code,
+  HELPERS_NAME,
+  exportMode,
+  defaultIsModuleExports,
+  usesRequireWrapper,
+  requireName
+) {
+  const exports = [];
+  const exportDeclarations = [];
+
+  if (usesRequireWrapper) {
+    getExportsWhenUsingRequireWrapper(
+      magicString,
+      wrapped,
+      exportMode,
+      exports,
+      moduleExportsAssignments,
+      exportsAssignmentsByName,
+      moduleName,
+      exportsName,
+      requireName,
+      defineCompiledEsmExpressions
+    );
+  } else if (exportMode === 'replace') {
+    getExportsForReplacedModuleExports(
+      magicString,
+      exports,
+      exportDeclarations,
+      moduleExportsAssignments,
+      firstTopLevelModuleExportsAssignment,
+      exportsName,
+      defaultIsModuleExports,
+      HELPERS_NAME
+    );
+  } else {
+    if (exportMode === 'module') {
+      exportDeclarations.push(`var ${exportedExportsName} = ${moduleName}.exports`);
+      exports.push(`${exportedExportsName} as __moduleExports`);
+    } else {
+      exports.push(`${exportsName} as __moduleExports`);
+    }
+    if (wrapped) {
+      exportDeclarations.push(
+        getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME)
+      );
+    } else {
+      getExports(
+        magicString,
+        exports,
+        exportDeclarations,
+        moduleExportsAssignments,
+        exportsAssignmentsByName,
+        deconflictedExportNames,
+        topLevelAssignments,
+        moduleName,
+        exportsName,
+        exportedExportsName,
+        defineCompiledEsmExpressions,
+        HELPERS_NAME,
+        defaultIsModuleExports,
+        exportMode
+      );
+    }
+  }
+  if (exports.length) {
+    exportDeclarations.push(`export { ${exports.join(', ')} }`);
+  }
+
+  return `\n\n${exportDeclarations.join(';\n')};`;
+}
+
+function getExportsWhenUsingRequireWrapper(
+  magicString,
+  wrapped,
+  exportMode,
+  exports,
+  moduleExportsAssignments,
+  exportsAssignmentsByName,
+  moduleName,
+  exportsName,
+  requireName,
+  defineCompiledEsmExpressions
+) {
+  exports.push(`${requireName} as __require`);
+  if (wrapped) return;
+  if (exportMode === 'replace') {
+    rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName);
+  } else {
+    rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, `${moduleName}.exports`);
+    // Collect and rewrite named exports
+    for (const [exportName, { nodes }] of exportsAssignmentsByName) {
+      for (const { node, type } of nodes) {
+        magicString.overwrite(
+          node.start,
+          node.left.end,
+          `${
+            exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
+          }.${exportName}`
+        );
+      }
+    }
+    replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
+      defineCompiledEsmExpressions,
+      magicString,
+      exportMode,
+      moduleName,
+      exportsName
+    );
+  }
+}
+
+function getExportsForReplacedModuleExports(
+  magicString,
+  exports,
+  exportDeclarations,
+  moduleExportsAssignments,
+  firstTopLevelModuleExportsAssignment,
+  exportsName,
+  defaultIsModuleExports,
+  HELPERS_NAME
+) {
+  for (const { left } of moduleExportsAssignments) {
+    magicString.overwrite(left.start, left.end, exportsName);
+  }
+  magicString.prependRight(firstTopLevelModuleExportsAssignment.left.start, 'var ');
+  exports.push(`${exportsName} as __moduleExports`);
+  exportDeclarations.push(
+    getDefaultExportDeclaration(exportsName, defaultIsModuleExports, HELPERS_NAME)
+  );
+}
+
+function getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME) {
+  return `export default ${
+    defaultIsModuleExports === true
+      ? exportedExportsName
+      : defaultIsModuleExports === false
+      ? `${exportedExportsName}.default`
+      : `/*@__PURE__*/${HELPERS_NAME}.getDefaultExportFromCjs(${exportedExportsName})`
+  }`;
+}
+
+function getExports(
+  magicString,
+  exports,
+  exportDeclarations,
+  moduleExportsAssignments,
+  exportsAssignmentsByName,
+  deconflictedExportNames,
+  topLevelAssignments,
+  moduleName,
+  exportsName,
+  exportedExportsName,
+  defineCompiledEsmExpressions,
+  HELPERS_NAME,
+  defaultIsModuleExports,
+  exportMode
+) {
+  let deconflictedDefaultExportName;
+  // Collect and rewrite module.exports assignments
+  for (const { left } of moduleExportsAssignments) {
+    magicString.overwrite(left.start, left.end, `${moduleName}.exports`);
+  }
+
+  // Collect and rewrite named exports
+  for (const [exportName, { nodes }] of exportsAssignmentsByName) {
+    const deconflicted = deconflictedExportNames[exportName];
+    let needsDeclaration = true;
+    for (const { node, type } of nodes) {
+      let replacement = `${deconflicted} = ${
+        exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
+      }.${exportName}`;
+      if (needsDeclaration && topLevelAssignments.has(node)) {
+        replacement = `var ${replacement}`;
+        needsDeclaration = false;
+      }
+      magicString.overwrite(node.start, node.left.end, replacement);
+    }
+    if (needsDeclaration) {
+      magicString.prepend(`var ${deconflicted};\n`);
+    }
+
+    if (exportName === 'default') {
+      deconflictedDefaultExportName = deconflicted;
+    } else {
+      exports.push(exportName === deconflicted ? exportName : `${deconflicted} as ${exportName}`);
+    }
+  }
+
+  const isRestorableCompiledEsm = replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
+    defineCompiledEsmExpressions,
+    magicString,
+    exportMode,
+    moduleName,
+    exportsName
+  );
+
+  if (
+    defaultIsModuleExports === false ||
+    (defaultIsModuleExports === 'auto' &&
+      isRestorableCompiledEsm &&
+      moduleExportsAssignments.length === 0)
+  ) {
+    // If there is no deconflictedDefaultExportName, then we use the namespace as
+    // fallback because there can be no "default" property on the namespace
+    exports.push(`${deconflictedDefaultExportName || exportedExportsName} as default`);
+  } else if (
+    defaultIsModuleExports === true ||
+    (!isRestorableCompiledEsm && moduleExportsAssignments.length === 0)
+  ) {
+    exports.push(`${exportedExportsName} as default`);
+  } else {
+    exportDeclarations.push(
+      getDefaultExportDeclaration(exportedExportsName, defaultIsModuleExports, HELPERS_NAME)
+    );
+  }
+}
+
+function rewriteModuleExportsAssignments(magicString, moduleExportsAssignments, exportsName) {
+  for (const { left } of moduleExportsAssignments) {
+    magicString.overwrite(left.start, left.end, exportsName);
+  }
+}
+
+function replaceDefineCompiledEsmExpressionsAndGetIfRestorable(
+  defineCompiledEsmExpressions,
+  magicString,
+  exportMode,
+  moduleName,
+  exportsName
+) {
+  let isRestorableCompiledEsm = false;
+  for (const { node, type } of defineCompiledEsmExpressions) {
+    isRestorableCompiledEsm = true;
+    const moduleExportsExpression =
+      node.type === 'CallExpression' ? node.arguments[0] : node.left.object;
+    magicString.overwrite(
+      moduleExportsExpression.start,
+      moduleExportsExpression.end,
+      exportMode === 'module' && type === 'module' ? `${moduleName}.exports` : exportsName
+    );
+  }
+  return isRestorableCompiledEsm;
+}
+
+function isRequireExpression(node, scope) {
+  if (!node) return false;
+  if (node.type !== 'CallExpression') return false;
+
+  // Weird case of `require()` or `module.require()` without arguments
+  if (node.arguments.length === 0) return false;
+
+  return isRequire(node.callee, scope);
+}
+
+function isRequire(node, scope) {
+  return (
+    (node.type === 'Identifier' && node.name === 'require' && !scope.contains('require')) ||
+    (node.type === 'MemberExpression' && isModuleRequire(node, scope))
+  );
+}
+
+function isModuleRequire({ object, property }, scope) {
+  return (
+    object.type === 'Identifier' &&
+    object.name === 'module' &&
+    property.type === 'Identifier' &&
+    property.name === 'require' &&
+    !scope.contains('module')
+  );
+}
+
+function hasDynamicArguments(node) {
+  return (
+    node.arguments.length > 1 ||
+    (node.arguments[0].type !== 'Literal' &&
+      (node.arguments[0].type !== 'TemplateLiteral' || node.arguments[0].expressions.length > 0))
+  );
+}
+
+const reservedMethod = { resolve: true, cache: true, main: true };
+
+function isNodeRequirePropertyAccess(parent) {
+  return parent && parent.property && reservedMethod[parent.property.name];
+}
+
+function getRequireStringArg(node) {
+  return node.arguments[0].type === 'Literal'
+    ? node.arguments[0].value
+    : node.arguments[0].quasis[0].value.cooked;
+}
+
+function getRequireHandlers() {
+  const requireExpressions = [];
+
+  function addRequireExpression(
+    sourceId,
+    node,
+    scope,
+    usesReturnValue,
+    isInsideTryBlock,
+    isInsideConditional,
+    toBeRemoved
+  ) {
+    requireExpressions.push({
+      sourceId,
+      node,
+      scope,
+      usesReturnValue,
+      isInsideTryBlock,
+      isInsideConditional,
+      toBeRemoved
+    });
+  }
+
+  async function rewriteRequireExpressionsAndGetImportBlock(
+    magicString,
+    topLevelDeclarations,
+    reassignedNames,
+    helpersName,
+    dynamicRequireName,
+    moduleName,
+    exportsName,
+    id,
+    exportMode,
+    resolveRequireSourcesAndUpdateMeta,
+    needsRequireWrapper,
+    isEsModule,
+    isDynamicRequireModulesEnabled,
+    getIgnoreTryCatchRequireStatementMode,
+    commonjsMeta
+  ) {
+    const imports = [];
+    imports.push(`import * as ${helpersName} from "${HELPERS_ID}"`);
+    if (dynamicRequireName) {
+      imports.push(
+        `import { ${
+          isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT
+        } as ${dynamicRequireName} } from "${DYNAMIC_MODULES_ID}"`
+      );
+    }
+    if (exportMode === 'module') {
+      imports.push(
+        `import { __module as ${moduleName} } from ${JSON.stringify(wrapId(id, MODULE_SUFFIX))}`,
+        `var ${exportsName} = ${moduleName}.exports`
+      );
+    } else if (exportMode === 'exports') {
+      imports.push(
+        `import { __exports as ${exportsName} } from ${JSON.stringify(wrapId(id, EXPORTS_SUFFIX))}`
+      );
+    }
+    const requiresBySource = collectSources(requireExpressions);
+    const requireTargets = await resolveRequireSourcesAndUpdateMeta(
+      id,
+      needsRequireWrapper ? IS_WRAPPED_COMMONJS : !isEsModule,
+      commonjsMeta,
+      Object.keys(requiresBySource).map((source) => {
+        return {
+          source,
+          isConditional: requiresBySource[source].every((require) => require.isInsideConditional)
+        };
+      })
+    );
+    processRequireExpressions(
+      imports,
+      requireTargets,
+      requiresBySource,
+      getIgnoreTryCatchRequireStatementMode,
+      magicString
+    );
+    return imports.length ? `${imports.join(';\n')};\n\n` : '';
+  }
+
+  return {
+    addRequireExpression,
+    rewriteRequireExpressionsAndGetImportBlock
+  };
+}
+
+function collectSources(requireExpressions) {
+  const requiresBySource = Object.create(null);
+  for (const requireExpression of requireExpressions) {
+    const { sourceId } = requireExpression;
+    if (!requiresBySource[sourceId]) {
+      requiresBySource[sourceId] = [];
+    }
+    const requires = requiresBySource[sourceId];
+    requires.push(requireExpression);
+  }
+  return requiresBySource;
+}
+
+function processRequireExpressions(
+  imports,
+  requireTargets,
+  requiresBySource,
+  getIgnoreTryCatchRequireStatementMode,
+  magicString
+) {
+  const generateRequireName = getGenerateRequireName();
+  for (const { source, id: resolvedId, isCommonJS } of requireTargets) {
+    const requires = requiresBySource[source];
+    const name = generateRequireName(requires);
+    let usesRequired = false;
+    let needsImport = false;
+    for (const { node, usesReturnValue, toBeRemoved, isInsideTryBlock } of requires) {
+      const { canConvertRequire, shouldRemoveRequire } =
+        isInsideTryBlock && isWrappedId(resolvedId, EXTERNAL_SUFFIX)
+          ? getIgnoreTryCatchRequireStatementMode(source)
+          : { canConvertRequire: true, shouldRemoveRequire: false };
+      if (shouldRemoveRequire) {
+        if (usesReturnValue) {
+          magicString.overwrite(node.start, node.end, 'undefined');
+        } else {
+          magicString.remove(toBeRemoved.start, toBeRemoved.end);
+        }
+      } else if (canConvertRequire) {
+        needsImport = true;
+        if (isCommonJS === IS_WRAPPED_COMMONJS) {
+          magicString.overwrite(node.start, node.end, `${name}()`);
+        } else if (usesReturnValue) {
+          usesRequired = true;
+          magicString.overwrite(node.start, node.end, name);
+        } else {
+          magicString.remove(toBeRemoved.start, toBeRemoved.end);
+        }
+      }
+    }
+    if (needsImport) {
+      if (isCommonJS === IS_WRAPPED_COMMONJS) {
+        imports.push(`import { __require as ${name} } from ${JSON.stringify(resolvedId)}`);
+      } else {
+        imports.push(`import ${usesRequired ? `${name} from ` : ''}${JSON.stringify(resolvedId)}`);
+      }
+    }
+  }
+}
+
+function getGenerateRequireName() {
+  let uid = 0;
+  return (requires) => {
+    let name;
+    const hasNameConflict = ({ scope }) => scope.contains(name);
+    do {
+      name = `require$$${uid}`;
+      uid += 1;
+    } while (requires.some(hasNameConflict));
+    return name;
+  };
+}
+
+/* eslint-disable no-param-reassign, no-shadow, no-underscore-dangle, no-continue */
+
+
+const exportsPattern = /^(?:module\.)?exports(?:\.([a-zA-Z_$][a-zA-Z_$0-9]*))?$/;
+
+const functionType = /^(?:FunctionDeclaration|FunctionExpression|ArrowFunctionExpression)$/;
+
+// There are three different types of CommonJS modules, described by their
+// "exportMode":
+// - exports: Only assignments to (module.)exports properties
+// - replace: A single assignment to module.exports itself
+// - module: Anything else
+// Special cases:
+// - usesRequireWrapper
+// - isWrapped
+async function transformCommonjs(
+  parse,
+  code,
+  id,
+  isEsModule,
+  ignoreGlobal,
+  ignoreRequire,
+  ignoreDynamicRequires,
+  getIgnoreTryCatchRequireStatementMode,
+  sourceMap,
+  isDynamicRequireModulesEnabled,
+  dynamicRequireModules,
+  commonDir,
+  astCache,
+  defaultIsModuleExports,
+  needsRequireWrapper,
+  resolveRequireSourcesAndUpdateMeta,
+  isRequired,
+  checkDynamicRequire,
+  commonjsMeta
+) {
+  const ast = astCache || tryParse(parse, code, id);
+  const magicString = new MagicString(code);
+  const uses = {
+    module: false,
+    exports: false,
+    global: false,
+    require: false
+  };
+  const virtualDynamicRequirePath =
+    isDynamicRequireModulesEnabled && getVirtualPathForDynamicRequirePath(dirname$1(id), commonDir);
+  let scope = attachScopes(ast, 'scope');
+  let lexicalDepth = 0;
+  let programDepth = 0;
+  let classBodyDepth = 0;
+  let currentTryBlockEnd = null;
+  let shouldWrap = false;
+
+  const globals = new Set();
+  // A conditionalNode is a node for which execution is not guaranteed. If such a node is a require
+  // or contains nested requires, those should be handled as function calls unless there is an
+  // unconditional require elsewhere.
+  let currentConditionalNodeEnd = null;
+  const conditionalNodes = new Set();
+  const { addRequireExpression, rewriteRequireExpressionsAndGetImportBlock } = getRequireHandlers();
+
+  // See which names are assigned to. This is necessary to prevent
+  // illegally replacing `var foo = require('foo')` with `import foo from 'foo'`,
+  // where `foo` is later reassigned. (This happens in the wild. CommonJS, sigh)
+  const reassignedNames = new Set();
+  const topLevelDeclarations = [];
+  const skippedNodes = new Set();
+  const moduleAccessScopes = new Set([scope]);
+  const exportsAccessScopes = new Set([scope]);
+  const moduleExportsAssignments = [];
+  let firstTopLevelModuleExportsAssignment = null;
+  const exportsAssignmentsByName = new Map();
+  const topLevelAssignments = new Set();
+  const topLevelDefineCompiledEsmExpressions = [];
+  const replacedGlobal = [];
+  const replacedDynamicRequires = [];
+  const importedVariables = new Set();
+  const indentExclusionRanges = [];
+
+  walk$3(ast, {
+    enter(node, parent) {
+      if (skippedNodes.has(node)) {
+        this.skip();
+        return;
+      }
+
+      if (currentTryBlockEnd !== null && node.start > currentTryBlockEnd) {
+        currentTryBlockEnd = null;
+      }
+      if (currentConditionalNodeEnd !== null && node.start > currentConditionalNodeEnd) {
+        currentConditionalNodeEnd = null;
+      }
+      if (currentConditionalNodeEnd === null && conditionalNodes.has(node)) {
+        currentConditionalNodeEnd = node.end;
+      }
+
+      programDepth += 1;
+      if (node.scope) ({ scope } = node);
+      if (functionType.test(node.type)) lexicalDepth += 1;
+      if (sourceMap) {
+        magicString.addSourcemapLocation(node.start);
+        magicString.addSourcemapLocation(node.end);
+      }
+
+      // eslint-disable-next-line default-case
+      switch (node.type) {
+        case 'AssignmentExpression':
+          if (node.left.type === 'MemberExpression') {
+            const flattened = getKeypath(node.left);
+            if (!flattened || scope.contains(flattened.name)) return;
+
+            const exportsPatternMatch = exportsPattern.exec(flattened.keypath);
+            if (!exportsPatternMatch || flattened.keypath === 'exports') return;
+
+            const [, exportName] = exportsPatternMatch;
+            uses[flattened.name] = true;
+
+            // we're dealing with `module.exports = ...` or `[module.]exports.foo = ...` –
+            if (flattened.keypath === 'module.exports') {
+              moduleExportsAssignments.push(node);
+              if (programDepth > 3) {
+                moduleAccessScopes.add(scope);
+              } else if (!firstTopLevelModuleExportsAssignment) {
+                firstTopLevelModuleExportsAssignment = node;
+              }
+            } else if (exportName === KEY_COMPILED_ESM) {
+              if (programDepth > 3) {
+                shouldWrap = true;
+              } else {
+                // The "type" is either "module" or "exports" to discern
+                // assignments to module.exports vs exports if needed
+                topLevelDefineCompiledEsmExpressions.push({ node, type: flattened.name });
+              }
+            } else {
+              const exportsAssignments = exportsAssignmentsByName.get(exportName) || {
+                nodes: [],
+                scopes: new Set()
+              };
+              exportsAssignments.nodes.push({ node, type: flattened.name });
+              exportsAssignments.scopes.add(scope);
+              exportsAccessScopes.add(scope);
+              exportsAssignmentsByName.set(exportName, exportsAssignments);
+              if (programDepth <= 3) {
+                topLevelAssignments.add(node);
+              }
+            }
+
+            skippedNodes.add(node.left);
+          } else {
+            for (const name of extractAssignedNames(node.left)) {
+              reassignedNames.add(name);
+            }
+          }
+          return;
+        case 'CallExpression': {
+          const defineCompiledEsmType = getDefineCompiledEsmType(node);
+          if (defineCompiledEsmType) {
+            if (programDepth === 3 && parent.type === 'ExpressionStatement') {
+              // skip special handling for [module.]exports until we know we render this
+              skippedNodes.add(node.arguments[0]);
+              topLevelDefineCompiledEsmExpressions.push({ node, type: defineCompiledEsmType });
+            } else {
+              shouldWrap = true;
+            }
+            return;
+          }
+
+          // Transform require.resolve
+          if (
+            isDynamicRequireModulesEnabled &&
+            node.callee.object &&
+            isRequire(node.callee.object, scope) &&
+            node.callee.property.name === 'resolve'
+          ) {
+            checkDynamicRequire(node.start);
+            uses.require = true;
+            const requireNode = node.callee.object;
+            replacedDynamicRequires.push(requireNode);
+            skippedNodes.add(node.callee);
+            return;
+          }
+
+          if (!isRequireExpression(node, scope)) {
+            const keypath = getKeypath(node.callee);
+            if (keypath && importedVariables.has(keypath.name)) {
+              // Heuristic to deoptimize requires after a required function has been called
+              currentConditionalNodeEnd = Infinity;
+            }
+            return;
+          }
+
+          skippedNodes.add(node.callee);
+          uses.require = true;
+
+          if (hasDynamicArguments(node)) {
+            if (isDynamicRequireModulesEnabled) {
+              checkDynamicRequire(node.start);
+            }
+            if (!ignoreDynamicRequires) {
+              replacedDynamicRequires.push(node.callee);
+            }
+            return;
+          }
+
+          const requireStringArg = getRequireStringArg(node);
+          if (!ignoreRequire(requireStringArg)) {
+            const usesReturnValue = parent.type !== 'ExpressionStatement';
+            const toBeRemoved =
+              parent.type === 'ExpressionStatement' &&
+              (!currentConditionalNodeEnd ||
+                // We should completely remove requires directly in a try-catch
+                // so that Rollup can remove up the try-catch
+                (currentTryBlockEnd !== null && currentTryBlockEnd < currentConditionalNodeEnd))
+                ? parent
+                : node;
+            addRequireExpression(
+              requireStringArg,
+              node,
+              scope,
+              usesReturnValue,
+              currentTryBlockEnd !== null,
+              currentConditionalNodeEnd !== null,
+              toBeRemoved
+            );
+            if (parent.type === 'VariableDeclarator' && parent.id.type === 'Identifier') {
+              for (const name of extractAssignedNames(parent.id)) {
+                importedVariables.add(name);
+              }
+            }
+          }
+          return;
+        }
+        case 'ClassBody':
+          classBodyDepth += 1;
+          return;
+        case 'ConditionalExpression':
+        case 'IfStatement':
+          // skip dead branches
+          if (isFalsy(node.test)) {
+            skippedNodes.add(node.consequent);
+          } else if (isTruthy(node.test)) {
+            if (node.alternate) {
+              skippedNodes.add(node.alternate);
+            }
+          } else {
+            conditionalNodes.add(node.consequent);
+            if (node.alternate) {
+              conditionalNodes.add(node.alternate);
+            }
+          }
+          return;
+        case 'ArrowFunctionExpression':
+        case 'FunctionDeclaration':
+        case 'FunctionExpression':
+          // requires in functions should be conditional unless it is an IIFE
+          if (
+            currentConditionalNodeEnd === null &&
+            !(parent.type === 'CallExpression' && parent.callee === node)
+          ) {
+            currentConditionalNodeEnd = node.end;
+          }
+          return;
+        case 'Identifier': {
+          const { name } = node;
+          if (
+            !isReference(node, parent) ||
+            scope.contains(name) ||
+            (parent.type === 'PropertyDefinition' && parent.key === node)
+          )
+            return;
+          switch (name) {
+            case 'require':
+              uses.require = true;
+              if (isNodeRequirePropertyAccess(parent)) {
+                return;
+              }
+              if (!ignoreDynamicRequires) {
+                if (isShorthandProperty(parent)) {
+                  // as key and value are the same object, isReference regards
+                  // both as references, so we need to skip now
+                  skippedNodes.add(parent.value);
+                  magicString.prependRight(node.start, 'require: ');
+                }
+                replacedDynamicRequires.push(node);
+              }
+              return;
+            case 'module':
+            case 'exports':
+              shouldWrap = true;
+              uses[name] = true;
+              return;
+            case 'global':
+              uses.global = true;
+              if (!ignoreGlobal) {
+                replacedGlobal.push(node);
+              }
+              return;
+            case 'define':
+              magicString.overwrite(node.start, node.end, 'undefined', {
+                storeName: true
+              });
+              return;
+            default:
+              globals.add(name);
+              return;
+          }
+        }
+        case 'LogicalExpression':
+          // skip dead branches
+          if (node.operator === '&&') {
+            if (isFalsy(node.left)) {
+              skippedNodes.add(node.right);
+            } else if (!isTruthy(node.left)) {
+              conditionalNodes.add(node.right);
+            }
+          } else if (node.operator === '||') {
+            if (isTruthy(node.left)) {
+              skippedNodes.add(node.right);
+            } else if (!isFalsy(node.left)) {
+              conditionalNodes.add(node.right);
+            }
+          }
+          return;
+        case 'MemberExpression':
+          if (!isDynamicRequireModulesEnabled && isModuleRequire(node, scope)) {
+            uses.require = true;
+            replacedDynamicRequires.push(node);
+            skippedNodes.add(node.object);
+            skippedNodes.add(node.property);
+          }
+          return;
+        case 'ReturnStatement':
+          // if top-level return, we need to wrap it
+          if (lexicalDepth === 0) {
+            shouldWrap = true;
+          }
+          return;
+        case 'ThisExpression':
+          // rewrite top-level `this` as `commonjsHelpers.commonjsGlobal`
+          if (lexicalDepth === 0 && !classBodyDepth) {
+            uses.global = true;
+            if (!ignoreGlobal) {
+              replacedGlobal.push(node);
+            }
+          }
+          return;
+        case 'TryStatement':
+          if (currentTryBlockEnd === null) {
+            currentTryBlockEnd = node.block.end;
+          }
+          if (currentConditionalNodeEnd === null) {
+            currentConditionalNodeEnd = node.end;
+          }
+          return;
+        case 'UnaryExpression':
+          // rewrite `typeof module`, `typeof module.exports` and `typeof exports` (https://github.com/rollup/rollup-plugin-commonjs/issues/151)
+          if (node.operator === 'typeof') {
+            const flattened = getKeypath(node.argument);
+            if (!flattened) return;
+
+            if (scope.contains(flattened.name)) return;
+
+            if (
+              !isEsModule &&
+              (flattened.keypath === 'module.exports' ||
+                flattened.keypath === 'module' ||
+                flattened.keypath === 'exports')
+            ) {
+              magicString.overwrite(node.start, node.end, `'object'`, {
+                storeName: false
+              });
+            }
+          }
+          return;
+        case 'VariableDeclaration':
+          if (!scope.parent) {
+            topLevelDeclarations.push(node);
+          }
+          return;
+        case 'TemplateElement':
+          if (node.value.raw.includes('\n')) {
+            indentExclusionRanges.push([node.start, node.end]);
+          }
+      }
+    },
+
+    leave(node) {
+      programDepth -= 1;
+      if (node.scope) scope = scope.parent;
+      if (functionType.test(node.type)) lexicalDepth -= 1;
+      if (node.type === 'ClassBody') classBodyDepth -= 1;
+    }
+  });
+
+  const nameBase = getName(id);
+  const exportsName = deconflict([...exportsAccessScopes], globals, nameBase);
+  const moduleName = deconflict([...moduleAccessScopes], globals, `${nameBase}Module`);
+  const requireName = deconflict([scope], globals, `require${capitalize(nameBase)}`);
+  const isRequiredName = deconflict([scope], globals, `hasRequired${capitalize(nameBase)}`);
+  const helpersName = deconflict([scope], globals, 'commonjsHelpers');
+  const dynamicRequireName =
+    replacedDynamicRequires.length > 0 &&
+    deconflict(
+      [scope],
+      globals,
+      isDynamicRequireModulesEnabled ? CREATE_COMMONJS_REQUIRE_EXPORT : COMMONJS_REQUIRE_EXPORT
+    );
+  const deconflictedExportNames = Object.create(null);
+  for (const [exportName, { scopes }] of exportsAssignmentsByName) {
+    deconflictedExportNames[exportName] = deconflict([...scopes], globals, exportName);
+  }
+
+  for (const node of replacedGlobal) {
+    magicString.overwrite(node.start, node.end, `${helpersName}.commonjsGlobal`, {
+      storeName: true
+    });
+  }
+  for (const node of replacedDynamicRequires) {
+    magicString.overwrite(
+      node.start,
+      node.end,
+      isDynamicRequireModulesEnabled
+        ? `${dynamicRequireName}(${JSON.stringify(virtualDynamicRequirePath)})`
+        : dynamicRequireName,
+      {
+        contentOnly: true,
+        storeName: true
+      }
+    );
+  }
+
+  // We cannot wrap ES/mixed modules
+  shouldWrap = !isEsModule && (shouldWrap || (uses.exports && moduleExportsAssignments.length > 0));
+
+  if (
+    !(
+      shouldWrap ||
+      isRequired ||
+      needsRequireWrapper ||
+      uses.module ||
+      uses.exports ||
+      uses.require ||
+      topLevelDefineCompiledEsmExpressions.length > 0
+    ) &&
+    (ignoreGlobal || !uses.global)
+  ) {
+    return { meta: { commonjs: { isCommonJS: false } } };
+  }
+
+  let leadingComment = '';
+  if (code.startsWith('/*')) {
+    const commentEnd = code.indexOf('*/', 2) + 2;
+    leadingComment = `${code.slice(0, commentEnd)}\n`;
+    magicString.remove(0, commentEnd).trim();
+  }
+
+  let shebang = '';
+  if (code.startsWith('#!')) {
+    const shebangEndPosition = code.indexOf('\n') + 1;
+    shebang = code.slice(0, shebangEndPosition);
+    magicString.remove(0, shebangEndPosition).trim();
+  }
+
+  const exportMode = isEsModule
+    ? 'none'
+    : shouldWrap
+    ? uses.module
+      ? 'module'
+      : 'exports'
+    : firstTopLevelModuleExportsAssignment
+    ? exportsAssignmentsByName.size === 0 && topLevelDefineCompiledEsmExpressions.length === 0
+      ? 'replace'
+      : 'module'
+    : moduleExportsAssignments.length === 0
+    ? 'exports'
+    : 'module';
+
+  const exportedExportsName =
+    exportMode === 'module' ? deconflict([], globals, `${nameBase}Exports`) : exportsName;
+
+  const importBlock = await rewriteRequireExpressionsAndGetImportBlock(
+    magicString,
+    topLevelDeclarations,
+    reassignedNames,
+    helpersName,
+    dynamicRequireName,
+    moduleName,
+    exportsName,
+    id,
+    exportMode,
+    resolveRequireSourcesAndUpdateMeta,
+    needsRequireWrapper,
+    isEsModule,
+    isDynamicRequireModulesEnabled,
+    getIgnoreTryCatchRequireStatementMode,
+    commonjsMeta
+  );
+  const usesRequireWrapper = commonjsMeta.isCommonJS === IS_WRAPPED_COMMONJS;
+  const exportBlock = isEsModule
+    ? ''
+    : rewriteExportsAndGetExportsBlock(
+        magicString,
+        moduleName,
+        exportsName,
+        exportedExportsName,
+        shouldWrap,
+        moduleExportsAssignments,
+        firstTopLevelModuleExportsAssignment,
+        exportsAssignmentsByName,
+        topLevelAssignments,
+        topLevelDefineCompiledEsmExpressions,
+        deconflictedExportNames,
+        code,
+        helpersName,
+        exportMode,
+        defaultIsModuleExports,
+        usesRequireWrapper,
+        requireName
+      );
+
+  if (shouldWrap) {
+    wrapCode(magicString, uses, moduleName, exportsName, indentExclusionRanges);
+  }
+
+  if (usesRequireWrapper) {
+    magicString.trim().indent('\t', {
+      exclude: indentExclusionRanges
+    });
+    const exported = exportMode === 'module' ? `${moduleName}.exports` : exportsName;
+    magicString.prepend(
+      `var ${isRequiredName};
+
+function ${requireName} () {
+\tif (${isRequiredName}) return ${exported};
+\t${isRequiredName} = 1;
+`
+    ).append(`
+\treturn ${exported};
+}`);
+    if (exportMode === 'replace') {
+      magicString.prepend(`var ${exportsName};\n`);
+    }
+  }
+
+  magicString
+    .trim()
+    .prepend(shebang + leadingComment + importBlock)
+    .append(exportBlock);
+
+  return {
+    code: magicString.toString(),
+    map: sourceMap ? magicString.generateMap() : null,
+    syntheticNamedExports: isEsModule || usesRequireWrapper ? false : '__moduleExports',
+    meta: { commonjs: { ...commonjsMeta, shebang } }
+  };
+}
+
+const PLUGIN_NAME = 'commonjs';
+
+function commonjs(options = {}) {
+  const {
+    ignoreGlobal,
+    ignoreDynamicRequires,
+    requireReturnsDefault: requireReturnsDefaultOption,
+    defaultIsModuleExports: defaultIsModuleExportsOption,
+    esmExternals
+  } = options;
+  const extensions = options.extensions || ['.js'];
+  const filter = createFilter$1(options.include, options.exclude);
+  const isPossibleCjsId = (id) => {
+    const extName = extname(id);
+    return extName === '.cjs' || (extensions.includes(extName) && filter(id));
+  };
+
+  const { strictRequiresFilter, detectCyclesAndConditional } = getStrictRequiresFilter(options);
+
+  const getRequireReturnsDefault =
+    typeof requireReturnsDefaultOption === 'function'
+      ? requireReturnsDefaultOption
+      : () => requireReturnsDefaultOption;
+
+  let esmExternalIds;
+  const isEsmExternal =
+    typeof esmExternals === 'function'
+      ? esmExternals
+      : Array.isArray(esmExternals)
+      ? ((esmExternalIds = new Set(esmExternals)), (id) => esmExternalIds.has(id))
+      : () => esmExternals;
+
+  const getDefaultIsModuleExports =
+    typeof defaultIsModuleExportsOption === 'function'
+      ? defaultIsModuleExportsOption
+      : () =>
+          typeof defaultIsModuleExportsOption === 'boolean' ? defaultIsModuleExportsOption : 'auto';
+
+  const dynamicRequireRoot =
+    typeof options.dynamicRequireRoot === 'string'
+      ? resolve$3(options.dynamicRequireRoot)
+      : process.cwd();
+  const { commonDir, dynamicRequireModules } = getDynamicRequireModules(
+    options.dynamicRequireTargets,
+    dynamicRequireRoot
+  );
+  const isDynamicRequireModulesEnabled = dynamicRequireModules.size > 0;
+
+  const ignoreRequire =
+    typeof options.ignore === 'function'
+      ? options.ignore
+      : Array.isArray(options.ignore)
+      ? (id) => options.ignore.includes(id)
+      : () => false;
+
+  const getIgnoreTryCatchRequireStatementMode = (id) => {
+    const mode =
+      typeof options.ignoreTryCatch === 'function'
+        ? options.ignoreTryCatch(id)
+        : Array.isArray(options.ignoreTryCatch)
+        ? options.ignoreTryCatch.includes(id)
+        : typeof options.ignoreTryCatch !== 'undefined'
+        ? options.ignoreTryCatch
+        : true;
+
+    return {
+      canConvertRequire: mode !== 'remove' && mode !== true,
+      shouldRemoveRequire: mode === 'remove'
+    };
+  };
+
+  const { currentlyResolving, resolveId } = getResolveId(extensions, isPossibleCjsId);
+
+  const sourceMap = options.sourceMap !== false;
+
+  // Initialized in buildStart
+  let requireResolver;
+
+  function transformAndCheckExports(code, id) {
+    const normalizedId = normalizePathSlashes(id);
+    const { isEsModule, hasDefaultExport, hasNamedExports, ast } = analyzeTopLevelStatements(
+      this.parse,
+      code,
+      id
+    );
+
+    const commonjsMeta = this.getModuleInfo(id).meta.commonjs || {};
+    if (hasDefaultExport) {
+      commonjsMeta.hasDefaultExport = true;
+    }
+    if (hasNamedExports) {
+      commonjsMeta.hasNamedExports = true;
+    }
+
+    if (
+      !dynamicRequireModules.has(normalizedId) &&
+      (!(hasCjsKeywords(code, ignoreGlobal) || requireResolver.isRequiredId(id)) ||
+        (isEsModule && !options.transformMixedEsModules))
+    ) {
+      commonjsMeta.isCommonJS = false;
+      return { meta: { commonjs: commonjsMeta } };
+    }
+
+    const needsRequireWrapper =
+      !isEsModule && (dynamicRequireModules.has(normalizedId) || strictRequiresFilter(id));
+
+    const checkDynamicRequire = (position) => {
+      const normalizedDynamicRequireRoot = normalizePathSlashes(dynamicRequireRoot);
+
+      if (normalizedId.indexOf(normalizedDynamicRequireRoot) !== 0) {
+        this.error(
+          {
+            code: 'DYNAMIC_REQUIRE_OUTSIDE_ROOT',
+            normalizedId,
+            normalizedDynamicRequireRoot,
+            message: `"${normalizedId}" contains dynamic require statements but it is not within the current dynamicRequireRoot "${normalizedDynamicRequireRoot}". You should set dynamicRequireRoot to "${dirname$1(
+              normalizedId
+            )}" or one of its parent directories.`
+          },
+          position
+        );
+      }
+    };
+
+    return transformCommonjs(
+      this.parse,
+      code,
+      id,
+      isEsModule,
+      ignoreGlobal || isEsModule,
+      ignoreRequire,
+      ignoreDynamicRequires && !isDynamicRequireModulesEnabled,
+      getIgnoreTryCatchRequireStatementMode,
+      sourceMap,
+      isDynamicRequireModulesEnabled,
+      dynamicRequireModules,
+      commonDir,
+      ast,
+      getDefaultIsModuleExports(id),
+      needsRequireWrapper,
+      requireResolver.resolveRequireSourcesAndUpdateMeta(this),
+      requireResolver.isRequiredId(id),
+      checkDynamicRequire,
+      commonjsMeta
+    );
+  }
+
+  return {
+    name: PLUGIN_NAME,
+
+    version: version$2,
+
+    options(rawOptions) {
+      // We inject the resolver in the beginning so that "catch-all-resolver" like node-resolver
+      // do not prevent our plugin from resolving entry points ot proxies.
+      const plugins = Array.isArray(rawOptions.plugins)
+        ? [...rawOptions.plugins]
+        : rawOptions.plugins
+        ? [rawOptions.plugins]
+        : [];
+      plugins.unshift({
+        name: 'commonjs--resolver',
+        resolveId
+      });
+      return { ...rawOptions, plugins };
+    },
+
+    buildStart({ plugins }) {
+      validateVersion(this.meta.rollupVersion, peerDependencies.rollup, 'rollup');
+      const nodeResolve = plugins.find(({ name }) => name === 'node-resolve');
+      if (nodeResolve) {
+        validateVersion(nodeResolve.version, '^13.0.6', '@rollup/plugin-node-resolve');
+      }
+      if (options.namedExports != null) {
+        this.warn(
+          'The namedExports option from "@rollup/plugin-commonjs" is deprecated. Named exports are now handled automatically.'
+        );
+      }
+      requireResolver = getRequireResolver(
+        extensions,
+        detectCyclesAndConditional,
+        currentlyResolving
+      );
+    },
+
+    buildEnd() {
+      if (options.strictRequires === 'debug') {
+        const wrappedIds = requireResolver.getWrappedIds();
+        if (wrappedIds.length) {
+          this.warn({
+            code: 'WRAPPED_IDS',
+            ids: wrappedIds,
+            message: `The commonjs plugin automatically wrapped the following files:\n[\n${wrappedIds
+              .map((id) => `\t${JSON.stringify(relative$1(process.cwd(), id))}`)
+              .join(',\n')}\n]`
+          });
+        } else {
+          this.warn({
+            code: 'WRAPPED_IDS',
+            ids: wrappedIds,
+            message: 'The commonjs plugin did not wrap any files.'
+          });
+        }
+      }
+    },
+
+    load(id) {
+      if (id === HELPERS_ID) {
+        return getHelpersModule();
+      }
+
+      if (isWrappedId(id, MODULE_SUFFIX)) {
+        const name = getName(unwrapId(id, MODULE_SUFFIX));
+        return {
+          code: `var ${name} = {exports: {}}; export {${name} as __module}`,
+          meta: { commonjs: { isCommonJS: false } }
+        };
+      }
+
+      if (isWrappedId(id, EXPORTS_SUFFIX)) {
+        const name = getName(unwrapId(id, EXPORTS_SUFFIX));
+        return {
+          code: `var ${name} = {}; export {${name} as __exports}`,
+          meta: { commonjs: { isCommonJS: false } }
+        };
+      }
+
+      if (isWrappedId(id, EXTERNAL_SUFFIX)) {
+        const actualId = unwrapId(id, EXTERNAL_SUFFIX);
+        return getUnknownRequireProxy(
+          actualId,
+          isEsmExternal(actualId) ? getRequireReturnsDefault(actualId) : true
+        );
+      }
+
+      // entry suffix is just appended to not mess up relative external resolution
+      if (id.endsWith(ENTRY_SUFFIX)) {
+        const acutalId = id.slice(0, -ENTRY_SUFFIX.length);
+        const {
+          meta: { commonjs: commonjsMeta }
+        } = this.getModuleInfo(acutalId);
+        const shebang = commonjsMeta?.shebang ?? '';
+        return getEntryProxy(
+          acutalId,
+          getDefaultIsModuleExports(acutalId),
+          this.getModuleInfo,
+          shebang
+        );
+      }
+
+      if (isWrappedId(id, ES_IMPORT_SUFFIX)) {
+        const actualId = unwrapId(id, ES_IMPORT_SUFFIX);
+        return getEsImportProxy(actualId, getDefaultIsModuleExports(actualId));
+      }
+
+      if (id === DYNAMIC_MODULES_ID) {
+        return getDynamicModuleRegistry(
+          isDynamicRequireModulesEnabled,
+          dynamicRequireModules,
+          commonDir,
+          ignoreDynamicRequires
+        );
+      }
+
+      if (isWrappedId(id, PROXY_SUFFIX)) {
+        const actualId = unwrapId(id, PROXY_SUFFIX);
+        return getStaticRequireProxy(actualId, getRequireReturnsDefault(actualId), this.load);
+      }
+
+      return null;
+    },
+
+    shouldTransformCachedModule(...args) {
+      return requireResolver.shouldTransformCachedModule.call(this, ...args);
+    },
+
+    transform(code, id) {
+      if (!isPossibleCjsId(id)) return null;
+
+      try {
+        return transformAndCheckExports.call(this, code, id);
+      } catch (err) {
+        return this.error(err, err.pos);
+      }
+    }
+  };
+}
+
+// Matches the scheme of a URL, eg "http://"
+const schemeRegex = /^[\w+.-]+:\/\//;
+/**
+ * Matches the parts of a URL:
+ * 1. Scheme, including ":", guaranteed.
+ * 2. User/password, including "@", optional.
+ * 3. Host, guaranteed.
+ * 4. Port, including ":", optional.
+ * 5. Path, including "/", optional.
+ * 6. Query, including "?", optional.
+ * 7. Hash, including "#", optional.
+ */
+const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
+/**
+ * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
+ * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
+ *
+ * 1. Host, optional.
+ * 2. Path, which may include "/", guaranteed.
+ * 3. Query, including "?", optional.
+ * 4. Hash, including "#", optional.
+ */
+const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
+function isAbsoluteUrl(input) {
+    return schemeRegex.test(input);
+}
+function isSchemeRelativeUrl(input) {
+    return input.startsWith('//');
+}
+function isAbsolutePath(input) {
+    return input.startsWith('/');
+}
+function isFileUrl(input) {
+    return input.startsWith('file:');
+}
+function isRelative(input) {
+    return /^[.?#]/.test(input);
+}
+function parseAbsoluteUrl(input) {
+    const match = urlRegex.exec(input);
+    return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || '');
+}
+function parseFileUrl(input) {
+    const match = fileRegex.exec(input);
+    const path = match[2];
+    return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || '');
+}
+function makeUrl(scheme, user, host, port, path, query, hash) {
+    return {
+        scheme,
+        user,
+        host,
+        port,
+        path,
+        query,
+        hash,
+        type: 7 /* Absolute */,
+    };
+}
+function parseUrl$3(input) {
+    if (isSchemeRelativeUrl(input)) {
+        const url = parseAbsoluteUrl('http:' + input);
+        url.scheme = '';
+        url.type = 6 /* SchemeRelative */;
+        return url;
+    }
+    if (isAbsolutePath(input)) {
+        const url = parseAbsoluteUrl('http://foo.com' + input);
+        url.scheme = '';
+        url.host = '';
+        url.type = 5 /* AbsolutePath */;
+        return url;
+    }
+    if (isFileUrl(input))
+        return parseFileUrl(input);
+    if (isAbsoluteUrl(input))
+        return parseAbsoluteUrl(input);
+    const url = parseAbsoluteUrl('http://foo.com/' + input);
+    url.scheme = '';
+    url.host = '';
+    url.type = input
+        ? input.startsWith('?')
+            ? 3 /* Query */
+            : input.startsWith('#')
+                ? 2 /* Hash */
+                : 4 /* RelativePath */
+        : 1 /* Empty */;
+    return url;
+}
+function stripPathFilename(path) {
+    // If a path ends with a parent directory "..", then it's a relative path with excess parent
+    // paths. It's not a file, so we can't strip it.
+    if (path.endsWith('/..'))
+        return path;
+    const index = path.lastIndexOf('/');
+    return path.slice(0, index + 1);
+}
+function mergePaths(url, base) {
+    normalizePath$4(base, base.type);
+    // If the path is just a "/", then it was an empty path to begin with (remember, we're a relative
+    // path).
+    if (url.path === '/') {
+        url.path = base.path;
+    }
+    else {
+        // Resolution happens relative to the base path's directory, not the file.
+        url.path = stripPathFilename(base.path) + url.path;
+    }
+}
+/**
+ * The path can have empty directories "//", unneeded parents "foo/..", or current directory
+ * "foo/.". We need to normalize to a standard representation.
+ */
+function normalizePath$4(url, type) {
+    const rel = type <= 4 /* RelativePath */;
+    const pieces = url.path.split('/');
+    // We need to preserve the first piece always, so that we output a leading slash. The item at
+    // pieces[0] is an empty string.
+    let pointer = 1;
+    // Positive is the number of real directories we've output, used for popping a parent directory.
+    // Eg, "foo/bar/.." will have a positive 2, and we can decrement to be left with just "foo".
+    let positive = 0;
+    // We need to keep a trailing slash if we encounter an empty directory (eg, splitting "foo/" will
+    // generate `["foo", ""]` pieces). And, if we pop a parent directory. But once we encounter a
+    // real directory, we won't need to append, unless the other conditions happen again.
+    let addTrailingSlash = false;
+    for (let i = 1; i < pieces.length; i++) {
+        const piece = pieces[i];
+        // An empty directory, could be a trailing slash, or just a double "//" in the path.
+        if (!piece) {
+            addTrailingSlash = true;
+            continue;
+        }
+        // If we encounter a real directory, then we don't need to append anymore.
+        addTrailingSlash = false;
+        // A current directory, which we can always drop.
+        if (piece === '.')
+            continue;
+        // A parent directory, we need to see if there are any real directories we can pop. Else, we
+        // have an excess of parents, and we'll need to keep the "..".
+        if (piece === '..') {
+            if (positive) {
+                addTrailingSlash = true;
+                positive--;
+                pointer--;
+            }
+            else if (rel) {
+                // If we're in a relativePath, then we need to keep the excess parents. Else, in an absolute
+                // URL, protocol relative URL, or an absolute path, we don't need to keep excess.
+                pieces[pointer++] = piece;
+            }
+            continue;
+        }
+        // We've encountered a real directory. Move it to the next insertion pointer, which accounts for
+        // any popped or dropped directories.
+        pieces[pointer++] = piece;
+        positive++;
+    }
+    let path = '';
+    for (let i = 1; i < pointer; i++) {
+        path += '/' + pieces[i];
+    }
+    if (!path || (addTrailingSlash && !path.endsWith('/..'))) {
+        path += '/';
+    }
+    url.path = path;
+}
+/**
+ * Attempts to resolve `input` URL/path relative to `base`.
+ */
+function resolve$2(input, base) {
+    if (!input && !base)
+        return '';
+    const url = parseUrl$3(input);
+    let inputType = url.type;
+    if (base && inputType !== 7 /* Absolute */) {
+        const baseUrl = parseUrl$3(base);
+        const baseType = baseUrl.type;
+        switch (inputType) {
+            case 1 /* Empty */:
+                url.hash = baseUrl.hash;
+            // fall through
+            case 2 /* Hash */:
+                url.query = baseUrl.query;
+            // fall through
+            case 3 /* Query */:
+            case 4 /* RelativePath */:
+                mergePaths(url, baseUrl);
+            // fall through
+            case 5 /* AbsolutePath */:
+                // The host, user, and port are joined, you can't copy one without the others.
+                url.user = baseUrl.user;
+                url.host = baseUrl.host;
+                url.port = baseUrl.port;
+            // fall through
+            case 6 /* SchemeRelative */:
+                // The input doesn't have a schema at least, so we need to copy at least that over.
+                url.scheme = baseUrl.scheme;
+        }
+        if (baseType > inputType)
+            inputType = baseType;
+    }
+    normalizePath$4(url, inputType);
+    const queryHash = url.query + url.hash;
+    switch (inputType) {
+        // This is impossible, because of the empty checks at the start of the function.
+        // case UrlType.Empty:
+        case 2 /* Hash */:
+        case 3 /* Query */:
+            return queryHash;
+        case 4 /* RelativePath */: {
+            // The first char is always a "/", and we need it to be relative.
+            const path = url.path.slice(1);
+            if (!path)
+                return queryHash || '.';
+            if (isRelative(base || input) && !isRelative(path)) {
+                // If base started with a leading ".", or there is no base and input started with a ".",
+                // then we need to ensure that the relative path starts with a ".". We don't know if
+                // relative starts with a "..", though, so check before prepending.
+                return './' + path + queryHash;
+            }
+            return path + queryHash;
+        }
+        case 5 /* AbsolutePath */:
+            return url.path + queryHash;
+        default:
+            return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash;
+    }
+}
+
+function resolve$1(input, base) {
+    // The base is always treated as a directory, if it's not empty.
+    // https://github.com/mozilla/source-map/blob/8cb3ee57/lib/util.js#L327
+    // https://github.com/chromium/chromium/blob/da4adbb3/third_party/blink/renderer/devtools/front_end/sdk/SourceMap.js#L400-L401
+    if (base && !base.endsWith('/'))
+        base += '/';
+    return resolve$2(input, base);
+}
+
+/**
+ * Removes everything after the last "/", but leaves the slash.
+ */
+function stripFilename(path) {
+    if (!path)
+        return '';
+    const index = path.lastIndexOf('/');
+    return path.slice(0, index + 1);
+}
+
+const COLUMN$1 = 0;
+const SOURCES_INDEX$1 = 1;
+const SOURCE_LINE$1 = 2;
+const SOURCE_COLUMN$1 = 3;
+const NAMES_INDEX$1 = 4;
+
+function maybeSort(mappings, owned) {
+    const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
+    if (unsortedIndex === mappings.length)
+        return mappings;
+    // If we own the array (meaning we parsed it from JSON), then we're free to directly mutate it. If
+    // not, we do not want to modify the consumer's input array.
+    if (!owned)
+        mappings = mappings.slice();
+    for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) {
+        mappings[i] = sortSegments(mappings[i], owned);
+    }
+    return mappings;
+}
+function nextUnsortedSegmentLine(mappings, start) {
+    for (let i = start; i < mappings.length; i++) {
+        if (!isSorted(mappings[i]))
+            return i;
+    }
+    return mappings.length;
+}
+function isSorted(line) {
+    for (let j = 1; j < line.length; j++) {
+        if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) {
+            return false;
+        }
+    }
+    return true;
+}
+function sortSegments(line, owned) {
+    if (!owned)
+        line = line.slice();
+    return line.sort(sortComparator);
+}
+function sortComparator(a, b) {
+    return a[COLUMN$1] - b[COLUMN$1];
+}
+
+let found = false;
+/**
+ * A binary search implementation that returns the index if a match is found.
+ * If no match is found, then the left-index (the index associated with the item that comes just
+ * before the desired index) is returned. To maintain proper sort order, a splice would happen at
+ * the next index:
+ *
+ * ```js
+ * const array = [1, 3];
+ * const needle = 2;
+ * const index = binarySearch(array, needle, (item, needle) => item - needle);
+ *
+ * assert.equal(index, 0);
+ * array.splice(index + 1, 0, needle);
+ * assert.deepEqual(array, [1, 2, 3]);
+ * ```
+ */
+function binarySearch(haystack, needle, low, high) {
+    while (low <= high) {
+        const mid = low + ((high - low) >> 1);
+        const cmp = haystack[mid][COLUMN$1] - needle;
+        if (cmp === 0) {
+            found = true;
+            return mid;
+        }
+        if (cmp < 0) {
+            low = mid + 1;
+        }
+        else {
+            high = mid - 1;
+        }
+    }
+    found = false;
+    return low - 1;
+}
+function upperBound(haystack, needle, index) {
+    for (let i = index + 1; i < haystack.length; index = i++) {
+        if (haystack[i][COLUMN$1] !== needle)
+            break;
+    }
+    return index;
+}
+function lowerBound(haystack, needle, index) {
+    for (let i = index - 1; i >= 0; index = i--) {
+        if (haystack[i][COLUMN$1] !== needle)
+            break;
+    }
+    return index;
+}
+function memoizedState() {
+    return {
+        lastKey: -1,
+        lastNeedle: -1,
+        lastIndex: -1,
+    };
+}
+/**
+ * This overly complicated beast is just to record the last tested line/column and the resulting
+ * index, allowing us to skip a few tests if mappings are monotonically increasing.
+ */
+function memoizedBinarySearch(haystack, needle, state, key) {
+    const { lastKey, lastNeedle, lastIndex } = state;
+    let low = 0;
+    let high = haystack.length - 1;
+    if (key === lastKey) {
+        if (needle === lastNeedle) {
+            found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle;
+            return lastIndex;
+        }
+        if (needle >= lastNeedle) {
+            // lastIndex may be -1 if the previous needle was not found.
+            low = lastIndex === -1 ? 0 : lastIndex;
+        }
+        else {
+            high = lastIndex;
+        }
+    }
+    state.lastKey = key;
+    state.lastNeedle = needle;
+    return (state.lastIndex = binarySearch(haystack, needle, low, high));
+}
+
+const LINE_GTR_ZERO = '`line` must be greater than 0 (lines start at line 1)';
+const COL_GTR_EQ_ZERO = '`column` must be greater than or equal to 0 (columns start at column 0)';
+const LEAST_UPPER_BOUND = -1;
+const GREATEST_LOWER_BOUND = 1;
+class TraceMap {
+    constructor(map, mapUrl) {
+        const isString = typeof map === 'string';
+        if (!isString && map._decodedMemo)
+            return map;
+        const parsed = (isString ? JSON.parse(map) : map);
+        const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
+        this.version = version;
+        this.file = file;
+        this.names = names || [];
+        this.sourceRoot = sourceRoot;
+        this.sources = sources;
+        this.sourcesContent = sourcesContent;
+        this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || undefined;
+        const from = resolve$1(sourceRoot || '', stripFilename(mapUrl));
+        this.resolvedSources = sources.map((s) => resolve$1(s || '', from));
+        const { mappings } = parsed;
+        if (typeof mappings === 'string') {
+            this._encoded = mappings;
+            this._decoded = undefined;
+        }
+        else {
+            this._encoded = undefined;
+            this._decoded = maybeSort(mappings, isString);
+        }
+        this._decodedMemo = memoizedState();
+        this._bySources = undefined;
+        this._bySourceMemos = undefined;
+    }
+}
+/**
+ * Typescript doesn't allow friend access to private fields, so this just casts the map into a type
+ * with public access modifiers.
+ */
+function cast$2(map) {
+    return map;
+}
+/**
+ * Returns the encoded (VLQ string) form of the SourceMap's mappings field.
+ */
+function encodedMappings(map) {
+    var _a;
+    var _b;
+    return ((_a = (_b = cast$2(map))._encoded) !== null && _a !== void 0 ? _a : (_b._encoded = encode$1(cast$2(map)._decoded)));
+}
+/**
+ * Returns the decoded (array of lines of segments) form of the SourceMap's mappings field.
+ */
+function decodedMappings(map) {
+    var _a;
+    return ((_a = cast$2(map))._decoded || (_a._decoded = decode(cast$2(map)._encoded)));
+}
+/**
+ * A low-level API to find the segment associated with a generated line/column (think, from a
+ * stack trace). Line and column here are 0-based, unlike `originalPositionFor`.
+ */
+function traceSegment(map, line, column) {
+    const decoded = decodedMappings(map);
+    // It's common for parent source maps to have pointers to lines that have no
+    // mapping (like a "//# sourceMappingURL=") at the end of the child file.
+    if (line >= decoded.length)
+        return null;
+    const segments = decoded[line];
+    const index = traceSegmentInternal(segments, cast$2(map)._decodedMemo, line, column, GREATEST_LOWER_BOUND);
+    return index === -1 ? null : segments[index];
+}
+/**
+ * A higher-level API to find the source/line/column associated with a generated line/column
+ * (think, from a stack trace). Line is 1-based, but column is 0-based, due to legacy behavior in
+ * `source-map` library.
+ */
+function originalPositionFor$1(map, needle) {
+    let { line, column, bias } = needle;
+    line--;
+    if (line < 0)
+        throw new Error(LINE_GTR_ZERO);
+    if (column < 0)
+        throw new Error(COL_GTR_EQ_ZERO);
+    const decoded = decodedMappings(map);
+    // It's common for parent source maps to have pointers to lines that have no
+    // mapping (like a "//# sourceMappingURL=") at the end of the child file.
+    if (line >= decoded.length)
+        return OMapping(null, null, null, null);
+    const segments = decoded[line];
+    const index = traceSegmentInternal(segments, cast$2(map)._decodedMemo, line, column, bias || GREATEST_LOWER_BOUND);
+    if (index === -1)
+        return OMapping(null, null, null, null);
+    const segment = segments[index];
+    if (segment.length === 1)
+        return OMapping(null, null, null, null);
+    const { names, resolvedSources } = map;
+    return OMapping(resolvedSources[segment[SOURCES_INDEX$1]], segment[SOURCE_LINE$1] + 1, segment[SOURCE_COLUMN$1], segment.length === 5 ? names[segment[NAMES_INDEX$1]] : null);
+}
+/**
+ * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
+ * a sourcemap, or to JSON.stringify.
+ */
+function decodedMap(map) {
+    return clone(map, decodedMappings(map));
+}
+/**
+ * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
+ * a sourcemap, or to JSON.stringify.
+ */
+function encodedMap(map) {
+    return clone(map, encodedMappings(map));
+}
+function clone(map, mappings) {
+    return {
+        version: map.version,
+        file: map.file,
+        names: map.names,
+        sourceRoot: map.sourceRoot,
+        sources: map.sources,
+        sourcesContent: map.sourcesContent,
+        mappings,
+        ignoreList: map.ignoreList || map.x_google_ignoreList,
+    };
+}
+function OMapping(source, line, column, name) {
+    return { source, line, column, name };
+}
+function traceSegmentInternal(segments, memo, line, column, bias) {
+    let index = memoizedBinarySearch(segments, column, memo, line);
+    if (found) {
+        index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
+    }
+    else if (bias === LEAST_UPPER_BOUND)
+        index++;
+    if (index === -1 || index === segments.length)
+        return -1;
+    return index;
+}
+
+/**
+ * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the
+ * index of the `key` in the backing array.
+ *
+ * This is designed to allow synchronizing a second array with the contents of the backing array,
+ * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,
+ * and there are never duplicates.
+ */
+class SetArray {
+    constructor() {
+        this._indexes = { __proto__: null };
+        this.array = [];
+    }
+}
+/**
+ * Typescript doesn't allow friend access to private fields, so this just casts the set into a type
+ * with public access modifiers.
+ */
+function cast$1(set) {
+    return set;
+}
+/**
+ * Gets the index associated with `key` in the backing array, if it is already present.
+ */
+function get(setarr, key) {
+    return cast$1(setarr)._indexes[key];
+}
+/**
+ * Puts `key` into the backing array, if it is not already present. Returns
+ * the index of the `key` in the backing array.
+ */
+function put(setarr, key) {
+    // The key may or may not be present. If it is present, it's a number.
+    const index = get(setarr, key);
+    if (index !== undefined)
+        return index;
+    const { array, _indexes: indexes } = cast$1(setarr);
+    const length = array.push(key);
+    return (indexes[key] = length - 1);
+}
+/**
+ * Removes the key, if it exists in the set.
+ */
+function remove(setarr, key) {
+    const index = get(setarr, key);
+    if (index === undefined)
+        return;
+    const { array, _indexes: indexes } = cast$1(setarr);
+    for (let i = index + 1; i < array.length; i++) {
+        const k = array[i];
+        array[i - 1] = k;
+        indexes[k]--;
+    }
+    indexes[key] = undefined;
+    array.pop();
+}
+
+const COLUMN = 0;
+const SOURCES_INDEX = 1;
+const SOURCE_LINE = 2;
+const SOURCE_COLUMN = 3;
+const NAMES_INDEX = 4;
+
+const NO_NAME = -1;
+/**
+ * Provides the state to generate a sourcemap.
+ */
+class GenMapping {
+    constructor({ file, sourceRoot } = {}) {
+        this._names = new SetArray();
+        this._sources = new SetArray();
+        this._sourcesContent = [];
+        this._mappings = [];
+        this.file = file;
+        this.sourceRoot = sourceRoot;
+        this._ignoreList = new SetArray();
+    }
+}
+/**
+ * Typescript doesn't allow friend access to private fields, so this just casts the map into a type
+ * with public access modifiers.
+ */
+function cast(map) {
+    return map;
+}
+/**
+ * Same as `addSegment`, but will only add the segment if it generates useful information in the
+ * resulting map. This only works correctly if segments are added **in order**, meaning you should
+ * not add a segment with a lower generated line/column than one that came before.
+ */
+const maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
+    return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name);
+};
+/**
+ * Adds/removes the content of the source file to the source map.
+ */
+function setSourceContent(map, source, content) {
+    const { _sources: sources, _sourcesContent: sourcesContent } = cast(map);
+    const index = put(sources, source);
+    sourcesContent[index] = content;
+}
+function setIgnore(map, source, ignore = true) {
+    const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList } = cast(map);
+    const index = put(sources, source);
+    if (index === sourcesContent.length)
+        sourcesContent[index] = null;
+    if (ignore)
+        put(ignoreList, index);
+    else
+        remove(ignoreList, index);
+}
+/**
+ * Returns a sourcemap object (with decoded mappings) suitable for passing to a library that expects
+ * a sourcemap, or to JSON.stringify.
+ */
+function toDecodedMap(map) {
+    const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList, } = cast(map);
+    removeEmptyFinalLines(mappings);
+    return {
+        version: 3,
+        file: map.file || undefined,
+        names: names.array,
+        sourceRoot: map.sourceRoot || undefined,
+        sources: sources.array,
+        sourcesContent,
+        mappings,
+        ignoreList: ignoreList.array,
+    };
+}
+/**
+ * Returns a sourcemap object (with encoded mappings) suitable for passing to a library that expects
+ * a sourcemap, or to JSON.stringify.
+ */
+function toEncodedMap(map) {
+    const decoded = toDecodedMap(map);
+    return Object.assign(Object.assign({}, decoded), { mappings: encode$1(decoded.mappings) });
+}
+// This split declaration is only so that terser can elminiate the static initialization block.
+function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
+    const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, } = cast(map);
+    const line = getLine(mappings, genLine);
+    const index = getColumnIndex(line, genColumn);
+    if (!source) {
+        if (skipSourceless(line, index))
+            return;
+        return insert(line, index, [genColumn]);
+    }
+    const sourcesIndex = put(sources, source);
+    const namesIndex = name ? put(names, name) : NO_NAME;
+    if (sourcesIndex === sourcesContent.length)
+        sourcesContent[sourcesIndex] = null;
+    if (skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) {
+        return;
+    }
+    return insert(line, index, name
+        ? [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex]
+        : [genColumn, sourcesIndex, sourceLine, sourceColumn]);
+}
+function getLine(mappings, index) {
+    for (let i = mappings.length; i <= index; i++) {
+        mappings[i] = [];
+    }
+    return mappings[index];
+}
+function getColumnIndex(line, genColumn) {
+    let index = line.length;
+    for (let i = index - 1; i >= 0; index = i--) {
+        const current = line[i];
+        if (genColumn >= current[COLUMN])
+            break;
+    }
+    return index;
+}
+function insert(array, index, value) {
+    for (let i = array.length; i > index; i--) {
+        array[i] = array[i - 1];
+    }
+    array[index] = value;
+}
+function removeEmptyFinalLines(mappings) {
+    const { length } = mappings;
+    let len = length;
+    for (let i = len - 1; i >= 0; len = i, i--) {
+        if (mappings[i].length > 0)
+            break;
+    }
+    if (len < length)
+        mappings.length = len;
+}
+function skipSourceless(line, index) {
+    // The start of a line is already sourceless, so adding a sourceless segment to the beginning
+    // doesn't generate any useful information.
+    if (index === 0)
+        return true;
+    const prev = line[index - 1];
+    // If the previous segment is also sourceless, then adding another sourceless segment doesn't
+    // genrate any new information. Else, this segment will end the source/named segment and point to
+    // a sourceless position, which is useful.
+    return prev.length === 1;
+}
+function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
+    // A source/named segment at the start of a line gives position at that genColumn
+    if (index === 0)
+        return false;
+    const prev = line[index - 1];
+    // If the previous segment is sourceless, then we're transitioning to a source.
+    if (prev.length === 1)
+        return false;
+    // If the previous segment maps to the exact same source position, then this segment doesn't
+    // provide any new position information.
+    return (sourcesIndex === prev[SOURCES_INDEX] &&
+        sourceLine === prev[SOURCE_LINE] &&
+        sourceColumn === prev[SOURCE_COLUMN] &&
+        namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME));
+}
+
+const SOURCELESS_MAPPING = /* #__PURE__ */ SegmentObject('', -1, -1, '', null, false);
+const EMPTY_SOURCES = [];
+function SegmentObject(source, line, column, name, content, ignore) {
+    return { source, line, column, name, content, ignore };
+}
+function Source(map, sources, source, content, ignore) {
+    return {
+        map,
+        sources,
+        source,
+        content,
+        ignore,
+    };
+}
+/**
+ * MapSource represents a single sourcemap, with the ability to trace mappings into its child nodes
+ * (which may themselves be SourceMapTrees).
+ */
+function MapSource(map, sources) {
+    return Source(map, sources, '', null, false);
+}
+/**
+ * A "leaf" node in the sourcemap tree, representing an original, unmodified source file. Recursive
+ * segment tracing ends at the `OriginalSource`.
+ */
+function OriginalSource(source, content, ignore) {
+    return Source(null, EMPTY_SOURCES, source, content, ignore);
+}
+/**
+ * traceMappings is only called on the root level SourceMapTree, and begins the process of
+ * resolving each mapping in terms of the original source files.
+ */
+function traceMappings(tree) {
+    // TODO: Eventually support sourceRoot, which has to be removed because the sources are already
+    // fully resolved. We'll need to make sources relative to the sourceRoot before adding them.
+    const gen = new GenMapping({ file: tree.map.file });
+    const { sources: rootSources, map } = tree;
+    const rootNames = map.names;
+    const rootMappings = decodedMappings(map);
+    for (let i = 0; i < rootMappings.length; i++) {
+        const segments = rootMappings[i];
+        for (let j = 0; j < segments.length; j++) {
+            const segment = segments[j];
+            const genCol = segment[0];
+            let traced = SOURCELESS_MAPPING;
+            // 1-length segments only move the current generated column, there's no source information
+            // to gather from it.
+            if (segment.length !== 1) {
+                const source = rootSources[segment[1]];
+                traced = originalPositionFor(source, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : '');
+                // If the trace is invalid, then the trace ran into a sourcemap that doesn't contain a
+                // respective segment into an original source.
+                if (traced == null)
+                    continue;
+            }
+            const { column, line, name, content, source, ignore } = traced;
+            maybeAddSegment(gen, i, genCol, source, line, column, name);
+            if (source && content != null)
+                setSourceContent(gen, source, content);
+            if (ignore)
+                setIgnore(gen, source, true);
+        }
+    }
+    return gen;
+}
+/**
+ * originalPositionFor is only called on children SourceMapTrees. It recurses down into its own
+ * child SourceMapTrees, until we find the original source map.
+ */
+function originalPositionFor(source, line, column, name) {
+    if (!source.map) {
+        return SegmentObject(source.source, line, column, name, source.content, source.ignore);
+    }
+    const segment = traceSegment(source.map, line, column);
+    // If we couldn't find a segment, then this doesn't exist in the sourcemap.
+    if (segment == null)
+        return null;
+    // 1-length segments only move the current generated column, there's no source information
+    // to gather from it.
+    if (segment.length === 1)
+        return SOURCELESS_MAPPING;
+    return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
+}
+
+function asArray(value) {
+    if (Array.isArray(value))
+        return value;
+    return [value];
+}
+/**
+ * Recursively builds a tree structure out of sourcemap files, with each node
+ * being either an `OriginalSource` "leaf" or a `SourceMapTree` composed of
+ * `OriginalSource`s and `SourceMapTree`s.
+ *
+ * Every sourcemap is composed of a collection of source files and mappings
+ * into locations of those source files. When we generate a `SourceMapTree` for
+ * the sourcemap, we attempt to load each source file's own sourcemap. If it
+ * does not have an associated sourcemap, it is considered an original,
+ * unmodified source file.
+ */
+function buildSourceMapTree(input, loader) {
+    const maps = asArray(input).map((m) => new TraceMap(m, ''));
+    const map = maps.pop();
+    for (let i = 0; i < maps.length; i++) {
+        if (maps[i].sources.length > 1) {
+            throw new Error(`Transformation map ${i} must have exactly one source file.\n` +
+                'Did you specify these with the most recent transformation maps first?');
+        }
+    }
+    let tree = build$2(map, loader, '', 0);
+    for (let i = maps.length - 1; i >= 0; i--) {
+        tree = MapSource(maps[i], [tree]);
+    }
+    return tree;
+}
+function build$2(map, loader, importer, importerDepth) {
+    const { resolvedSources, sourcesContent, ignoreList } = map;
+    const depth = importerDepth + 1;
+    const children = resolvedSources.map((sourceFile, i) => {
+        // The loading context gives the loader more information about why this file is being loaded
+        // (eg, from which importer). It also allows the loader to override the location of the loaded
+        // sourcemap/original source, or to override the content in the sourcesContent field if it's
+        // an unmodified source file.
+        const ctx = {
+            importer,
+            depth,
+            source: sourceFile || '',
+            content: undefined,
+            ignore: undefined,
+        };
+        // Use the provided loader callback to retrieve the file's sourcemap.
+        // TODO: We should eventually support async loading of sourcemap files.
+        const sourceMap = loader(ctx.source, ctx);
+        const { source, content, ignore } = ctx;
+        // If there is a sourcemap, then we need to recurse into it to load its source files.
+        if (sourceMap)
+            return build$2(new TraceMap(sourceMap, source), loader, source, depth);
+        // Else, it's an unmodified source file.
+        // The contents of this unmodified source file can be overridden via the loader context,
+        // allowing it to be explicitly null or a string. If it remains undefined, we fall back to
+        // the importing sourcemap's `sourcesContent` field.
+        const sourceContent = content !== undefined ? content : sourcesContent ? sourcesContent[i] : null;
+        const ignored = ignore !== undefined ? ignore : ignoreList ? ignoreList.includes(i) : false;
+        return OriginalSource(source, sourceContent, ignored);
+    });
+    return MapSource(map, children);
+}
+
+/**
+ * A SourceMap v3 compatible sourcemap, which only includes fields that were
+ * provided to it.
+ */
+class SourceMap {
+    constructor(map, options) {
+        const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
+        this.version = out.version; // SourceMap spec says this should be first.
+        this.file = out.file;
+        this.mappings = out.mappings;
+        this.names = out.names;
+        this.ignoreList = out.ignoreList;
+        this.sourceRoot = out.sourceRoot;
+        this.sources = out.sources;
+        if (!options.excludeContent) {
+            this.sourcesContent = out.sourcesContent;
+        }
+    }
+    toString() {
+        return JSON.stringify(this);
+    }
+}
+
+/**
+ * Traces through all the mappings in the root sourcemap, through the sources
+ * (and their sourcemaps), all the way back to the original source location.
+ *
+ * `loader` will be called every time we encounter a source file. If it returns
+ * a sourcemap, we will recurse into that sourcemap to continue the trace. If
+ * it returns a falsey value, that source file is treated as an original,
+ * unmodified source file.
+ *
+ * Pass `excludeContent` to exclude any self-containing source file content
+ * from the output sourcemap.
+ *
+ * Pass `decodedMappings` to receive a SourceMap with decoded (instead of
+ * VLQ encoded) mappings.
+ */
+function remapping(input, loader, options) {
+    const opts = { excludeContent: !!options, decodedMappings: false };
+    const tree = buildSourceMapTree(input, loader);
+    return new SourceMap(traceMappings(tree), opts);
+}
+
+var src$3 = {exports: {}};
+
+var browser$3 = {exports: {}};
+
+/**
+ * Helpers.
+ */
+
+var ms$1;
+var hasRequiredMs$1;
+
+function requireMs$1 () {
+	if (hasRequiredMs$1) return ms$1;
+	hasRequiredMs$1 = 1;
+	var s = 1000;
+	var m = s * 60;
+	var h = m * 60;
+	var d = h * 24;
+	var w = d * 7;
+	var y = d * 365.25;
+
+	/**
+	 * Parse or format the given `val`.
+	 *
+	 * Options:
+	 *
+	 *  - `long` verbose formatting [false]
+	 *
+	 * @param {String|Number} val
+	 * @param {Object} [options]
+	 * @throws {Error} throw an error if val is not a non-empty string or a number
+	 * @return {String|Number}
+	 * @api public
+	 */
+
+	ms$1 = function(val, options) {
+	  options = options || {};
+	  var type = typeof val;
+	  if (type === 'string' && val.length > 0) {
+	    return parse(val);
+	  } else if (type === 'number' && isFinite(val)) {
+	    return options.long ? fmtLong(val) : fmtShort(val);
+	  }
+	  throw new Error(
+	    'val is not a non-empty string or a valid number. val=' +
+	      JSON.stringify(val)
+	  );
+	};
+
+	/**
+	 * Parse the given `str` and return milliseconds.
+	 *
+	 * @param {String} str
+	 * @return {Number}
+	 * @api private
+	 */
+
+	function parse(str) {
+	  str = String(str);
+	  if (str.length > 100) {
+	    return;
+	  }
+	  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
+	    str
+	  );
+	  if (!match) {
+	    return;
+	  }
+	  var n = parseFloat(match[1]);
+	  var type = (match[2] || 'ms').toLowerCase();
+	  switch (type) {
+	    case 'years':
+	    case 'year':
+	    case 'yrs':
+	    case 'yr':
+	    case 'y':
+	      return n * y;
+	    case 'weeks':
+	    case 'week':
+	    case 'w':
+	      return n * w;
+	    case 'days':
+	    case 'day':
+	    case 'd':
+	      return n * d;
+	    case 'hours':
+	    case 'hour':
+	    case 'hrs':
+	    case 'hr':
+	    case 'h':
+	      return n * h;
+	    case 'minutes':
+	    case 'minute':
+	    case 'mins':
+	    case 'min':
+	    case 'm':
+	      return n * m;
+	    case 'seconds':
+	    case 'second':
+	    case 'secs':
+	    case 'sec':
+	    case 's':
+	      return n * s;
+	    case 'milliseconds':
+	    case 'millisecond':
+	    case 'msecs':
+	    case 'msec':
+	    case 'ms':
+	      return n;
+	    default:
+	      return undefined;
+	  }
+	}
+
+	/**
+	 * Short format for `ms`.
+	 *
+	 * @param {Number} ms
+	 * @return {String}
+	 * @api private
+	 */
+
+	function fmtShort(ms) {
+	  var msAbs = Math.abs(ms);
+	  if (msAbs >= d) {
+	    return Math.round(ms / d) + 'd';
+	  }
+	  if (msAbs >= h) {
+	    return Math.round(ms / h) + 'h';
+	  }
+	  if (msAbs >= m) {
+	    return Math.round(ms / m) + 'm';
+	  }
+	  if (msAbs >= s) {
+	    return Math.round(ms / s) + 's';
+	  }
+	  return ms + 'ms';
+	}
+
+	/**
+	 * Long format for `ms`.
+	 *
+	 * @param {Number} ms
+	 * @return {String}
+	 * @api private
+	 */
+
+	function fmtLong(ms) {
+	  var msAbs = Math.abs(ms);
+	  if (msAbs >= d) {
+	    return plural(ms, msAbs, d, 'day');
+	  }
+	  if (msAbs >= h) {
+	    return plural(ms, msAbs, h, 'hour');
+	  }
+	  if (msAbs >= m) {
+	    return plural(ms, msAbs, m, 'minute');
+	  }
+	  if (msAbs >= s) {
+	    return plural(ms, msAbs, s, 'second');
+	  }
+	  return ms + ' ms';
+	}
+
+	/**
+	 * Pluralization helper.
+	 */
+
+	function plural(ms, msAbs, n, name) {
+	  var isPlural = msAbs >= n * 1.5;
+	  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
+	}
+	return ms$1;
+}
+
+var common$b;
+var hasRequiredCommon;
+
+function requireCommon () {
+	if (hasRequiredCommon) return common$b;
+	hasRequiredCommon = 1;
+	/**
+	 * This is the common logic for both the Node.js and web browser
+	 * implementations of `debug()`.
+	 */
+
+	function setup(env) {
+		createDebug.debug = createDebug;
+		createDebug.default = createDebug;
+		createDebug.coerce = coerce;
+		createDebug.disable = disable;
+		createDebug.enable = enable;
+		createDebug.enabled = enabled;
+		createDebug.humanize = requireMs$1();
+		createDebug.destroy = destroy;
+
+		Object.keys(env).forEach(key => {
+			createDebug[key] = env[key];
+		});
+
+		/**
+		* The currently active debug mode names, and names to skip.
+		*/
+
+		createDebug.names = [];
+		createDebug.skips = [];
+
+		/**
+		* Map of special "%n" handling functions, for the debug "format" argument.
+		*
+		* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
+		*/
+		createDebug.formatters = {};
+
+		/**
+		* Selects a color for a debug namespace
+		* @param {String} namespace The namespace string for the debug instance to be colored
+		* @return {Number|String} An ANSI color code for the given namespace
+		* @api private
+		*/
+		function selectColor(namespace) {
+			let hash = 0;
+
+			for (let i = 0; i < namespace.length; i++) {
+				hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
+				hash |= 0; // Convert to 32bit integer
+			}
+
+			return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
+		}
+		createDebug.selectColor = selectColor;
+
+		/**
+		* Create a debugger with the given `namespace`.
+		*
+		* @param {String} namespace
+		* @return {Function}
+		* @api public
+		*/
+		function createDebug(namespace) {
+			let prevTime;
+			let enableOverride = null;
+			let namespacesCache;
+			let enabledCache;
+
+			function debug(...args) {
+				// Disabled?
+				if (!debug.enabled) {
+					return;
+				}
+
+				const self = debug;
+
+				// Set `diff` timestamp
+				const curr = Number(new Date());
+				const ms = curr - (prevTime || curr);
+				self.diff = ms;
+				self.prev = prevTime;
+				self.curr = curr;
+				prevTime = curr;
+
+				args[0] = createDebug.coerce(args[0]);
+
+				if (typeof args[0] !== 'string') {
+					// Anything else let's inspect with %O
+					args.unshift('%O');
+				}
+
+				// Apply any `formatters` transformations
+				let index = 0;
+				args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
+					// If we encounter an escaped % then don't increase the array index
+					if (match === '%%') {
+						return '%';
+					}
+					index++;
+					const formatter = createDebug.formatters[format];
+					if (typeof formatter === 'function') {
+						const val = args[index];
+						match = formatter.call(self, val);
+
+						// Now we need to remove `args[index]` since it's inlined in the `format`
+						args.splice(index, 1);
+						index--;
+					}
+					return match;
+				});
+
+				// Apply env-specific formatting (colors, etc.)
+				createDebug.formatArgs.call(self, args);
+
+				const logFn = self.log || createDebug.log;
+				logFn.apply(self, args);
+			}
+
+			debug.namespace = namespace;
+			debug.useColors = createDebug.useColors();
+			debug.color = createDebug.selectColor(namespace);
+			debug.extend = extend;
+			debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
+
+			Object.defineProperty(debug, 'enabled', {
+				enumerable: true,
+				configurable: false,
+				get: () => {
+					if (enableOverride !== null) {
+						return enableOverride;
+					}
+					if (namespacesCache !== createDebug.namespaces) {
+						namespacesCache = createDebug.namespaces;
+						enabledCache = createDebug.enabled(namespace);
+					}
+
+					return enabledCache;
+				},
+				set: v => {
+					enableOverride = v;
+				}
+			});
+
+			// Env-specific initialization logic for debug instances
+			if (typeof createDebug.init === 'function') {
+				createDebug.init(debug);
+			}
+
+			return debug;
+		}
+
+		function extend(namespace, delimiter) {
+			const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
+			newDebug.log = this.log;
+			return newDebug;
+		}
+
+		/**
+		* Enables a debug mode by namespaces. This can include modes
+		* separated by a colon and wildcards.
+		*
+		* @param {String} namespaces
+		* @api public
+		*/
+		function enable(namespaces) {
+			createDebug.save(namespaces);
+			createDebug.namespaces = namespaces;
+
+			createDebug.names = [];
+			createDebug.skips = [];
+
+			let i;
+			const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
+			const len = split.length;
+
+			for (i = 0; i < len; i++) {
+				if (!split[i]) {
+					// ignore empty strings
+					continue;
+				}
+
+				namespaces = split[i].replace(/\*/g, '.*?');
+
+				if (namespaces[0] === '-') {
+					createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
+				} else {
+					createDebug.names.push(new RegExp('^' + namespaces + '$'));
+				}
+			}
+		}
+
+		/**
+		* Disable debug output.
+		*
+		* @return {String} namespaces
+		* @api public
+		*/
+		function disable() {
+			const namespaces = [
+				...createDebug.names.map(toNamespace),
+				...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
+			].join(',');
+			createDebug.enable('');
+			return namespaces;
+		}
+
+		/**
+		* Returns true if the given mode name is enabled, false otherwise.
+		*
+		* @param {String} name
+		* @return {Boolean}
+		* @api public
+		*/
+		function enabled(name) {
+			if (name[name.length - 1] === '*') {
+				return true;
+			}
+
+			let i;
+			let len;
+
+			for (i = 0, len = createDebug.skips.length; i < len; i++) {
+				if (createDebug.skips[i].test(name)) {
+					return false;
+				}
+			}
+
+			for (i = 0, len = createDebug.names.length; i < len; i++) {
+				if (createDebug.names[i].test(name)) {
+					return true;
+				}
+			}
+
+			return false;
+		}
+
+		/**
+		* Convert regexp to namespace
+		*
+		* @param {RegExp} regxep
+		* @return {String} namespace
+		* @api private
+		*/
+		function toNamespace(regexp) {
+			return regexp.toString()
+				.substring(2, regexp.toString().length - 2)
+				.replace(/\.\*\?$/, '*');
+		}
+
+		/**
+		* Coerce `val`.
+		*
+		* @param {Mixed} val
+		* @return {Mixed}
+		* @api private
+		*/
+		function coerce(val) {
+			if (val instanceof Error) {
+				return val.stack || val.message;
+			}
+			return val;
+		}
+
+		/**
+		* XXX DO NOT USE. This is a temporary stub function.
+		* XXX It WILL be removed in the next major release.
+		*/
+		function destroy() {
+			console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+		}
+
+		createDebug.enable(createDebug.load());
+
+		return createDebug;
+	}
+
+	common$b = setup;
+	return common$b;
+}
+
+/* eslint-env browser */
+
+var hasRequiredBrowser$1;
+
+function requireBrowser$1 () {
+	if (hasRequiredBrowser$1) return browser$3.exports;
+	hasRequiredBrowser$1 = 1;
+	(function (module, exports) {
+		/**
+		 * This is the web browser implementation of `debug()`.
+		 */
+
+		exports.formatArgs = formatArgs;
+		exports.save = save;
+		exports.load = load;
+		exports.useColors = useColors;
+		exports.storage = localstorage();
+		exports.destroy = (() => {
+			let warned = false;
+
+			return () => {
+				if (!warned) {
+					warned = true;
+					console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
+				}
+			};
+		})();
+
+		/**
+		 * Colors.
+		 */
+
+		exports.colors = [
+			'#0000CC',
+			'#0000FF',
+			'#0033CC',
+			'#0033FF',
+			'#0066CC',
+			'#0066FF',
+			'#0099CC',
+			'#0099FF',
+			'#00CC00',
+			'#00CC33',
+			'#00CC66',
+			'#00CC99',
+			'#00CCCC',
+			'#00CCFF',
+			'#3300CC',
+			'#3300FF',
+			'#3333CC',
+			'#3333FF',
+			'#3366CC',
+			'#3366FF',
+			'#3399CC',
+			'#3399FF',
+			'#33CC00',
+			'#33CC33',
+			'#33CC66',
+			'#33CC99',
+			'#33CCCC',
+			'#33CCFF',
+			'#6600CC',
+			'#6600FF',
+			'#6633CC',
+			'#6633FF',
+			'#66CC00',
+			'#66CC33',
+			'#9900CC',
+			'#9900FF',
+			'#9933CC',
+			'#9933FF',
+			'#99CC00',
+			'#99CC33',
+			'#CC0000',
+			'#CC0033',
+			'#CC0066',
+			'#CC0099',
+			'#CC00CC',
+			'#CC00FF',
+			'#CC3300',
+			'#CC3333',
+			'#CC3366',
+			'#CC3399',
+			'#CC33CC',
+			'#CC33FF',
+			'#CC6600',
+			'#CC6633',
+			'#CC9900',
+			'#CC9933',
+			'#CCCC00',
+			'#CCCC33',
+			'#FF0000',
+			'#FF0033',
+			'#FF0066',
+			'#FF0099',
+			'#FF00CC',
+			'#FF00FF',
+			'#FF3300',
+			'#FF3333',
+			'#FF3366',
+			'#FF3399',
+			'#FF33CC',
+			'#FF33FF',
+			'#FF6600',
+			'#FF6633',
+			'#FF9900',
+			'#FF9933',
+			'#FFCC00',
+			'#FFCC33'
+		];
+
+		/**
+		 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
+		 * and the Firebug extension (any Firefox version) are known
+		 * to support "%c" CSS customizations.
+		 *
+		 * TODO: add a `localStorage` variable to explicitly enable/disable colors
+		 */
+
+		// eslint-disable-next-line complexity
+		function useColors() {
+			// NB: In an Electron preload script, document will be defined but not fully
+			// initialized. Since we know we're in Chrome, we'll just detect this case
+			// explicitly
+			if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
+				return true;
+			}
+
+			// Internet Explorer and Edge do not support colors.
+			if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
+				return false;
+			}
+
+			let m;
+
+			// Is webkit? http://stackoverflow.com/a/16459606/376773
+			// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
+			return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
+				// Is firebug? http://stackoverflow.com/a/398120/376773
+				(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
+				// Is firefox >= v31?
+				// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
+				(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
+				// Double check webkit in userAgent just in case we are in a worker
+				(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
+		}
+
+		/**
+		 * Colorize log arguments if enabled.
+		 *
+		 * @api public
+		 */
+
+		function formatArgs(args) {
+			args[0] = (this.useColors ? '%c' : '') +
+				this.namespace +
+				(this.useColors ? ' %c' : ' ') +
+				args[0] +
+				(this.useColors ? '%c ' : ' ') +
+				'+' + module.exports.humanize(this.diff);
+
+			if (!this.useColors) {
+				return;
+			}
+
+			const c = 'color: ' + this.color;
+			args.splice(1, 0, c, 'color: inherit');
+
+			// The final "%c" is somewhat tricky, because there could be other
+			// arguments passed either before or after the %c, so we need to
+			// figure out the correct index to insert the CSS into
+			let index = 0;
+			let lastC = 0;
+			args[0].replace(/%[a-zA-Z%]/g, match => {
+				if (match === '%%') {
+					return;
+				}
+				index++;
+				if (match === '%c') {
+					// We only are interested in the *last* %c
+					// (the user may have provided their own)
+					lastC = index;
+				}
+			});
+
+			args.splice(lastC, 0, c);
+		}
+
+		/**
+		 * Invokes `console.debug()` when available.
+		 * No-op when `console.debug` is not a "function".
+		 * If `console.debug` is not available, falls back
+		 * to `console.log`.
+		 *
+		 * @api public
+		 */
+		exports.log = console.debug || console.log || (() => {});
+
+		/**
+		 * Save `namespaces`.
+		 *
+		 * @param {String} namespaces
+		 * @api private
+		 */
+		function save(namespaces) {
+			try {
+				if (namespaces) {
+					exports.storage.setItem('debug', namespaces);
+				} else {
+					exports.storage.removeItem('debug');
+				}
+			} catch (error) {
+				// Swallow
+				// XXX (@Qix-) should we be logging these?
+			}
+		}
+
+		/**
+		 * Load `namespaces`.
+		 *
+		 * @return {String} returns the previously persisted debug modes
+		 * @api private
+		 */
+		function load() {
+			let r;
+			try {
+				r = exports.storage.getItem('debug');
+			} catch (error) {
+				// Swallow
+				// XXX (@Qix-) should we be logging these?
+			}
+
+			// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
+			if (!r && typeof process !== 'undefined' && 'env' in process) {
+				r = process.env.DEBUG;
+			}
+
+			return r;
+		}
+
+		/**
+		 * Localstorage attempts to return the localstorage.
+		 *
+		 * This is necessary because safari throws
+		 * when a user disables cookies/localstorage
+		 * and you attempt to access it.
+		 *
+		 * @return {LocalStorage}
+		 * @api private
+		 */
+
+		function localstorage() {
+			try {
+				// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
+				// The Browser also has localStorage in the global context.
+				return localStorage;
+			} catch (error) {
+				// Swallow
+				// XXX (@Qix-) should we be logging these?
+			}
+		}
+
+		module.exports = requireCommon()(exports);
+
+		const {formatters} = module.exports;
+
+		/**
+		 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
+		 */
+
+		formatters.j = function (v) {
+			try {
+				return JSON.stringify(v);
+			} catch (error) {
+				return '[UnexpectedJSONParseError]: ' + error.message;
+			}
+		}; 
+	} (browser$3, browser$3.exports));
+	return browser$3.exports;
+}
+
+var node$1 = {exports: {}};
+
+/**
+ * Module dependencies.
+ */
+
+var hasRequiredNode$1;
+
+function requireNode$1 () {
+	if (hasRequiredNode$1) return node$1.exports;
+	hasRequiredNode$1 = 1;
+	(function (module, exports) {
+		const tty = require$$0$3;
+		const util = require$$0$5;
+
+		/**
+		 * This is the Node.js implementation of `debug()`.
+		 */
+
+		exports.init = init;
+		exports.log = log;
+		exports.formatArgs = formatArgs;
+		exports.save = save;
+		exports.load = load;
+		exports.useColors = useColors;
+		exports.destroy = util.deprecate(
+			() => {},
+			'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
+		);
+
+		/**
+		 * Colors.
+		 */
+
+		exports.colors = [6, 2, 3, 4, 5, 1];
+
+		try {
+			// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
+			// eslint-disable-next-line import/no-extraneous-dependencies
+			const supportsColor = require('supports-color');
+
+			if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
+				exports.colors = [
+					20,
+					21,
+					26,
+					27,
+					32,
+					33,
+					38,
+					39,
+					40,
+					41,
+					42,
+					43,
+					44,
+					45,
+					56,
+					57,
+					62,
+					63,
+					68,
+					69,
+					74,
+					75,
+					76,
+					77,
+					78,
+					79,
+					80,
+					81,
+					92,
+					93,
+					98,
+					99,
+					112,
+					113,
+					128,
+					129,
+					134,
+					135,
+					148,
+					149,
+					160,
+					161,
+					162,
+					163,
+					164,
+					165,
+					166,
+					167,
+					168,
+					169,
+					170,
+					171,
+					172,
+					173,
+					178,
+					179,
+					184,
+					185,
+					196,
+					197,
+					198,
+					199,
+					200,
+					201,
+					202,
+					203,
+					204,
+					205,
+					206,
+					207,
+					208,
+					209,
+					214,
+					215,
+					220,
+					221
+				];
+			}
+		} catch (error) {
+			// Swallow - we only care if `supports-color` is available; it doesn't have to be.
+		}
+
+		/**
+		 * Build up the default `inspectOpts` object from the environment variables.
+		 *
+		 *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
+		 */
+
+		exports.inspectOpts = Object.keys(process.env).filter(key => {
+			return /^debug_/i.test(key);
+		}).reduce((obj, key) => {
+			// Camel-case
+			const prop = key
+				.substring(6)
+				.toLowerCase()
+				.replace(/_([a-z])/g, (_, k) => {
+					return k.toUpperCase();
+				});
+
+			// Coerce string value into JS value
+			let val = process.env[key];
+			if (/^(yes|on|true|enabled)$/i.test(val)) {
+				val = true;
+			} else if (/^(no|off|false|disabled)$/i.test(val)) {
+				val = false;
+			} else if (val === 'null') {
+				val = null;
+			} else {
+				val = Number(val);
+			}
+
+			obj[prop] = val;
+			return obj;
+		}, {});
+
+		/**
+		 * Is stdout a TTY? Colored output is enabled when `true`.
+		 */
+
+		function useColors() {
+			return 'colors' in exports.inspectOpts ?
+				Boolean(exports.inspectOpts.colors) :
+				tty.isatty(process.stderr.fd);
+		}
+
+		/**
+		 * Adds ANSI color escape codes if enabled.
+		 *
+		 * @api public
+		 */
+
+		function formatArgs(args) {
+			const {namespace: name, useColors} = this;
+
+			if (useColors) {
+				const c = this.color;
+				const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
+				const prefix = `  ${colorCode};1m${name} \u001B[0m`;
+
+				args[0] = prefix + args[0].split('\n').join('\n' + prefix);
+				args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
+			} else {
+				args[0] = getDate() + name + ' ' + args[0];
+			}
+		}
+
+		function getDate() {
+			if (exports.inspectOpts.hideDate) {
+				return '';
+			}
+			return new Date().toISOString() + ' ';
+		}
+
+		/**
+		 * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
+		 */
+
+		function log(...args) {
+			return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
+		}
+
+		/**
+		 * Save `namespaces`.
+		 *
+		 * @param {String} namespaces
+		 * @api private
+		 */
+		function save(namespaces) {
+			if (namespaces) {
+				process.env.DEBUG = namespaces;
+			} else {
+				// If you set a process.env field to null or undefined, it gets cast to the
+				// string 'null' or 'undefined'. Just delete instead.
+				delete process.env.DEBUG;
+			}
+		}
+
+		/**
+		 * Load `namespaces`.
+		 *
+		 * @return {String} returns the previously persisted debug modes
+		 * @api private
+		 */
+
+		function load() {
+			return process.env.DEBUG;
+		}
+
+		/**
+		 * Init logic for `debug` instances.
+		 *
+		 * Create a new `inspectOpts` object in case `useColors` is set
+		 * differently for a particular `debug` instance.
+		 */
+
+		function init(debug) {
+			debug.inspectOpts = {};
+
+			const keys = Object.keys(exports.inspectOpts);
+			for (let i = 0; i < keys.length; i++) {
+				debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
+			}
+		}
+
+		module.exports = requireCommon()(exports);
+
+		const {formatters} = module.exports;
+
+		/**
+		 * Map %o to `util.inspect()`, all on a single line.
+		 */
+
+		formatters.o = function (v) {
+			this.inspectOpts.colors = this.useColors;
+			return util.inspect(v, this.inspectOpts)
+				.split('\n')
+				.map(str => str.trim())
+				.join(' ');
+		};
+
+		/**
+		 * Map %O to `util.inspect()`, allowing multiple lines if needed.
+		 */
+
+		formatters.O = function (v) {
+			this.inspectOpts.colors = this.useColors;
+			return util.inspect(v, this.inspectOpts);
+		}; 
+	} (node$1, node$1.exports));
+	return node$1.exports;
+}
+
+/**
+ * Detect Electron renderer / nwjs process, which is node, but we should
+ * treat as a browser.
+ */
+
+if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
+	src$3.exports = requireBrowser$1();
+} else {
+	src$3.exports = requireNode$1();
+}
+
+var srcExports$1 = src$3.exports;
+var debug$i = /*@__PURE__*/getDefaultExportFromCjs(srcExports$1);
+
+let pnp;
+if (process.versions.pnp) {
+  try {
+    pnp = createRequire$1(import.meta.url)("pnpapi");
+  } catch {
+  }
+}
+function invalidatePackageData(packageCache, pkgPath) {
+  const pkgDir = normalizePath$3(path$n.dirname(pkgPath));
+  packageCache.forEach((pkg, cacheKey) => {
+    if (pkg.dir === pkgDir) {
+      packageCache.delete(cacheKey);
+    }
+  });
+}
+function resolvePackageData(pkgName, basedir, preserveSymlinks = false, packageCache) {
+  if (pnp) {
+    const cacheKey = getRpdCacheKey(pkgName, basedir, preserveSymlinks);
+    if (packageCache?.has(cacheKey)) return packageCache.get(cacheKey);
+    try {
+      const pkg = pnp.resolveToUnqualified(pkgName, basedir, {
+        considerBuiltins: false
+      });
+      if (!pkg) return null;
+      const pkgData = loadPackageData(path$n.join(pkg, "package.json"));
+      packageCache?.set(cacheKey, pkgData);
+      return pkgData;
+    } catch {
+      return null;
+    }
+  }
+  const originalBasedir = basedir;
+  while (basedir) {
+    if (packageCache) {
+      const cached = getRpdCache(
+        packageCache,
+        pkgName,
+        basedir,
+        originalBasedir,
+        preserveSymlinks
+      );
+      if (cached) return cached;
+    }
+    const pkg = path$n.join(basedir, "node_modules", pkgName, "package.json");
+    try {
+      if (fs__default.existsSync(pkg)) {
+        const pkgPath = preserveSymlinks ? pkg : safeRealpathSync(pkg);
+        const pkgData = loadPackageData(pkgPath);
+        if (packageCache) {
+          setRpdCache(
+            packageCache,
+            pkgData,
+            pkgName,
+            basedir,
+            originalBasedir,
+            preserveSymlinks
+          );
+        }
+        return pkgData;
+      }
+    } catch {
+    }
+    const nextBasedir = path$n.dirname(basedir);
+    if (nextBasedir === basedir) break;
+    basedir = nextBasedir;
+  }
+  return null;
+}
+function findNearestPackageData(basedir, packageCache) {
+  const originalBasedir = basedir;
+  while (basedir) {
+    if (packageCache) {
+      const cached = getFnpdCache(packageCache, basedir, originalBasedir);
+      if (cached) return cached;
+    }
+    const pkgPath = path$n.join(basedir, "package.json");
+    if (tryStatSync(pkgPath)?.isFile()) {
+      try {
+        const pkgData = loadPackageData(pkgPath);
+        if (packageCache) {
+          setFnpdCache(packageCache, pkgData, basedir, originalBasedir);
+        }
+        return pkgData;
+      } catch {
+      }
+    }
+    const nextBasedir = path$n.dirname(basedir);
+    if (nextBasedir === basedir) break;
+    basedir = nextBasedir;
+  }
+  return null;
+}
+function findNearestMainPackageData(basedir, packageCache) {
+  const nearestPackage = findNearestPackageData(basedir, packageCache);
+  return nearestPackage && (nearestPackage.data.name ? nearestPackage : findNearestMainPackageData(
+    path$n.dirname(nearestPackage.dir),
+    packageCache
+  ));
+}
+function loadPackageData(pkgPath) {
+  const data = JSON.parse(fs__default.readFileSync(pkgPath, "utf-8"));
+  const pkgDir = normalizePath$3(path$n.dirname(pkgPath));
+  const { sideEffects } = data;
+  let hasSideEffects;
+  if (typeof sideEffects === "boolean") {
+    hasSideEffects = () => sideEffects;
+  } else if (Array.isArray(sideEffects)) {
+    if (sideEffects.length <= 0) {
+      hasSideEffects = () => false;
+    } else {
+      const finalPackageSideEffects = sideEffects.map((sideEffect) => {
+        if (sideEffect.includes("/")) {
+          return sideEffect;
+        }
+        return `**/${sideEffect}`;
+      });
+      hasSideEffects = createFilter(finalPackageSideEffects, null, {
+        resolve: pkgDir
+      });
+    }
+  } else {
+    hasSideEffects = () => null;
+  }
+  const pkg = {
+    dir: pkgDir,
+    data,
+    hasSideEffects,
+    webResolvedImports: {},
+    nodeResolvedImports: {},
+    setResolvedCache(key, entry, targetWeb) {
+      if (targetWeb) {
+        pkg.webResolvedImports[key] = entry;
+      } else {
+        pkg.nodeResolvedImports[key] = entry;
+      }
+    },
+    getResolvedCache(key, targetWeb) {
+      if (targetWeb) {
+        return pkg.webResolvedImports[key];
+      } else {
+        return pkg.nodeResolvedImports[key];
+      }
+    }
+  };
+  return pkg;
+}
+function watchPackageDataPlugin(packageCache) {
+  const watchQueue = /* @__PURE__ */ new Set();
+  const watchedDirs = /* @__PURE__ */ new Set();
+  const watchFileStub = (id) => {
+    watchQueue.add(id);
+  };
+  let watchFile = watchFileStub;
+  const setPackageData = packageCache.set.bind(packageCache);
+  packageCache.set = (id, pkg) => {
+    if (!isInNodeModules$1(pkg.dir) && !watchedDirs.has(pkg.dir)) {
+      watchedDirs.add(pkg.dir);
+      watchFile(path$n.join(pkg.dir, "package.json"));
+    }
+    return setPackageData(id, pkg);
+  };
+  return {
+    name: "vite:watch-package-data",
+    buildStart() {
+      watchFile = this.addWatchFile.bind(this);
+      watchQueue.forEach(watchFile);
+      watchQueue.clear();
+    },
+    buildEnd() {
+      watchFile = watchFileStub;
+    },
+    watchChange(id) {
+      if (id.endsWith("/package.json")) {
+        invalidatePackageData(packageCache, path$n.normalize(id));
+      }
+    }
+  };
+}
+function getRpdCache(packageCache, pkgName, basedir, originalBasedir, preserveSymlinks) {
+  const cacheKey = getRpdCacheKey(pkgName, basedir, preserveSymlinks);
+  const pkgData = packageCache.get(cacheKey);
+  if (pkgData) {
+    traverseBetweenDirs(originalBasedir, basedir, (dir) => {
+      packageCache.set(getRpdCacheKey(pkgName, dir, preserveSymlinks), pkgData);
+    });
+    return pkgData;
+  }
+}
+function setRpdCache(packageCache, pkgData, pkgName, basedir, originalBasedir, preserveSymlinks) {
+  packageCache.set(getRpdCacheKey(pkgName, basedir, preserveSymlinks), pkgData);
+  traverseBetweenDirs(originalBasedir, basedir, (dir) => {
+    packageCache.set(getRpdCacheKey(pkgName, dir, preserveSymlinks), pkgData);
+  });
+}
+function getRpdCacheKey(pkgName, basedir, preserveSymlinks) {
+  return `rpd_${pkgName}_${basedir}_${preserveSymlinks}`;
+}
+function getFnpdCache(packageCache, basedir, originalBasedir) {
+  const cacheKey = getFnpdCacheKey(basedir);
+  const pkgData = packageCache.get(cacheKey);
+  if (pkgData) {
+    traverseBetweenDirs(originalBasedir, basedir, (dir) => {
+      packageCache.set(getFnpdCacheKey(dir), pkgData);
+    });
+    return pkgData;
+  }
+}
+function setFnpdCache(packageCache, pkgData, basedir, originalBasedir) {
+  packageCache.set(getFnpdCacheKey(basedir), pkgData);
+  traverseBetweenDirs(originalBasedir, basedir, (dir) => {
+    packageCache.set(getFnpdCacheKey(dir), pkgData);
+  });
+}
+function getFnpdCacheKey(basedir) {
+  return `fnpd_${basedir}`;
+}
+function traverseBetweenDirs(longerDir, shorterDir, cb) {
+  while (longerDir !== shorterDir) {
+    cb(longerDir);
+    longerDir = path$n.dirname(longerDir);
+  }
+}
+
+const createFilter = createFilter$1;
+const replaceSlashOrColonRE = /[/:]/g;
+const replaceDotRE = /\./g;
+const replaceNestedIdRE = /\s*>\s*/g;
+const replaceHashRE = /#/g;
+const flattenId = (id) => {
+  const flatId = limitFlattenIdLength(
+    id.replace(replaceSlashOrColonRE, "_").replace(replaceDotRE, "__").replace(replaceNestedIdRE, "___").replace(replaceHashRE, "____")
+  );
+  return flatId;
+};
+const FLATTEN_ID_HASH_LENGTH = 8;
+const FLATTEN_ID_MAX_FILE_LENGTH = 170;
+const limitFlattenIdLength = (id, limit = FLATTEN_ID_MAX_FILE_LENGTH) => {
+  if (id.length <= limit) {
+    return id;
+  }
+  return id.slice(0, limit - (FLATTEN_ID_HASH_LENGTH + 1)) + "_" + getHash(id);
+};
+const normalizeId = (id) => id.replace(replaceNestedIdRE, " > ");
+const NODE_BUILTIN_NAMESPACE = "node:";
+const NPM_BUILTIN_NAMESPACE = "npm:";
+const BUN_BUILTIN_NAMESPACE = "bun:";
+const nodeBuiltins = builtinModules.filter((id) => !id.includes(":"));
+function isBuiltin(id) {
+  if (process.versions.deno && id.startsWith(NPM_BUILTIN_NAMESPACE)) return true;
+  if (process.versions.bun && id.startsWith(BUN_BUILTIN_NAMESPACE)) return true;
+  return isNodeBuiltin(id);
+}
+function isNodeBuiltin(id) {
+  if (id.startsWith(NODE_BUILTIN_NAMESPACE)) return true;
+  return nodeBuiltins.includes(id);
+}
+function isInNodeModules$1(id) {
+  return id.includes("node_modules");
+}
+function moduleListContains(moduleList, id) {
+  return moduleList?.some(
+    (m) => m === id || id.startsWith(withTrailingSlash(m))
+  );
+}
+function isOptimizable(id, optimizeDeps) {
+  const { extensions } = optimizeDeps;
+  return OPTIMIZABLE_ENTRY_RE.test(id) || (extensions?.some((ext) => id.endsWith(ext)) ?? false);
+}
+const bareImportRE = /^(?![a-zA-Z]:)[\w@](?!.*:\/\/)/;
+const deepImportRE = /^([^@][^/]*)\/|^(@[^/]+\/[^/]+)\//;
+const _require$1 = createRequire$1(import.meta.url);
+function resolveDependencyVersion(dep, pkgRelativePath = "../../package.json") {
+  const pkgPath = path$n.resolve(_require$1.resolve(dep), pkgRelativePath);
+  return JSON.parse(fs__default.readFileSync(pkgPath, "utf-8")).version;
+}
+const rollupVersion = resolveDependencyVersion("rollup");
+const filter = process.env.VITE_DEBUG_FILTER;
+const DEBUG = process.env.DEBUG;
+function createDebugger(namespace, options = {}) {
+  const log = debug$i(namespace);
+  const { onlyWhenFocused } = options;
+  let enabled = log.enabled;
+  if (enabled && onlyWhenFocused) {
+    const ns = typeof onlyWhenFocused === "string" ? onlyWhenFocused : namespace;
+    enabled = !!DEBUG?.includes(ns);
+  }
+  if (enabled) {
+    return (...args) => {
+      if (!filter || args.some((a) => a?.includes?.(filter))) {
+        log(...args);
+      }
+    };
+  }
+}
+function testCaseInsensitiveFS() {
+  if (!CLIENT_ENTRY.endsWith("client.mjs")) {
+    throw new Error(
+      `cannot test case insensitive FS, CLIENT_ENTRY const doesn't contain client.mjs`
+    );
+  }
+  if (!fs__default.existsSync(CLIENT_ENTRY)) {
+    throw new Error(
+      "cannot test case insensitive FS, CLIENT_ENTRY does not point to an existing file: " + CLIENT_ENTRY
+    );
+  }
+  return fs__default.existsSync(CLIENT_ENTRY.replace("client.mjs", "cLiEnT.mjs"));
+}
+const urlCanParse = (
+  // eslint-disable-next-line n/no-unsupported-features/node-builtins
+  URL$3.canParse ?? // URL.canParse is supported from Node.js 18.17.0+, 20.0.0+
+  ((path2, base) => {
+    try {
+      new URL$3(path2, base);
+      return true;
+    } catch {
+      return false;
+    }
+  })
+);
+const isCaseInsensitiveFS = testCaseInsensitiveFS();
+const VOLUME_RE = /^[A-Z]:/i;
+function normalizePath$3(id) {
+  return path$n.posix.normalize(isWindows$3 ? slash$1(id) : id);
+}
+function fsPathFromId(id) {
+  const fsPath = normalizePath$3(
+    id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id
+  );
+  return fsPath[0] === "/" || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`;
+}
+function fsPathFromUrl(url) {
+  return fsPathFromId(cleanUrl(url));
+}
+function isParentDirectory(dir, file) {
+  dir = withTrailingSlash(dir);
+  return file.startsWith(dir) || isCaseInsensitiveFS && file.toLowerCase().startsWith(dir.toLowerCase());
+}
+function isSameFileUri(file1, file2) {
+  return file1 === file2 || isCaseInsensitiveFS && file1.toLowerCase() === file2.toLowerCase();
+}
+const externalRE = /^(https?:)?\/\//;
+const isExternalUrl = (url) => externalRE.test(url);
+const dataUrlRE = /^\s*data:/i;
+const isDataUrl = (url) => dataUrlRE.test(url);
+const virtualModuleRE = /^virtual-module:.*/;
+const virtualModulePrefix = "virtual-module:";
+const knownJsSrcRE = /\.(?:[jt]sx?|m[jt]s|vue|marko|svelte|astro|imba|mdx)(?:$|\?)/;
+const isJSRequest = (url) => {
+  url = cleanUrl(url);
+  if (knownJsSrcRE.test(url)) {
+    return true;
+  }
+  if (!path$n.extname(url) && url[url.length - 1] !== "/") {
+    return true;
+  }
+  return false;
+};
+const knownTsRE = /\.(?:ts|mts|cts|tsx)(?:$|\?)/;
+const isTsRequest = (url) => knownTsRE.test(url);
+const importQueryRE = /(\?|&)import=?(?:&|$)/;
+const directRequestRE$1 = /(\?|&)direct=?(?:&|$)/;
+const internalPrefixes = [
+  FS_PREFIX,
+  VALID_ID_PREFIX,
+  CLIENT_PUBLIC_PATH,
+  ENV_PUBLIC_PATH
+];
+const InternalPrefixRE = new RegExp(`^(?:${internalPrefixes.join("|")})`);
+const trailingSeparatorRE = /[?&]$/;
+const isImportRequest = (url) => importQueryRE.test(url);
+const isInternalRequest = (url) => InternalPrefixRE.test(url);
+function removeImportQuery(url) {
+  return url.replace(importQueryRE, "$1").replace(trailingSeparatorRE, "");
+}
+function removeDirectQuery(url) {
+  return url.replace(directRequestRE$1, "$1").replace(trailingSeparatorRE, "");
+}
+const urlRE$1 = /(\?|&)url(?:&|$)/;
+const rawRE$1 = /(\?|&)raw(?:&|$)/;
+function removeUrlQuery(url) {
+  return url.replace(urlRE$1, "$1").replace(trailingSeparatorRE, "");
+}
+const replacePercentageRE = /%/g;
+function injectQuery(url, queryToInject) {
+  const resolvedUrl = new URL$3(
+    url.replace(replacePercentageRE, "%25"),
+    "relative:///"
+  );
+  const { search, hash } = resolvedUrl;
+  let pathname = cleanUrl(url);
+  pathname = isWindows$3 ? slash$1(pathname) : pathname;
+  return `${pathname}?${queryToInject}${search ? `&` + search.slice(1) : ""}${hash ?? ""}`;
+}
+const timestampRE = /\bt=\d{13}&?\b/;
+function removeTimestampQuery(url) {
+  return url.replace(timestampRE, "").replace(trailingSeparatorRE, "");
+}
+async function asyncReplace(input, re, replacer) {
+  let match;
+  let remaining = input;
+  let rewritten = "";
+  while (match = re.exec(remaining)) {
+    rewritten += remaining.slice(0, match.index);
+    rewritten += await replacer(match);
+    remaining = remaining.slice(match.index + match[0].length);
+  }
+  rewritten += remaining;
+  return rewritten;
+}
+function timeFrom(start, subtract = 0) {
+  const time = performance$1.now() - start - subtract;
+  const timeString = (time.toFixed(2) + `ms`).padEnd(5, " ");
+  if (time < 10) {
+    return colors$1.green(timeString);
+  } else if (time < 50) {
+    return colors$1.yellow(timeString);
+  } else {
+    return colors$1.red(timeString);
+  }
+}
+function prettifyUrl(url, root) {
+  url = removeTimestampQuery(url);
+  const isAbsoluteFile = url.startsWith(root);
+  if (isAbsoluteFile || url.startsWith(FS_PREFIX)) {
+    const file = path$n.posix.relative(
+      root,
+      isAbsoluteFile ? url : fsPathFromId(url)
+    );
+    return colors$1.dim(file);
+  } else {
+    return colors$1.dim(url);
+  }
+}
+function isObject$1(value) {
+  return Object.prototype.toString.call(value) === "[object Object]";
+}
+function isDefined(value) {
+  return value != null;
+}
+function tryStatSync(file) {
+  try {
+    return fs__default.statSync(file, { throwIfNoEntry: false });
+  } catch {
+  }
+}
+function lookupFile(dir, fileNames) {
+  while (dir) {
+    for (const fileName of fileNames) {
+      const fullPath = path$n.join(dir, fileName);
+      if (tryStatSync(fullPath)?.isFile()) return fullPath;
+    }
+    const parentDir = path$n.dirname(dir);
+    if (parentDir === dir) return;
+    dir = parentDir;
+  }
+}
+function isFilePathESM(filePath, packageCache) {
+  if (/\.m[jt]s$/.test(filePath)) {
+    return true;
+  } else if (/\.c[jt]s$/.test(filePath)) {
+    return false;
+  } else {
+    try {
+      const pkg = findNearestPackageData(path$n.dirname(filePath), packageCache);
+      return pkg?.data.type === "module";
+    } catch {
+      return false;
+    }
+  }
+}
+const splitRE = /\r?\n/g;
+const range = 2;
+function pad$1(source, n = 2) {
+  const lines = source.split(splitRE);
+  return lines.map((l) => ` `.repeat(n) + l).join(`
+`);
+}
+function posToNumber(source, pos) {
+  if (typeof pos === "number") return pos;
+  const lines = source.split(splitRE);
+  const { line, column } = pos;
+  let start = 0;
+  for (let i = 0; i < line - 1 && i < lines.length; i++) {
+    start += lines[i].length + 1;
+  }
+  return start + column;
+}
+function numberToPos(source, offset) {
+  if (typeof offset !== "number") return offset;
+  if (offset > source.length) {
+    throw new Error(
+      `offset is longer than source length! offset ${offset} > length ${source.length}`
+    );
+  }
+  const lines = source.split(splitRE);
+  let counted = 0;
+  let line = 0;
+  let column = 0;
+  for (; line < lines.length; line++) {
+    const lineLength = lines[line].length + 1;
+    if (counted + lineLength >= offset) {
+      column = offset - counted + 1;
+      break;
+    }
+    counted += lineLength;
+  }
+  return { line: line + 1, column };
+}
+function generateCodeFrame(source, start = 0, end) {
+  start = Math.max(posToNumber(source, start), 0);
+  end = Math.min(
+    end !== void 0 ? posToNumber(source, end) : start,
+    source.length
+  );
+  const lines = source.split(splitRE);
+  let count = 0;
+  const res = [];
+  for (let i = 0; i < lines.length; i++) {
+    count += lines[i].length;
+    if (count >= start) {
+      for (let j = i - range; j <= i + range || end > count; j++) {
+        if (j < 0 || j >= lines.length) continue;
+        const line = j + 1;
+        res.push(
+          `${line}${" ".repeat(Math.max(3 - String(line).length, 0))}|  ${lines[j]}`
+        );
+        const lineLength = lines[j].length;
+        if (j === i) {
+          const pad2 = Math.max(start - (count - lineLength), 0);
+          const length = Math.max(
+            1,
+            end > count ? lineLength - pad2 : end - start
+          );
+          res.push(`   |  ` + " ".repeat(pad2) + "^".repeat(length));
+        } else if (j > i) {
+          if (end > count) {
+            const length = Math.max(Math.min(end - count, lineLength), 1);
+            res.push(`   |  ` + "^".repeat(length));
+          }
+          count += lineLength + 1;
+        }
+      }
+      break;
+    }
+    count++;
+  }
+  return res.join("\n");
+}
+function isFileReadable(filename) {
+  if (!tryStatSync(filename)) {
+    return false;
+  }
+  try {
+    fs__default.accessSync(filename, fs__default.constants.R_OK);
+    return true;
+  } catch {
+    return false;
+  }
+}
+const splitFirstDirRE = /(.+?)[\\/](.+)/;
+function emptyDir(dir, skip) {
+  const skipInDir = [];
+  let nested = null;
+  if (skip?.length) {
+    for (const file of skip) {
+      if (path$n.dirname(file) !== ".") {
+        const matched = splitFirstDirRE.exec(file);
+        if (matched) {
+          nested ??= /* @__PURE__ */ new Map();
+          const [, nestedDir, skipPath] = matched;
+          let nestedSkip = nested.get(nestedDir);
+          if (!nestedSkip) {
+            nestedSkip = [];
+            nested.set(nestedDir, nestedSkip);
+          }
+          if (!nestedSkip.includes(skipPath)) {
+            nestedSkip.push(skipPath);
+          }
+        }
+      } else {
+        skipInDir.push(file);
+      }
+    }
+  }
+  for (const file of fs__default.readdirSync(dir)) {
+    if (skipInDir.includes(file)) {
+      continue;
+    }
+    if (nested?.has(file)) {
+      emptyDir(path$n.resolve(dir, file), nested.get(file));
+    } else {
+      fs__default.rmSync(path$n.resolve(dir, file), { recursive: true, force: true });
+    }
+  }
+}
+function copyDir(srcDir, destDir) {
+  fs__default.mkdirSync(destDir, { recursive: true });
+  for (const file of fs__default.readdirSync(srcDir)) {
+    const srcFile = path$n.resolve(srcDir, file);
+    if (srcFile === destDir) {
+      continue;
+    }
+    const destFile = path$n.resolve(destDir, file);
+    const stat = fs__default.statSync(srcFile);
+    if (stat.isDirectory()) {
+      copyDir(srcFile, destFile);
+    } else {
+      fs__default.copyFileSync(srcFile, destFile);
+    }
+  }
+}
+const ERR_SYMLINK_IN_RECURSIVE_READDIR = "ERR_SYMLINK_IN_RECURSIVE_READDIR";
+async function recursiveReaddir(dir) {
+  if (!fs__default.existsSync(dir)) {
+    return [];
+  }
+  let dirents;
+  try {
+    dirents = await fsp.readdir(dir, { withFileTypes: true });
+  } catch (e) {
+    if (e.code === "EACCES") {
+      return [];
+    }
+    throw e;
+  }
+  if (dirents.some((dirent) => dirent.isSymbolicLink())) {
+    const err = new Error(
+      "Symbolic links are not supported in recursiveReaddir"
+    );
+    err.code = ERR_SYMLINK_IN_RECURSIVE_READDIR;
+    throw err;
+  }
+  const files = await Promise.all(
+    dirents.map((dirent) => {
+      const res = path$n.resolve(dir, dirent.name);
+      return dirent.isDirectory() ? recursiveReaddir(res) : normalizePath$3(res);
+    })
+  );
+  return files.flat(1);
+}
+let safeRealpathSync = isWindows$3 ? windowsSafeRealPathSync : fs__default.realpathSync.native;
+const windowsNetworkMap = /* @__PURE__ */ new Map();
+function windowsMappedRealpathSync(path2) {
+  const realPath = fs__default.realpathSync.native(path2);
+  if (realPath.startsWith("\\\\")) {
+    for (const [network, volume] of windowsNetworkMap) {
+      if (realPath.startsWith(network)) return realPath.replace(network, volume);
+    }
+  }
+  return realPath;
+}
+const parseNetUseRE = /^\w* +(\w:) +([^ ]+)\s/;
+let firstSafeRealPathSyncRun = false;
+function windowsSafeRealPathSync(path2) {
+  if (!firstSafeRealPathSyncRun) {
+    optimizeSafeRealPathSync();
+    firstSafeRealPathSyncRun = true;
+  }
+  return fs__default.realpathSync(path2);
+}
+function optimizeSafeRealPathSync() {
+  const nodeVersion = process.versions.node.split(".").map(Number);
+  if (nodeVersion[0] < 18 || nodeVersion[0] === 18 && nodeVersion[1] < 10) {
+    safeRealpathSync = fs__default.realpathSync;
+    return;
+  }
+  try {
+    fs__default.realpathSync.native(path$n.resolve("./"));
+  } catch (error) {
+    if (error.message.includes("EISDIR: illegal operation on a directory")) {
+      safeRealpathSync = fs__default.realpathSync;
+      return;
+    }
+  }
+  exec("net use", (error, stdout) => {
+    if (error) return;
+    const lines = stdout.split("\n");
+    for (const line of lines) {
+      const m = parseNetUseRE.exec(line);
+      if (m) windowsNetworkMap.set(m[2], m[1]);
+    }
+    if (windowsNetworkMap.size === 0) {
+      safeRealpathSync = fs__default.realpathSync.native;
+    } else {
+      safeRealpathSync = windowsMappedRealpathSync;
+    }
+  });
+}
+function ensureWatchedFile(watcher, file, root) {
+  if (file && // only need to watch if out of root
+  !file.startsWith(withTrailingSlash(root)) && // some rollup plugins use null bytes for private resolved Ids
+  !file.includes("\0") && fs__default.existsSync(file)) {
+    watcher.add(path$n.resolve(file));
+  }
+}
+const escapedSpaceCharacters = /(?: |\\t|\\n|\\f|\\r)+/g;
+const imageSetUrlRE = /^(?:[\w\-]+\(.*?\)|'.*?'|".*?"|\S*)/;
+function joinSrcset(ret) {
+  return ret.map(({ url, descriptor }) => url + (descriptor ? ` ${descriptor}` : "")).join(", ");
+}
+function splitSrcSetDescriptor(srcs) {
+  return splitSrcSet(srcs).map((s) => {
+    const src = s.replace(escapedSpaceCharacters, " ").trim();
+    const url = imageSetUrlRE.exec(src)?.[0] ?? "";
+    return {
+      url,
+      descriptor: src.slice(url.length).trim()
+    };
+  }).filter(({ url }) => !!url);
+}
+function processSrcSet(srcs, replacer) {
+  return Promise.all(
+    splitSrcSetDescriptor(srcs).map(async ({ url, descriptor }) => ({
+      url: await replacer({ url, descriptor }),
+      descriptor
+    }))
+  ).then(joinSrcset);
+}
+function processSrcSetSync(srcs, replacer) {
+  return joinSrcset(
+    splitSrcSetDescriptor(srcs).map(({ url, descriptor }) => ({
+      url: replacer({ url, descriptor }),
+      descriptor
+    }))
+  );
+}
+const cleanSrcSetRE = /(?:url|image|gradient|cross-fade)\([^)]*\)|"([^"]|(?<=\\)")*"|'([^']|(?<=\\)')*'|data:\w+\/[\w.+\-]+;base64,[\w+/=]+|\?\S+,/g;
+function splitSrcSet(srcs) {
+  const parts = [];
+  const cleanedSrcs = srcs.replace(cleanSrcSetRE, blankReplacer);
+  let startIndex = 0;
+  let splitIndex;
+  do {
+    splitIndex = cleanedSrcs.indexOf(",", startIndex);
+    parts.push(
+      srcs.slice(startIndex, splitIndex !== -1 ? splitIndex : void 0)
+    );
+    startIndex = splitIndex + 1;
+  } while (splitIndex !== -1);
+  return parts;
+}
+const windowsDriveRE = /^[A-Z]:/;
+const replaceWindowsDriveRE = /^([A-Z]):\//;
+const linuxAbsolutePathRE = /^\/[^/]/;
+function escapeToLinuxLikePath(path2) {
+  if (windowsDriveRE.test(path2)) {
+    return path2.replace(replaceWindowsDriveRE, "/windows/$1/");
+  }
+  if (linuxAbsolutePathRE.test(path2)) {
+    return `/linux${path2}`;
+  }
+  return path2;
+}
+const revertWindowsDriveRE = /^\/windows\/([A-Z])\//;
+function unescapeToLinuxLikePath(path2) {
+  if (path2.startsWith("/linux/")) {
+    return path2.slice("/linux".length);
+  }
+  if (path2.startsWith("/windows/")) {
+    return path2.replace(revertWindowsDriveRE, "$1:/");
+  }
+  return path2;
+}
+const nullSourceMap = {
+  names: [],
+  sources: [],
+  mappings: "",
+  version: 3
+};
+function combineSourcemaps(filename, sourcemapList) {
+  if (sourcemapList.length === 0 || sourcemapList.every((m) => m.sources.length === 0)) {
+    return { ...nullSourceMap };
+  }
+  sourcemapList = sourcemapList.map((sourcemap) => {
+    const newSourcemaps = { ...sourcemap };
+    newSourcemaps.sources = sourcemap.sources.map(
+      (source) => source ? escapeToLinuxLikePath(source) : null
+    );
+    if (sourcemap.sourceRoot) {
+      newSourcemaps.sourceRoot = escapeToLinuxLikePath(sourcemap.sourceRoot);
+    }
+    return newSourcemaps;
+  });
+  let map;
+  let mapIndex = 1;
+  const useArrayInterface = sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === void 0;
+  if (useArrayInterface) {
+    map = remapping(sourcemapList, () => null);
+  } else {
+    map = remapping(sourcemapList[0], function loader(sourcefile) {
+      const mapForSources = sourcemapList.slice(mapIndex).find((s) => s.sources.includes(sourcefile));
+      if (mapForSources) {
+        mapIndex++;
+        return mapForSources;
+      }
+      return null;
+    });
+  }
+  if (!map.file) {
+    delete map.file;
+  }
+  map.sources = map.sources.map(
+    (source) => source ? unescapeToLinuxLikePath(source) : source
+  );
+  map.file = filename;
+  return map;
+}
+function unique(arr) {
+  return Array.from(new Set(arr));
+}
+async function getLocalhostAddressIfDiffersFromDNS() {
+  const [nodeResult, dnsResult] = await Promise.all([
+    promises.lookup("localhost"),
+    promises.lookup("localhost", { verbatim: true })
+  ]);
+  const isSame = nodeResult.family === dnsResult.family && nodeResult.address === dnsResult.address;
+  return isSame ? void 0 : nodeResult.address;
+}
+function diffDnsOrderChange(oldUrls, newUrls) {
+  return !(oldUrls === newUrls || oldUrls && newUrls && arrayEqual(oldUrls.local, newUrls.local) && arrayEqual(oldUrls.network, newUrls.network));
+}
+async function resolveHostname(optionsHost) {
+  let host;
+  if (optionsHost === void 0 || optionsHost === false) {
+    host = "localhost";
+  } else if (optionsHost === true) {
+    host = void 0;
+  } else {
+    host = optionsHost;
+  }
+  let name = host === void 0 || wildcardHosts.has(host) ? "localhost" : host;
+  if (host === "localhost") {
+    const localhostAddr = await getLocalhostAddressIfDiffersFromDNS();
+    if (localhostAddr) {
+      name = localhostAddr;
+    }
+  }
+  return { host, name };
+}
+async function resolveServerUrls(server, options, config) {
+  const address = server.address();
+  const isAddressInfo = (x) => x?.address;
+  if (!isAddressInfo(address)) {
+    return { local: [], network: [] };
+  }
+  const local = [];
+  const network = [];
+  const hostname = await resolveHostname(options.host);
+  const protocol = options.https ? "https" : "http";
+  const port = address.port;
+  const base = config.rawBase === "./" || config.rawBase === "" ? "/" : config.rawBase;
+  if (hostname.host !== void 0 && !wildcardHosts.has(hostname.host)) {
+    let hostnameName = hostname.name;
+    if (hostnameName.includes(":")) {
+      hostnameName = `[${hostnameName}]`;
+    }
+    const address2 = `${protocol}://${hostnameName}:${port}${base}`;
+    if (loopbackHosts.has(hostname.host)) {
+      local.push(address2);
+    } else {
+      network.push(address2);
+    }
+  } else {
+    Object.values(os$5.networkInterfaces()).flatMap((nInterface) => nInterface ?? []).filter(
+      (detail) => detail && detail.address && (detail.family === "IPv4" || // @ts-expect-error Node 18.0 - 18.3 returns number
+      detail.family === 4)
+    ).forEach((detail) => {
+      let host = detail.address.replace("127.0.0.1", hostname.name);
+      if (host.includes(":")) {
+        host = `[${host}]`;
+      }
+      const url = `${protocol}://${host}:${port}${base}`;
+      if (detail.address.includes("127.0.0.1")) {
+        local.push(url);
+      } else {
+        network.push(url);
+      }
+    });
+  }
+  return { local, network };
+}
+function arraify(target) {
+  return Array.isArray(target) ? target : [target];
+}
+const multilineCommentsRE = /\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g;
+const singlelineCommentsRE = /\/\/.*/g;
+const requestQuerySplitRE = /\?(?!.*[/|}])/;
+const requestQueryMaybeEscapedSplitRE = /\\?\?(?!.*[/|}])/;
+const blankReplacer = (match) => " ".repeat(match.length);
+function getHash(text, length = 8) {
+  const h = createHash$2("sha256").update(text).digest("hex").substring(0, length);
+  if (length <= 64) return h;
+  return h.padEnd(length, "_");
+}
+const _dirname = path$n.dirname(fileURLToPath(import.meta.url));
+const requireResolveFromRootWithFallback = (root, id) => {
+  const found = resolvePackageData(id, root) || resolvePackageData(id, _dirname);
+  if (!found) {
+    const error = new Error(`${JSON.stringify(id)} not found.`);
+    error.code = "MODULE_NOT_FOUND";
+    throw error;
+  }
+  return _require$1.resolve(id, { paths: [root, _dirname] });
+};
+function emptyCssComments(raw) {
+  return raw.replace(multilineCommentsRE, blankReplacer);
+}
+function backwardCompatibleWorkerPlugins(plugins) {
+  if (Array.isArray(plugins)) {
+    return plugins;
+  }
+  if (typeof plugins === "function") {
+    return plugins();
+  }
+  return [];
+}
+function mergeConfigRecursively(defaults, overrides, rootPath) {
+  const merged = { ...defaults };
+  for (const key in overrides) {
+    const value = overrides[key];
+    if (value == null) {
+      continue;
+    }
+    const existing = merged[key];
+    if (existing == null) {
+      merged[key] = value;
+      continue;
+    }
+    if (key === "alias" && (rootPath === "resolve" || rootPath === "")) {
+      merged[key] = mergeAlias(existing, value);
+      continue;
+    } else if (key === "assetsInclude" && rootPath === "") {
+      merged[key] = [].concat(existing, value);
+      continue;
+    } else if (key === "noExternal" && rootPath === "ssr" && (existing === true || value === true)) {
+      merged[key] = true;
+      continue;
+    } else if (key === "plugins" && rootPath === "worker") {
+      merged[key] = () => [
+        ...backwardCompatibleWorkerPlugins(existing),
+        ...backwardCompatibleWorkerPlugins(value)
+      ];
+      continue;
+    } else if (key === "server" && rootPath === "server.hmr") {
+      merged[key] = value;
+      continue;
+    }
+    if (Array.isArray(existing) || Array.isArray(value)) {
+      merged[key] = [...arraify(existing), ...arraify(value)];
+      continue;
+    }
+    if (isObject$1(existing) && isObject$1(value)) {
+      merged[key] = mergeConfigRecursively(
+        existing,
+        value,
+        rootPath ? `${rootPath}.${key}` : key
+      );
+      continue;
+    }
+    merged[key] = value;
+  }
+  return merged;
+}
+function mergeConfig(defaults, overrides, isRoot = true) {
+  if (typeof defaults === "function" || typeof overrides === "function") {
+    throw new Error(`Cannot merge config in form of callback`);
+  }
+  return mergeConfigRecursively(defaults, overrides, isRoot ? "" : ".");
+}
+function mergeAlias(a, b) {
+  if (!a) return b;
+  if (!b) return a;
+  if (isObject$1(a) && isObject$1(b)) {
+    return { ...a, ...b };
+  }
+  return [...normalizeAlias(b), ...normalizeAlias(a)];
+}
+function normalizeAlias(o = []) {
+  return Array.isArray(o) ? o.map(normalizeSingleAlias) : Object.keys(o).map(
+    (find) => normalizeSingleAlias({
+      find,
+      replacement: o[find]
+    })
+  );
+}
+function normalizeSingleAlias({
+  find,
+  replacement,
+  customResolver
+}) {
+  if (typeof find === "string" && find[find.length - 1] === "/" && replacement[replacement.length - 1] === "/") {
+    find = find.slice(0, find.length - 1);
+    replacement = replacement.slice(0, replacement.length - 1);
+  }
+  const alias = {
+    find,
+    replacement
+  };
+  if (customResolver) {
+    alias.customResolver = customResolver;
+  }
+  return alias;
+}
+function transformStableResult(s, id, config) {
+  return {
+    code: s.toString(),
+    map: config.command === "build" && config.build.sourcemap ? s.generateMap({ hires: "boundary", source: id }) : null
+  };
+}
+async function asyncFlatten(arr) {
+  do {
+    arr = (await Promise.all(arr)).flat(Infinity);
+  } while (arr.some((v) => v?.then));
+  return arr;
+}
+function stripBomTag(content) {
+  if (content.charCodeAt(0) === 65279) {
+    return content.slice(1);
+  }
+  return content;
+}
+const windowsDrivePathPrefixRE = /^[A-Za-z]:[/\\]/;
+const isNonDriveRelativeAbsolutePath = (p) => {
+  if (!isWindows$3) return p[0] === "/";
+  return windowsDrivePathPrefixRE.test(p);
+};
+function shouldServeFile(filePath, root) {
+  if (!isCaseInsensitiveFS) return true;
+  return hasCorrectCase(filePath, root);
+}
+function hasCorrectCase(file, assets) {
+  if (file === assets) return true;
+  const parent = path$n.dirname(file);
+  if (fs__default.readdirSync(parent).includes(path$n.basename(file))) {
+    return hasCorrectCase(parent, assets);
+  }
+  return false;
+}
+function joinUrlSegments(a, b) {
+  if (!a || !b) {
+    return a || b || "";
+  }
+  if (a[a.length - 1] === "/") {
+    a = a.substring(0, a.length - 1);
+  }
+  if (b[0] !== "/") {
+    b = "/" + b;
+  }
+  return a + b;
+}
+function removeLeadingSlash(str) {
+  return str[0] === "/" ? str.slice(1) : str;
+}
+function stripBase(path2, base) {
+  if (path2 === base) {
+    return "/";
+  }
+  const devBase = withTrailingSlash(base);
+  return path2.startsWith(devBase) ? path2.slice(devBase.length - 1) : path2;
+}
+function arrayEqual(a, b) {
+  if (a === b) return true;
+  if (a.length !== b.length) return false;
+  for (let i = 0; i < a.length; i++) {
+    if (a[i] !== b[i]) return false;
+  }
+  return true;
+}
+function evalValue(rawValue) {
+  const fn = new Function(`
+    var console, exports, global, module, process, require
+    return (
+${rawValue}
+)
+  `);
+  return fn();
+}
+function getNpmPackageName(importPath) {
+  const parts = importPath.split("/");
+  if (parts[0][0] === "@") {
+    if (!parts[1]) return null;
+    return `${parts[0]}/${parts[1]}`;
+  } else {
+    return parts[0];
+  }
+}
+const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
+function escapeRegex(str) {
+  return str.replace(escapeRegexRE, "\\$&");
+}
+function getPackageManagerCommand(type = "install") {
+  const packageManager = process.env.npm_config_user_agent?.split(" ")[0].split("/")[0] || "npm";
+  switch (type) {
+    case "install":
+      return packageManager === "npm" ? "npm install" : `${packageManager} add`;
+    case "uninstall":
+      return packageManager === "npm" ? "npm uninstall" : `${packageManager} remove`;
+    case "update":
+      return packageManager === "yarn" ? "yarn upgrade" : `${packageManager} update`;
+    default:
+      throw new TypeError(`Unknown command type: ${type}`);
+  }
+}
+function isDevServer(server) {
+  return "pluginContainer" in server;
+}
+function promiseWithResolvers() {
+  let resolve;
+  let reject;
+  const promise = new Promise((_resolve, _reject) => {
+    resolve = _resolve;
+    reject = _reject;
+  });
+  return { promise, resolve, reject };
+}
+function createSerialPromiseQueue() {
+  let previousTask;
+  return {
+    async run(f) {
+      const thisTask = f();
+      const depTasks = Promise.all([previousTask, thisTask]);
+      previousTask = depTasks;
+      const [, result] = await depTasks;
+      if (previousTask === depTasks) {
+        previousTask = void 0;
+      }
+      return result;
+    }
+  };
+}
+function sortObjectKeys(obj) {
+  const sorted = {};
+  for (const key of Object.keys(obj).sort()) {
+    sorted[key] = obj[key];
+  }
+  return sorted;
+}
+function displayTime(time) {
+  if (time < 1e3) {
+    return `${time}ms`;
+  }
+  time = time / 1e3;
+  if (time < 60) {
+    return `${time.toFixed(2)}s`;
+  }
+  const mins = parseInt((time / 60).toString());
+  const seconds = time % 60;
+  return `${mins}m${seconds < 1 ? "" : ` ${seconds.toFixed(0)}s`}`;
+}
+function encodeURIPath(uri) {
+  if (uri.startsWith("data:")) return uri;
+  const filePath = cleanUrl(uri);
+  const postfix = filePath !== uri ? uri.slice(filePath.length) : "";
+  return encodeURI(filePath) + postfix;
+}
+function partialEncodeURIPath(uri) {
+  if (uri.startsWith("data:")) return uri;
+  const filePath = cleanUrl(uri);
+  const postfix = filePath !== uri ? uri.slice(filePath.length) : "";
+  return filePath.replaceAll("%", "%25") + postfix;
+}
+const setupSIGTERMListener = (callback) => {
+  process.once("SIGTERM", callback);
+  if (process.env.CI !== "true") {
+    process.stdin.on("end", callback);
+  }
+};
+const teardownSIGTERMListener = (callback) => {
+  process.off("SIGTERM", callback);
+  if (process.env.CI !== "true") {
+    process.stdin.off("end", callback);
+  }
+};
+
+const LogLevels = {
+  silent: 0,
+  error: 1,
+  warn: 2,
+  info: 3
+};
+let lastType;
+let lastMsg;
+let sameCount = 0;
+function clearScreen() {
+  const repeatCount = process.stdout.rows - 2;
+  const blank = repeatCount > 0 ? "\n".repeat(repeatCount) : "";
+  console.log(blank);
+  readline.cursorTo(process.stdout, 0, 0);
+  readline.clearScreenDown(process.stdout);
+}
+let timeFormatter;
+function getTimeFormatter() {
+  timeFormatter ??= new Intl.DateTimeFormat(void 0, {
+    hour: "numeric",
+    minute: "numeric",
+    second: "numeric"
+  });
+  return timeFormatter;
+}
+function createLogger(level = "info", options = {}) {
+  if (options.customLogger) {
+    return options.customLogger;
+  }
+  const loggedErrors = /* @__PURE__ */ new WeakSet();
+  const { prefix = "[vite]", allowClearScreen = true } = options;
+  const thresh = LogLevels[level];
+  const canClearScreen = allowClearScreen && process.stdout.isTTY && !process.env.CI;
+  const clear = canClearScreen ? clearScreen : () => {
+  };
+  function format(type, msg, options2 = {}) {
+    if (options2.timestamp) {
+      let tag = "";
+      if (type === "info") {
+        tag = colors$1.cyan(colors$1.bold(prefix));
+      } else if (type === "warn") {
+        tag = colors$1.yellow(colors$1.bold(prefix));
+      } else {
+        tag = colors$1.red(colors$1.bold(prefix));
+      }
+      return `${colors$1.dim(getTimeFormatter().format(/* @__PURE__ */ new Date()))} ${tag} ${msg}`;
+    } else {
+      return msg;
+    }
+  }
+  function output(type, msg, options2 = {}) {
+    if (thresh >= LogLevels[type]) {
+      const method = type === "info" ? "log" : type;
+      if (options2.error) {
+        loggedErrors.add(options2.error);
+      }
+      if (canClearScreen) {
+        if (type === lastType && msg === lastMsg) {
+          sameCount++;
+          clear();
+          console[method](
+            format(type, msg, options2),
+            colors$1.yellow(`(x${sameCount + 1})`)
+          );
+        } else {
+          sameCount = 0;
+          lastMsg = msg;
+          lastType = type;
+          if (options2.clear) {
+            clear();
+          }
+          console[method](format(type, msg, options2));
+        }
+      } else {
+        console[method](format(type, msg, options2));
+      }
+    }
+  }
+  const warnedMessages = /* @__PURE__ */ new Set();
+  const logger = {
+    hasWarned: false,
+    info(msg, opts) {
+      output("info", msg, opts);
+    },
+    warn(msg, opts) {
+      logger.hasWarned = true;
+      output("warn", msg, opts);
+    },
+    warnOnce(msg, opts) {
+      if (warnedMessages.has(msg)) return;
+      logger.hasWarned = true;
+      output("warn", msg, opts);
+      warnedMessages.add(msg);
+    },
+    error(msg, opts) {
+      logger.hasWarned = true;
+      output("error", msg, opts);
+    },
+    clearScreen(type) {
+      if (thresh >= LogLevels[type]) {
+        clear();
+      }
+    },
+    hasErrorLogged(error) {
+      return loggedErrors.has(error);
+    }
+  };
+  return logger;
+}
+function printServerUrls(urls, optionsHost, info) {
+  const colorUrl = (url) => colors$1.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors$1.bold(port)}/`));
+  for (const url of urls.local) {
+    info(`  ${colors$1.green("\u279C")}  ${colors$1.bold("Local")}:   ${colorUrl(url)}`);
+  }
+  for (const url of urls.network) {
+    info(`  ${colors$1.green("\u279C")}  ${colors$1.bold("Network")}: ${colorUrl(url)}`);
+  }
+  if (urls.network.length === 0 && optionsHost === void 0) {
+    info(
+      colors$1.dim(`  ${colors$1.green("\u279C")}  ${colors$1.bold("Network")}: use `) + colors$1.bold("--host") + colors$1.dim(" to expose")
+    );
+  }
+}
+
+const groups = [
+  { name: "Assets", color: colors$1.green },
+  { name: "CSS", color: colors$1.magenta },
+  { name: "JS", color: colors$1.cyan }
+];
+const COMPRESSIBLE_ASSETS_RE = /\.(?:html|json|svg|txt|xml|xhtml)$/;
+function buildReporterPlugin(config) {
+  const compress = promisify$4(gzip);
+  const chunkLimit = config.build.chunkSizeWarningLimit;
+  const numberFormatter = new Intl.NumberFormat("en", {
+    maximumFractionDigits: 2,
+    minimumFractionDigits: 2
+  });
+  const displaySize = (bytes) => {
+    return `${numberFormatter.format(bytes / 1e3)} kB`;
+  };
+  const tty = process.stdout.isTTY && !process.env.CI;
+  const shouldLogInfo = LogLevels[config.logLevel || "info"] >= LogLevels.info;
+  let hasTransformed = false;
+  let hasRenderedChunk = false;
+  let hasCompressChunk = false;
+  let transformedCount = 0;
+  let chunkCount = 0;
+  let compressedCount = 0;
+  async function getCompressedSize(code) {
+    if (config.build.ssr || !config.build.reportCompressedSize) {
+      return null;
+    }
+    if (shouldLogInfo && !hasCompressChunk) {
+      if (!tty) {
+        config.logger.info("computing gzip size...");
+      } else {
+        writeLine("computing gzip size (0)...");
+      }
+      hasCompressChunk = true;
+    }
+    const compressed = await compress(
+      typeof code === "string" ? code : Buffer.from(code)
+    );
+    compressedCount++;
+    if (shouldLogInfo && tty) {
+      writeLine(`computing gzip size (${compressedCount})...`);
+    }
+    return compressed.length;
+  }
+  const logTransform = throttle((id) => {
+    writeLine(
+      `transforming (${transformedCount}) ${colors$1.dim(
+        path$n.relative(config.root, id)
+      )}`
+    );
+  });
+  return {
+    name: "vite:reporter",
+    transform(_, id) {
+      transformedCount++;
+      if (shouldLogInfo) {
+        if (!tty) {
+          if (!hasTransformed) {
+            config.logger.info(`transforming...`);
+          }
+        } else {
+          if (id.includes(`?`)) return;
+          logTransform(id);
+        }
+        hasTransformed = true;
+      }
+      return null;
+    },
+    buildStart() {
+      transformedCount = 0;
+    },
+    buildEnd() {
+      if (shouldLogInfo) {
+        if (tty) {
+          clearLine$1();
+        }
+        config.logger.info(
+          `${colors$1.green(`\u2713`)} ${transformedCount} modules transformed.`
+        );
+      }
+    },
+    renderStart() {
+      chunkCount = 0;
+      compressedCount = 0;
+    },
+    renderChunk(code, chunk, options) {
+      if (!options.inlineDynamicImports) {
+        for (const id of chunk.moduleIds) {
+          const module = this.getModuleInfo(id);
+          if (!module) continue;
+          if (module.importers.length && module.dynamicImporters.length) {
+            const detectedIneffectiveDynamicImport = module.dynamicImporters.some(
+              (id2) => !isInNodeModules$1(id2) && chunk.moduleIds.includes(id2)
+            );
+            if (detectedIneffectiveDynamicImport) {
+              this.warn(
+                `
+(!) ${module.id} is dynamically imported by ${module.dynamicImporters.join(
+                  ", "
+                )} but also statically imported by ${module.importers.join(
+                  ", "
+                )}, dynamic import will not move module into another chunk.
+`
+              );
+            }
+          }
+        }
+      }
+      chunkCount++;
+      if (shouldLogInfo) {
+        if (!tty) {
+          if (!hasRenderedChunk) {
+            config.logger.info("rendering chunks...");
+          }
+        } else {
+          writeLine(`rendering chunks (${chunkCount})...`);
+        }
+        hasRenderedChunk = true;
+      }
+      return null;
+    },
+    generateBundle() {
+      if (shouldLogInfo && tty) clearLine$1();
+    },
+    async writeBundle({ dir: outDir }, output) {
+      let hasLargeChunks = false;
+      if (shouldLogInfo) {
+        const entries = (await Promise.all(
+          Object.values(output).map(
+            async (chunk) => {
+              if (chunk.type === "chunk") {
+                return {
+                  name: chunk.fileName,
+                  group: "JS",
+                  size: chunk.code.length,
+                  compressedSize: await getCompressedSize(chunk.code),
+                  mapSize: chunk.map ? chunk.map.toString().length : null
+                };
+              } else {
+                if (chunk.fileName.endsWith(".map")) return null;
+                const isCSS = chunk.fileName.endsWith(".css");
+                const isCompressible = isCSS || COMPRESSIBLE_ASSETS_RE.test(chunk.fileName);
+                return {
+                  name: chunk.fileName,
+                  group: isCSS ? "CSS" : "Assets",
+                  size: chunk.source.length,
+                  mapSize: null,
+                  // Rollup doesn't support CSS maps?
+                  compressedSize: isCompressible ? await getCompressedSize(chunk.source) : null
+                };
+              }
+            }
+          )
+        )).filter(isDefined);
+        if (tty) clearLine$1();
+        let longest = 0;
+        let biggestSize = 0;
+        let biggestMap = 0;
+        let biggestCompressSize = 0;
+        for (const entry of entries) {
+          if (entry.name.length > longest) longest = entry.name.length;
+          if (entry.size > biggestSize) biggestSize = entry.size;
+          if (entry.mapSize && entry.mapSize > biggestMap) {
+            biggestMap = entry.mapSize;
+          }
+          if (entry.compressedSize && entry.compressedSize > biggestCompressSize) {
+            biggestCompressSize = entry.compressedSize;
+          }
+        }
+        const sizePad = displaySize(biggestSize).length;
+        const mapPad = displaySize(biggestMap).length;
+        const compressPad = displaySize(biggestCompressSize).length;
+        const relativeOutDir = normalizePath$3(
+          path$n.relative(
+            config.root,
+            path$n.resolve(config.root, outDir ?? config.build.outDir)
+          )
+        );
+        const assetsDir = path$n.join(config.build.assetsDir, "/");
+        for (const group of groups) {
+          const filtered = entries.filter((e) => e.group === group.name);
+          if (!filtered.length) continue;
+          for (const entry of filtered.sort((a, z) => a.size - z.size)) {
+            const isLarge = group.name === "JS" && entry.size / 1e3 > chunkLimit;
+            if (isLarge) hasLargeChunks = true;
+            const sizeColor = isLarge ? colors$1.yellow : colors$1.dim;
+            let log = colors$1.dim(withTrailingSlash(relativeOutDir));
+            log += !config.build.lib && entry.name.startsWith(withTrailingSlash(assetsDir)) ? colors$1.dim(assetsDir) + group.color(
+              entry.name.slice(assetsDir.length).padEnd(longest + 2 - assetsDir.length)
+            ) : group.color(entry.name.padEnd(longest + 2));
+            log += colors$1.bold(
+              sizeColor(displaySize(entry.size).padStart(sizePad))
+            );
+            if (entry.compressedSize) {
+              log += colors$1.dim(
+                ` \u2502 gzip: ${displaySize(entry.compressedSize).padStart(
+                  compressPad
+                )}`
+              );
+            }
+            if (entry.mapSize) {
+              log += colors$1.dim(
+                ` \u2502 map: ${displaySize(entry.mapSize).padStart(mapPad)}`
+              );
+            }
+            config.logger.info(log);
+          }
+        }
+      } else {
+        hasLargeChunks = Object.values(output).some((chunk) => {
+          return chunk.type === "chunk" && chunk.code.length / 1e3 > chunkLimit;
+        });
+      }
+      if (hasLargeChunks && config.build.minify && !config.build.lib && !config.build.ssr) {
+        config.logger.warn(
+          colors$1.yellow(
+            `
+(!) Some chunks are larger than ${chunkLimit} kB after minification. Consider:
+- Using dynamic import() to code-split the application
+- Use build.rollupOptions.output.manualChunks to improve chunking: https://rollupjs.org/configuration-options/#output-manualchunks
+- Adjust chunk size limit for this warning via build.chunkSizeWarningLimit.`
+          )
+        );
+      }
+    }
+  };
+}
+function writeLine(output) {
+  clearLine$1();
+  if (output.length < process.stdout.columns) {
+    process.stdout.write(output);
+  } else {
+    process.stdout.write(output.substring(0, process.stdout.columns - 1));
+  }
+}
+function clearLine$1() {
+  process.stdout.clearLine(0);
+  process.stdout.cursorTo(0);
+}
+function throttle(fn) {
+  let timerHandle = null;
+  return (...args) => {
+    if (timerHandle) return;
+    fn(...args);
+    timerHandle = setTimeout(() => {
+      timerHandle = null;
+    }, 100);
+  };
+}
+
+const POSIX_SEP_RE = new RegExp('\\' + path$n.posix.sep, 'g');
+const NATIVE_SEP_RE = new RegExp('\\' + path$n.sep, 'g');
+/** @type {Map}*/
+const PATTERN_REGEX_CACHE = new Map();
+const GLOB_ALL_PATTERN = `**/*`;
+const TS_EXTENSIONS = ['.ts', '.tsx', '.mts', '.cts'];
+const JS_EXTENSIONS = ['.js', '.jsx', '.mjs', '.cjs'];
+const TSJS_EXTENSIONS = TS_EXTENSIONS.concat(JS_EXTENSIONS);
+const TS_EXTENSIONS_RE_GROUP = `\\.(?:${TS_EXTENSIONS.map((ext) => ext.substring(1)).join('|')})`;
+const TSJS_EXTENSIONS_RE_GROUP = `\\.(?:${TSJS_EXTENSIONS.map((ext) => ext.substring(1)).join(
+	'|'
+)})`;
+const IS_POSIX = path$n.posix.sep === path$n.sep;
+
+/**
+ * @template T
+ * @returns {{resolve:(result:T)=>void, reject:(error:any)=>void, promise: Promise}}
+ */
+function makePromise() {
+	let resolve, reject;
+	const promise = new Promise((res, rej) => {
+		resolve = res;
+		reject = rej;
+	});
+	return { promise, resolve, reject };
+}
+
+/**
+ * @param {string} filename
+ * @param {import('./cache.js').TSConfckCache} [cache]
+ * @returns {Promise}
+ */
+async function resolveTSConfigJson(filename, cache) {
+	if (path$n.extname(filename) !== '.json') {
+		return; // ignore files that are not json
+	}
+	const tsconfig = path$n.resolve(filename);
+	if (cache && (cache.hasParseResult(tsconfig) || cache.hasParseResult(filename))) {
+		return tsconfig;
+	}
+	return promises$1.stat(tsconfig).then((stat) => {
+		if (stat.isFile() || stat.isFIFO()) {
+			return tsconfig;
+		} else {
+			throw new Error(`${filename} exists but is not a regular file.`);
+		}
+	});
+}
+
+/**
+ *
+ * @param {string} dir an absolute directory path
+ * @returns {boolean}  if dir path includes a node_modules segment
+ */
+const isInNodeModules = IS_POSIX
+	? (dir) => dir.includes('/node_modules/')
+	: (dir) => dir.match(/[/\\]node_modules[/\\]/);
+
+/**
+ * convert posix separator to native separator
+ *
+ * eg.
+ * windows: C:/foo/bar -> c:\foo\bar
+ * linux: /foo/bar -> /foo/bar
+ *
+ * @param {string} filename with posix separators
+ * @returns {string} filename with native separators
+ */
+const posix2native = IS_POSIX
+	? (filename) => filename
+	: (filename) => filename.replace(POSIX_SEP_RE, path$n.sep);
+
+/**
+ * convert native separator to posix separator
+ *
+ * eg.
+ * windows: C:\foo\bar -> c:/foo/bar
+ * linux: /foo/bar -> /foo/bar
+ *
+ * @param {string} filename - filename with native separators
+ * @returns {string} filename with posix separators
+ */
+const native2posix = IS_POSIX
+	? (filename) => filename
+	: (filename) => filename.replace(NATIVE_SEP_RE, path$n.posix.sep);
+
+/**
+ * converts params to native separator, resolves path and converts native back to posix
+ *
+ * needed on windows to handle posix paths in tsconfig
+ *
+ * @param dir {string|null} directory to resolve from
+ * @param filename {string} filename or pattern to resolve
+ * @returns string
+ */
+const resolve2posix = IS_POSIX
+	? (dir, filename) => (dir ? path$n.resolve(dir, filename) : path$n.resolve(filename))
+	: (dir, filename) =>
+			native2posix(
+				dir
+					? path$n.resolve(posix2native(dir), posix2native(filename))
+					: path$n.resolve(posix2native(filename))
+			);
+
+/**
+ *
+ * @param {import('./public.d.ts').TSConfckParseResult} result
+ * @param {import('./public.d.ts').TSConfckParseOptions} [options]
+ * @returns {string[]}
+ */
+function resolveReferencedTSConfigFiles(result, options) {
+	const dir = path$n.dirname(result.tsconfigFile);
+	return result.tsconfig.references.map((ref) => {
+		const refPath = ref.path.endsWith('.json')
+			? ref.path
+			: path$n.join(ref.path, options?.configName ?? 'tsconfig.json');
+		return resolve2posix(dir, refPath);
+	});
+}
+
+/**
+ * @param {string} filename
+ * @param {import('./public.d.ts').TSConfckParseResult} result
+ * @returns {import('./public.d.ts').TSConfckParseResult}
+ */
+function resolveSolutionTSConfig(filename, result) {
+	const allowJs = result.tsconfig.compilerOptions?.allowJs;
+	const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS;
+	if (
+		result.referenced &&
+		extensions.some((ext) => filename.endsWith(ext)) &&
+		!isIncluded(filename, result)
+	) {
+		const solutionTSConfig = result.referenced.find((referenced) =>
+			isIncluded(filename, referenced)
+		);
+		if (solutionTSConfig) {
+			return solutionTSConfig;
+		}
+	}
+	return result;
+}
+
+/**
+ *
+ * @param {string} filename
+ * @param {import('./public.d.ts').TSConfckParseResult} result
+ * @returns {boolean}
+ */
+function isIncluded(filename, result) {
+	const dir = native2posix(path$n.dirname(result.tsconfigFile));
+	const files = (result.tsconfig.files || []).map((file) => resolve2posix(dir, file));
+	const absoluteFilename = resolve2posix(null, filename);
+	if (files.includes(filename)) {
+		return true;
+	}
+	const allowJs = result.tsconfig.compilerOptions?.allowJs;
+	const isIncluded = isGlobMatch(
+		absoluteFilename,
+		dir,
+		result.tsconfig.include || (result.tsconfig.files ? [] : [GLOB_ALL_PATTERN]),
+		allowJs
+	);
+	if (isIncluded) {
+		const isExcluded = isGlobMatch(absoluteFilename, dir, result.tsconfig.exclude || [], allowJs);
+		return !isExcluded;
+	}
+	return false;
+}
+
+/**
+ * test filenames agains glob patterns in tsconfig
+ *
+ * @param filename {string} posix style abolute path to filename to test
+ * @param dir {string} posix style absolute path to directory of tsconfig containing patterns
+ * @param patterns {string[]} glob patterns to match against
+ * @param allowJs {boolean} allowJs setting in tsconfig to include js extensions in checks
+ * @returns {boolean} true when at least one pattern matches filename
+ */
+function isGlobMatch(filename, dir, patterns, allowJs) {
+	const extensions = allowJs ? TSJS_EXTENSIONS : TS_EXTENSIONS;
+	return patterns.some((pattern) => {
+		// filename must end with part of pattern that comes after last wildcard
+		let lastWildcardIndex = pattern.length;
+		let hasWildcard = false;
+		let hasExtension = false;
+		let hasSlash = false;
+		let lastSlashIndex = -1;
+		for (let i = pattern.length - 1; i > -1; i--) {
+			const c = pattern[i];
+			if (!hasWildcard) {
+				if (c === '*' || c === '?') {
+					lastWildcardIndex = i;
+					hasWildcard = true;
+				}
+			}
+			if (!hasSlash) {
+				if (c === '.') {
+					hasExtension = true;
+				} else if (c === '/') {
+					lastSlashIndex = i;
+					hasSlash = true;
+				}
+			}
+			if (hasWildcard && hasSlash) {
+				break;
+			}
+		}
+		if (!hasExtension && (!hasWildcard || lastWildcardIndex < lastSlashIndex)) {
+			// add implicit glob
+			pattern += `${pattern.endsWith('/') ? '' : '/'}${GLOB_ALL_PATTERN}`;
+			lastWildcardIndex = pattern.length - 1;
+			hasWildcard = true;
+		}
+
+		// if pattern does not end with wildcard, filename must end with pattern after last wildcard
+		if (
+			lastWildcardIndex < pattern.length - 1 &&
+			!filename.endsWith(pattern.slice(lastWildcardIndex + 1))
+		) {
+			return false;
+		}
+
+		// if pattern ends with *, filename must end with a default extension
+		if (pattern.endsWith('*') && !extensions.some((ext) => filename.endsWith(ext))) {
+			return false;
+		}
+
+		// for **/* , filename must start with the dir
+		if (pattern === GLOB_ALL_PATTERN) {
+			return filename.startsWith(`${dir}/`);
+		}
+
+		const resolvedPattern = resolve2posix(dir, pattern);
+
+		// filename must start with part of pattern that comes before first wildcard
+		let firstWildcardIndex = -1;
+		for (let i = 0; i < resolvedPattern.length; i++) {
+			if (resolvedPattern[i] === '*' || resolvedPattern[i] === '?') {
+				firstWildcardIndex = i;
+				hasWildcard = true;
+				break;
+			}
+		}
+		if (
+			firstWildcardIndex > 1 &&
+			!filename.startsWith(resolvedPattern.slice(0, firstWildcardIndex - 1))
+		) {
+			return false;
+		}
+
+		if (!hasWildcard) {
+			//  no wildcard in pattern, filename must be equal to resolved pattern
+			return filename === resolvedPattern;
+		} else if (
+			firstWildcardIndex + GLOB_ALL_PATTERN.length ===
+				resolvedPattern.length - (pattern.length - 1 - lastWildcardIndex) &&
+			resolvedPattern.slice(firstWildcardIndex, firstWildcardIndex + GLOB_ALL_PATTERN.length) ===
+				GLOB_ALL_PATTERN
+		) {
+			// singular glob-all pattern and we already validated prefix and suffix matches
+			return true;
+		}
+		// complex pattern, use regex to check it
+		if (PATTERN_REGEX_CACHE.has(resolvedPattern)) {
+			return PATTERN_REGEX_CACHE.get(resolvedPattern).test(filename);
+		}
+		const regex = pattern2regex(resolvedPattern, allowJs);
+		PATTERN_REGEX_CACHE.set(resolvedPattern, regex);
+		return regex.test(filename);
+	});
+}
+
+/**
+ * @param {string} resolvedPattern
+ * @param {boolean} allowJs
+ * @returns {RegExp}
+ */
+function pattern2regex(resolvedPattern, allowJs) {
+	let regexStr = '^';
+	for (let i = 0; i < resolvedPattern.length; i++) {
+		const char = resolvedPattern[i];
+		if (char === '?') {
+			regexStr += '[^\\/]';
+			continue;
+		}
+		if (char === '*') {
+			if (resolvedPattern[i + 1] === '*' && resolvedPattern[i + 2] === '/') {
+				i += 2;
+				regexStr += '(?:[^\\/]*\\/)*'; // zero or more path segments
+				continue;
+			}
+			regexStr += '[^\\/]*';
+			continue;
+		}
+		if ('/.+^${}()|[]\\'.includes(char)) {
+			regexStr += `\\`;
+		}
+		regexStr += char;
+	}
+
+	// add known file endings if pattern ends on *
+	if (resolvedPattern.endsWith('*')) {
+		regexStr += allowJs ? TSJS_EXTENSIONS_RE_GROUP : TS_EXTENSIONS_RE_GROUP;
+	}
+	regexStr += '$';
+
+	return new RegExp(regexStr);
+}
+
+/**
+ * replace tokens like ${configDir}
+ * @param {any} tsconfig
+ * @param {string} configDir
+ * @returns {any}
+ */
+function replaceTokens(tsconfig, configDir) {
+	return JSON.parse(
+		JSON.stringify(tsconfig)
+			// replace ${configDir}
+			.replaceAll(/"\${configDir}/g, `"${native2posix(configDir)}`)
+	);
+}
+
+/**
+ * find the closest tsconfig.json file
+ *
+ * @param {string} filename - path to file to find tsconfig for (absolute or relative to cwd)
+ * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options
+ * @returns {Promise} absolute path to closest tsconfig.json or null if not found
+ */
+async function find(filename, options) {
+	let dir = path$n.dirname(path$n.resolve(filename));
+	if (options?.ignoreNodeModules && isInNodeModules(dir)) {
+		return null;
+	}
+	const cache = options?.cache;
+	const configName = options?.configName ?? 'tsconfig.json';
+	if (cache?.hasConfigPath(dir, configName)) {
+		return cache.getConfigPath(dir, configName);
+	}
+	const { /** @type {Promise} */ promise, resolve, reject } = makePromise();
+	if (options?.root && !path$n.isAbsolute(options.root)) {
+		options.root = path$n.resolve(options.root);
+	}
+	findUp(dir, { promise, resolve, reject }, options);
+	return promise;
+}
+
+/**
+ *
+ * @param {string} dir
+ * @param {{promise:Promise,resolve:(result:string|null)=>void,reject:(err:any)=>void}} madePromise
+ * @param {import('./public.d.ts').TSConfckFindOptions} [options] - options
+ */
+function findUp(dir, { resolve, reject, promise }, options) {
+	const { cache, root, configName } = options ?? {};
+	if (cache) {
+		if (cache.hasConfigPath(dir, configName)) {
+			let cached;
+			try {
+				cached = cache.getConfigPath(dir, configName);
+			} catch (e) {
+				reject(e);
+				return;
+			}
+			if (cached?.then) {
+				cached.then(resolve).catch(reject);
+			} else {
+				resolve(cached);
+			}
+		} else {
+			cache.setConfigPath(dir, promise, configName);
+		}
+	}
+	const tsconfig = path$n.join(dir, options?.configName ?? 'tsconfig.json');
+	fs__default.stat(tsconfig, (err, stats) => {
+		if (stats && (stats.isFile() || stats.isFIFO())) {
+			resolve(tsconfig);
+		} else if (err?.code !== 'ENOENT') {
+			reject(err);
+		} else {
+			let parent;
+			if (root === dir || (parent = path$n.dirname(dir)) === dir) {
+				resolve(null);
+			} else {
+				findUp(parent, { promise, resolve, reject }, options);
+			}
+		}
+	});
+}
+
+/*
+ this file contains code from strip-bom and strip-json-comments by Sindre Sorhus
+ https://github.com/sindresorhus/strip-json-comments/blob/v4.0.0/index.js
+ https://github.com/sindresorhus/strip-bom/blob/v5.0.0/index.js
+ licensed under MIT, see ../LICENSE
+*/
+
+/**
+ * convert content of tsconfig.json to regular json
+ *
+ * @param {string} tsconfigJson - content of tsconfig.json
+ * @returns {string} content as regular json, comments and dangling commas have been replaced with whitespace
+ */
+function toJson(tsconfigJson) {
+	const stripped = stripDanglingComma(stripJsonComments(stripBom(tsconfigJson)));
+	if (stripped.trim() === '') {
+		// only whitespace left after stripping, return empty object so that JSON.parse still works
+		return '{}';
+	} else {
+		return stripped;
+	}
+}
+
+/**
+ * replace dangling commas from pseudo-json string with single space
+ * implementation heavily inspired by strip-json-comments
+ *
+ * @param {string} pseudoJson
+ * @returns {string}
+ */
+function stripDanglingComma(pseudoJson) {
+	let insideString = false;
+	let offset = 0;
+	let result = '';
+	let danglingCommaPos = null;
+	for (let i = 0; i < pseudoJson.length; i++) {
+		const currentCharacter = pseudoJson[i];
+		if (currentCharacter === '"') {
+			const escaped = isEscaped(pseudoJson, i);
+			if (!escaped) {
+				insideString = !insideString;
+			}
+		}
+		if (insideString) {
+			danglingCommaPos = null;
+			continue;
+		}
+		if (currentCharacter === ',') {
+			danglingCommaPos = i;
+			continue;
+		}
+		if (danglingCommaPos) {
+			if (currentCharacter === '}' || currentCharacter === ']') {
+				result += pseudoJson.slice(offset, danglingCommaPos) + ' ';
+				offset = danglingCommaPos + 1;
+				danglingCommaPos = null;
+			} else if (!currentCharacter.match(/\s/)) {
+				danglingCommaPos = null;
+			}
+		}
+	}
+	return result + pseudoJson.substring(offset);
+}
+
+// start strip-json-comments
+/**
+ *
+ * @param {string} jsonString
+ * @param {number} quotePosition
+ * @returns {boolean}
+ */
+function isEscaped(jsonString, quotePosition) {
+	let index = quotePosition - 1;
+	let backslashCount = 0;
+
+	while (jsonString[index] === '\\') {
+		index -= 1;
+		backslashCount += 1;
+	}
+
+	return Boolean(backslashCount % 2);
+}
+
+/**
+ *
+ * @param {string} string
+ * @param {number?} start
+ * @param {number?} end
+ */
+function strip(string, start, end) {
+	return string.slice(start, end).replace(/\S/g, ' ');
+}
+
+const singleComment = Symbol('singleComment');
+const multiComment = Symbol('multiComment');
+
+/**
+ * @param {string} jsonString
+ * @returns {string}
+ */
+function stripJsonComments(jsonString) {
+	let isInsideString = false;
+	/** @type {false | symbol} */
+	let isInsideComment = false;
+	let offset = 0;
+	let result = '';
+
+	for (let index = 0; index < jsonString.length; index++) {
+		const currentCharacter = jsonString[index];
+		const nextCharacter = jsonString[index + 1];
+
+		if (!isInsideComment && currentCharacter === '"') {
+			const escaped = isEscaped(jsonString, index);
+			if (!escaped) {
+				isInsideString = !isInsideString;
+			}
+		}
+
+		if (isInsideString) {
+			continue;
+		}
+
+		if (!isInsideComment && currentCharacter + nextCharacter === '//') {
+			result += jsonString.slice(offset, index);
+			offset = index;
+			isInsideComment = singleComment;
+			index++;
+		} else if (isInsideComment === singleComment && currentCharacter + nextCharacter === '\r\n') {
+			index++;
+			isInsideComment = false;
+			result += strip(jsonString, offset, index);
+			offset = index;
+		} else if (isInsideComment === singleComment && currentCharacter === '\n') {
+			isInsideComment = false;
+			result += strip(jsonString, offset, index);
+			offset = index;
+		} else if (!isInsideComment && currentCharacter + nextCharacter === '/*') {
+			result += jsonString.slice(offset, index);
+			offset = index;
+			isInsideComment = multiComment;
+			index++;
+		} else if (isInsideComment === multiComment && currentCharacter + nextCharacter === '*/') {
+			index++;
+			isInsideComment = false;
+			result += strip(jsonString, offset, index + 1);
+			offset = index + 1;
+		}
+	}
+
+	return result + (isInsideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset));
+}
+// end strip-json-comments
+
+// start strip-bom
+/**
+ * @param {string} string
+ * @returns {string}
+ */
+function stripBom(string) {
+	// Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
+	// conversion translates it to FEFF (UTF-16 BOM).
+	if (string.charCodeAt(0) === 0xfeff) {
+		return string.slice(1);
+	}
+	return string;
+}
+// end strip-bom
+
+const not_found_result = {
+	tsconfigFile: null,
+	tsconfig: {}
+};
+
+/**
+ * parse the closest tsconfig.json file
+ *
+ * @param {string} filename - path to a tsconfig .json or a source file or directory (absolute or relative to cwd)
+ * @param {import('./public.d.ts').TSConfckParseOptions} [options] - options
+ * @returns {Promise}
+ * @throws {TSConfckParseError}
+ */
+async function parse$e(filename, options) {
+	/** @type {import('./cache.js').TSConfckCache} */
+	const cache = options?.cache;
+	if (cache?.hasParseResult(filename)) {
+		return getParsedDeep(filename, cache, options);
+	}
+	const {
+		resolve,
+		reject,
+		/** @type {Promise}*/
+		promise
+	} = makePromise();
+	cache?.setParseResult(filename, promise, true);
+	try {
+		let tsconfigFile =
+			(await resolveTSConfigJson(filename, cache)) || (await find(filename, options));
+		if (!tsconfigFile) {
+			resolve(not_found_result);
+			return promise;
+		}
+		let result;
+		if (filename !== tsconfigFile && cache?.hasParseResult(tsconfigFile)) {
+			result = await getParsedDeep(tsconfigFile, cache, options);
+		} else {
+			result = await parseFile$1(tsconfigFile, cache, filename === tsconfigFile);
+			await Promise.all([parseExtends(result, cache), parseReferences(result, options)]);
+		}
+		result.tsconfig = replaceTokens(result.tsconfig, path$n.dirname(tsconfigFile));
+		resolve(resolveSolutionTSConfig(filename, result));
+	} catch (e) {
+		reject(e);
+	}
+	return promise;
+}
+
+/**
+ * ensure extends and references are parsed
+ *
+ * @param {string} filename - cached file
+ * @param {import('./cache.js').TSConfckCache} cache - cache
+ * @param {import('./public.d.ts').TSConfckParseOptions} options - options
+ */
+async function getParsedDeep(filename, cache, options) {
+	const result = await cache.getParseResult(filename);
+	if (
+		(result.tsconfig.extends && !result.extended) ||
+		(result.tsconfig.references && !result.referenced)
+	) {
+		const promise = Promise.all([
+			parseExtends(result, cache),
+			parseReferences(result, options)
+		]).then(() => result);
+		cache.setParseResult(filename, promise, true);
+		return promise;
+	}
+	return result;
+}
+
+/**
+ *
+ * @param {string} tsconfigFile - path to tsconfig file
+ * @param {import('./cache.js').TSConfckCache} [cache] - cache
+ * @param {boolean} [skipCache] - skip cache
+ * @returns {Promise}
+ */
+async function parseFile$1(tsconfigFile, cache, skipCache) {
+	if (
+		!skipCache &&
+		cache?.hasParseResult(tsconfigFile) &&
+		!cache.getParseResult(tsconfigFile)._isRootFile_
+	) {
+		return cache.getParseResult(tsconfigFile);
+	}
+	const promise = promises$1
+		.readFile(tsconfigFile, 'utf-8')
+		.then(toJson)
+		.then((json) => {
+			const parsed = JSON.parse(json);
+			applyDefaults(parsed, tsconfigFile);
+			return {
+				tsconfigFile,
+				tsconfig: normalizeTSConfig(parsed, path$n.dirname(tsconfigFile))
+			};
+		})
+		.catch((e) => {
+			throw new TSConfckParseError(
+				`parsing ${tsconfigFile} failed: ${e}`,
+				'PARSE_FILE',
+				tsconfigFile,
+				e
+			);
+		});
+	if (
+		!skipCache &&
+		(!cache?.hasParseResult(tsconfigFile) || !cache.getParseResult(tsconfigFile)._isRootFile_)
+	) {
+		cache?.setParseResult(tsconfigFile, promise);
+	}
+	return promise;
+}
+
+/**
+ * normalize to match the output of ts.parseJsonConfigFileContent
+ *
+ * @param {any} tsconfig - typescript tsconfig output
+ * @param {string} dir - directory
+ */
+function normalizeTSConfig(tsconfig, dir) {
+	// set baseUrl to absolute path
+	const baseUrl = tsconfig.compilerOptions?.baseUrl;
+	if (baseUrl && !baseUrl.startsWith('${') && !path$n.isAbsolute(baseUrl)) {
+		tsconfig.compilerOptions.baseUrl = resolve2posix(dir, baseUrl);
+	}
+	return tsconfig;
+}
+
+/**
+ *
+ * @param {import('./public.d.ts').TSConfckParseResult} result
+ * @param {import('./public.d.ts').TSConfckParseOptions} [options]
+ * @returns {Promise}
+ */
+async function parseReferences(result, options) {
+	if (!result.tsconfig.references) {
+		return;
+	}
+	const referencedFiles = resolveReferencedTSConfigFiles(result, options);
+	const referenced = await Promise.all(
+		referencedFiles.map((file) => parseFile$1(file, options?.cache))
+	);
+	await Promise.all(referenced.map((ref) => parseExtends(ref, options?.cache)));
+	referenced.forEach((ref) => {
+		ref.solution = result;
+	});
+	result.referenced = referenced;
+}
+
+/**
+ * @param {import('./public.d.ts').TSConfckParseResult} result
+ * @param {import('./cache.js').TSConfckCache}[cache]
+ * @returns {Promise}
+ */
+async function parseExtends(result, cache) {
+	if (!result.tsconfig.extends) {
+		return;
+	}
+	// use result as first element in extended
+	// but dereference tsconfig so that mergeExtended can modify the original without affecting extended[0]
+	/** @type {import('./public.d.ts').TSConfckParseResult[]} */
+	const extended = [
+		{ tsconfigFile: result.tsconfigFile, tsconfig: JSON.parse(JSON.stringify(result.tsconfig)) }
+	];
+
+	// flatten extends graph into extended
+	let pos = 0;
+	/** @type {string[]} */
+	const extendsPath = [];
+	let currentBranchDepth = 0;
+	while (pos < extended.length) {
+		const extending = extended[pos];
+		extendsPath.push(extending.tsconfigFile);
+		if (extending.tsconfig.extends) {
+			// keep following this branch
+			currentBranchDepth += 1;
+			/** @type {string[]} */
+			let resolvedExtends;
+			if (!Array.isArray(extending.tsconfig.extends)) {
+				resolvedExtends = [resolveExtends(extending.tsconfig.extends, extending.tsconfigFile)];
+			} else {
+				// reverse because typescript 5.0 treats ['a','b','c'] as c extends b extends a
+				resolvedExtends = extending.tsconfig.extends
+					.reverse()
+					.map((ex) => resolveExtends(ex, extending.tsconfigFile));
+			}
+
+			const circularExtends = resolvedExtends.find((tsconfigFile) =>
+				extendsPath.includes(tsconfigFile)
+			);
+			if (circularExtends) {
+				const circle = extendsPath.concat([circularExtends]).join(' -> ');
+				throw new TSConfckParseError(
+					`Circular dependency in "extends": ${circle}`,
+					'EXTENDS_CIRCULAR',
+					result.tsconfigFile
+				);
+			}
+			// add new extends to the list directly after current
+			extended.splice(
+				pos + 1,
+				0,
+				...(await Promise.all(resolvedExtends.map((file) => parseFile$1(file, cache))))
+			);
+		} else {
+			// reached a leaf, backtrack to the last branching point and continue
+			extendsPath.splice(-currentBranchDepth);
+			currentBranchDepth = 0;
+		}
+		pos = pos + 1;
+	}
+	result.extended = extended;
+	// skip first as it is the original config
+	for (const ext of result.extended.slice(1)) {
+		extendTSConfig(result, ext);
+	}
+}
+
+/**
+ *
+ * @param {string} extended
+ * @param {string} from
+ * @returns {string}
+ */
+function resolveExtends(extended, from) {
+	if (extended === '..') {
+		// see #149
+		extended = '../tsconfig.json';
+	}
+	const req = createRequire$2(from);
+	let error;
+	try {
+		return req.resolve(extended);
+	} catch (e) {
+		error = e;
+	}
+	if (extended[0] !== '.' && !path$n.isAbsolute(extended)) {
+		try {
+			return req.resolve(`${extended}/tsconfig.json`);
+		} catch (e) {
+			error = e;
+		}
+	}
+
+	throw new TSConfckParseError(
+		`failed to resolve "extends":"${extended}" in ${from}`,
+		'EXTENDS_RESOLVE',
+		from,
+		error
+	);
+}
+
+// references, extends and custom keys are not carried over
+const EXTENDABLE_KEYS = [
+	'compilerOptions',
+	'files',
+	'include',
+	'exclude',
+	'watchOptions',
+	'compileOnSave',
+	'typeAcquisition',
+	'buildOptions'
+];
+
+/**
+ *
+ * @param {import('./public.d.ts').TSConfckParseResult} extending
+ * @param {import('./public.d.ts').TSConfckParseResult} extended
+ * @returns void
+ */
+function extendTSConfig(extending, extended) {
+	const extendingConfig = extending.tsconfig;
+	const extendedConfig = extended.tsconfig;
+	const relativePath = native2posix(
+		path$n.relative(path$n.dirname(extending.tsconfigFile), path$n.dirname(extended.tsconfigFile))
+	);
+	for (const key of Object.keys(extendedConfig).filter((key) => EXTENDABLE_KEYS.includes(key))) {
+		if (key === 'compilerOptions') {
+			if (!extendingConfig.compilerOptions) {
+				extendingConfig.compilerOptions = {};
+			}
+			for (const option of Object.keys(extendedConfig.compilerOptions)) {
+				if (Object.prototype.hasOwnProperty.call(extendingConfig.compilerOptions, option)) {
+					continue; // already set
+				}
+				extendingConfig.compilerOptions[option] = rebaseRelative(
+					option,
+					extendedConfig.compilerOptions[option],
+					relativePath
+				);
+			}
+		} else if (extendingConfig[key] === undefined) {
+			if (key === 'watchOptions') {
+				extendingConfig.watchOptions = {};
+				for (const option of Object.keys(extendedConfig.watchOptions)) {
+					extendingConfig.watchOptions[option] = rebaseRelative(
+						option,
+						extendedConfig.watchOptions[option],
+						relativePath
+					);
+				}
+			} else {
+				extendingConfig[key] = rebaseRelative(key, extendedConfig[key], relativePath);
+			}
+		}
+	}
+}
+
+const REBASE_KEYS = [
+	// root
+	'files',
+	'include',
+	'exclude',
+	// compilerOptions
+	'baseUrl',
+	'rootDir',
+	'rootDirs',
+	'typeRoots',
+	'outDir',
+	'outFile',
+	'declarationDir',
+	// watchOptions
+	'excludeDirectories',
+	'excludeFiles'
+];
+
+/** @typedef {string | string[]} PathValue */
+
+/**
+ *
+ * @param {string} key
+ * @param {PathValue} value
+ * @param {string} prependPath
+ * @returns {PathValue}
+ */
+function rebaseRelative(key, value, prependPath) {
+	if (!REBASE_KEYS.includes(key)) {
+		return value;
+	}
+	if (Array.isArray(value)) {
+		return value.map((x) => rebasePath(x, prependPath));
+	} else {
+		return rebasePath(value, prependPath);
+	}
+}
+
+/**
+ *
+ * @param {string} value
+ * @param {string} prependPath
+ * @returns {string}
+ */
+function rebasePath(value, prependPath) {
+	if (path$n.isAbsolute(value) || value.startsWith('${configDir}')) {
+		return value;
+	} else {
+		// relative paths use posix syntax in tsconfig
+		return path$n.posix.normalize(path$n.posix.join(prependPath, value));
+	}
+}
+
+class TSConfckParseError extends Error {
+	/**
+	 * error code
+	 * @type {string}
+	 */
+	code;
+	/**
+	 * error cause
+	 * @type { Error | undefined}
+	 */
+	cause;
+
+	/**
+	 * absolute path of tsconfig file where the error happened
+	 * @type {string}
+	 */
+	tsconfigFile;
+	/**
+	 *
+	 * @param {string} message - error message
+	 * @param {string} code - error code
+	 * @param {string} tsconfigFile - path to tsconfig file
+	 * @param {Error?} cause - cause of this error
+	 */
+	constructor(message, code, tsconfigFile, cause) {
+		super(message);
+		// Set the prototype explicitly.
+		Object.setPrototypeOf(this, TSConfckParseError.prototype);
+		this.name = TSConfckParseError.name;
+		this.code = code;
+		this.cause = cause;
+		this.tsconfigFile = tsconfigFile;
+	}
+}
+
+/**
+ *
+ * @param {any} tsconfig
+ * @param {string} tsconfigFile
+ */
+function applyDefaults(tsconfig, tsconfigFile) {
+	if (isJSConfig(tsconfigFile)) {
+		tsconfig.compilerOptions = {
+			...DEFAULT_JSCONFIG_COMPILER_OPTIONS,
+			...tsconfig.compilerOptions
+		};
+	}
+}
+
+const DEFAULT_JSCONFIG_COMPILER_OPTIONS = {
+	allowJs: true,
+	maxNodeModuleJsDepth: 2,
+	allowSyntheticDefaultImports: true,
+	skipLibCheck: true,
+	noEmit: true
+};
+
+/**
+ * @param {string} configFileName
+ */
+function isJSConfig(configFileName) {
+	return path$n.basename(configFileName) === 'jsconfig.json';
+}
+
+/** @template T */
+class TSConfckCache {
+	/**
+	 * clear cache, use this if you have a long running process and tsconfig files have been added,changed or deleted
+	 */
+	clear() {
+		this.#configPaths.clear();
+		this.#parsed.clear();
+	}
+
+	/**
+	 * has cached closest config for files in dir
+	 * @param {string} dir
+	 * @param {string} [configName=tsconfig.json]
+	 * @returns {boolean}
+	 */
+	hasConfigPath(dir, configName = 'tsconfig.json') {
+		return this.#configPaths.has(`${dir}/${configName}`);
+	}
+
+	/**
+	 * get cached closest tsconfig for files in dir
+	 * @param {string} dir
+	 * @param {string} [configName=tsconfig.json]
+	 * @returns {Promise|string|null}
+	 * @throws {unknown} if cached value is an error
+	 */
+	getConfigPath(dir, configName = 'tsconfig.json') {
+		const key = `${dir}/${configName}`;
+		const value = this.#configPaths.get(key);
+		if (value == null || value.length || value.then) {
+			return value;
+		} else {
+			throw value;
+		}
+	}
+
+	/**
+	 * has parsed tsconfig for file
+	 * @param {string} file
+	 * @returns {boolean}
+	 */
+	hasParseResult(file) {
+		return this.#parsed.has(file);
+	}
+
+	/**
+	 * get parsed tsconfig for file
+	 * @param {string} file
+	 * @returns {Promise|T}
+	 * @throws {unknown} if cached value is an error
+	 */
+	getParseResult(file) {
+		const value = this.#parsed.get(file);
+		if (value.then || value.tsconfig) {
+			return value;
+		} else {
+			throw value; // cached error, rethrow
+		}
+	}
+
+	/**
+	 * @internal
+	 * @private
+	 * @param file
+	 * @param {boolean} isRootFile a flag to check if current file which involking the parse() api, used to distinguish the normal cache which only parsed by parseFile()
+	 * @param {Promise} result
+	 */
+	setParseResult(file, result, isRootFile = false) {
+		// _isRootFile_ is a temporary property for Promise result, used to prevent deadlock with cache
+		Object.defineProperty(result, '_isRootFile_', {
+			value: isRootFile,
+			writable: false,
+			enumerable: false,
+			configurable: false
+		});
+		this.#parsed.set(file, result);
+		result
+			.then((parsed) => {
+				if (this.#parsed.get(file) === result) {
+					this.#parsed.set(file, parsed);
+				}
+			})
+			.catch((e) => {
+				if (this.#parsed.get(file) === result) {
+					this.#parsed.set(file, e);
+				}
+			});
+	}
+
+	/**
+	 * @internal
+	 * @private
+	 * @param {string} dir
+	 * @param {Promise} configPath
+	 * @param {string} [configName=tsconfig.json]
+	 */
+	setConfigPath(dir, configPath, configName = 'tsconfig.json') {
+		const key = `${dir}/${configName}`;
+		this.#configPaths.set(key, configPath);
+		configPath
+			.then((path) => {
+				if (this.#configPaths.get(key) === configPath) {
+					this.#configPaths.set(key, path);
+				}
+			})
+			.catch((e) => {
+				if (this.#configPaths.get(key) === configPath) {
+					this.#configPaths.set(key, e);
+				}
+			});
+	}
+
+	/**
+	 * map directories to their closest tsconfig.json
+	 * @internal
+	 * @private
+	 * @type{Map|string|null)>}
+	 */
+	#configPaths = new Map();
+
+	/**
+	 * map files to their parsed tsconfig result
+	 * @internal
+	 * @private
+	 * @type {Map|T)> }
+	 */
+	#parsed = new Map();
+}
+
+const debug$h = createDebugger("vite:esbuild");
+const IIFE_BEGIN_RE = /(?:const|var)\s+\S+\s*=\s*function\([^()]*\)\s*\{\s*"use strict";/;
+const validExtensionRE = /\.\w+$/;
+const jsxExtensionsRE = /\.(?:j|t)sx\b/;
+const defaultEsbuildSupported = {
+  "dynamic-import": true,
+  "import-meta": true
+};
+let server;
+async function transformWithEsbuild(code, filename, options, inMap) {
+  let loader = options?.loader;
+  if (!loader) {
+    const ext = path$n.extname(validExtensionRE.test(filename) ? filename : cleanUrl(filename)).slice(1);
+    if (ext === "cjs" || ext === "mjs") {
+      loader = "js";
+    } else if (ext === "cts" || ext === "mts") {
+      loader = "ts";
+    } else {
+      loader = ext;
+    }
+  }
+  let tsconfigRaw = options?.tsconfigRaw;
+  if (typeof tsconfigRaw !== "string") {
+    const meaningfulFields = [
+      "alwaysStrict",
+      "experimentalDecorators",
+      "importsNotUsedAsValues",
+      "jsx",
+      "jsxFactory",
+      "jsxFragmentFactory",
+      "jsxImportSource",
+      "preserveValueImports",
+      "target",
+      "useDefineForClassFields",
+      "verbatimModuleSyntax"
+    ];
+    const compilerOptionsForFile = {};
+    if (loader === "ts" || loader === "tsx") {
+      const loadedTsconfig = await loadTsconfigJsonForFile(filename);
+      const loadedCompilerOptions = loadedTsconfig.compilerOptions ?? {};
+      for (const field of meaningfulFields) {
+        if (field in loadedCompilerOptions) {
+          compilerOptionsForFile[field] = loadedCompilerOptions[field];
+        }
+      }
+    }
+    const compilerOptions = {
+      ...compilerOptionsForFile,
+      ...tsconfigRaw?.compilerOptions
+    };
+    if (compilerOptions.useDefineForClassFields === void 0 && compilerOptions.target === void 0) {
+      compilerOptions.useDefineForClassFields = false;
+    }
+    if (options) {
+      options.jsx && (compilerOptions.jsx = void 0);
+      options.jsxFactory && (compilerOptions.jsxFactory = void 0);
+      options.jsxFragment && (compilerOptions.jsxFragmentFactory = void 0);
+      options.jsxImportSource && (compilerOptions.jsxImportSource = void 0);
+    }
+    tsconfigRaw = {
+      ...tsconfigRaw,
+      compilerOptions
+    };
+  }
+  const resolvedOptions = {
+    sourcemap: true,
+    // ensure source file name contains full query
+    sourcefile: filename,
+    ...options,
+    loader,
+    tsconfigRaw
+  };
+  delete resolvedOptions.include;
+  delete resolvedOptions.exclude;
+  delete resolvedOptions.jsxInject;
+  try {
+    const result = await transform$1(code, resolvedOptions);
+    let map;
+    if (inMap && resolvedOptions.sourcemap) {
+      const nextMap = JSON.parse(result.map);
+      nextMap.sourcesContent = [];
+      map = combineSourcemaps(filename, [
+        nextMap,
+        inMap
+      ]);
+    } else {
+      map = resolvedOptions.sourcemap && resolvedOptions.sourcemap !== "inline" ? JSON.parse(result.map) : { mappings: "" };
+    }
+    return {
+      ...result,
+      map
+    };
+  } catch (e) {
+    debug$h?.(`esbuild error with options used: `, resolvedOptions);
+    if (e.errors) {
+      e.frame = "";
+      e.errors.forEach((m) => {
+        if (m.text === "Experimental decorators are not currently enabled" || m.text === "Parameter decorators only work when experimental decorators are enabled") {
+          m.text += '. Vite 5 now uses esbuild 0.18 and you need to enable them by adding "experimentalDecorators": true in your "tsconfig.json" file.';
+        }
+        e.frame += `
+` + prettifyMessage(m, code);
+      });
+      e.loc = e.errors[0].location;
+    }
+    throw e;
+  }
+}
+function esbuildPlugin(config) {
+  const options = config.esbuild;
+  const { jsxInject, include, exclude, ...esbuildTransformOptions } = options;
+  const filter = createFilter(include || /\.(m?ts|[jt]sx)$/, exclude || /\.js$/);
+  const transformOptions = {
+    target: "esnext",
+    charset: "utf8",
+    ...esbuildTransformOptions,
+    minify: false,
+    minifyIdentifiers: false,
+    minifySyntax: false,
+    minifyWhitespace: false,
+    treeShaking: false,
+    // keepNames is not needed when minify is disabled.
+    // Also transforming multiple times with keepNames enabled breaks
+    // tree-shaking. (#9164)
+    keepNames: false,
+    supported: {
+      ...defaultEsbuildSupported,
+      ...esbuildTransformOptions.supported
+    }
+  };
+  return {
+    name: "vite:esbuild",
+    configureServer(_server) {
+      server = _server;
+      server.watcher.on("add", reloadOnTsconfigChange).on("change", reloadOnTsconfigChange).on("unlink", reloadOnTsconfigChange);
+    },
+    buildEnd() {
+      server = null;
+    },
+    async transform(code, id) {
+      if (filter(id) || filter(cleanUrl(id))) {
+        const result = await transformWithEsbuild(code, id, transformOptions);
+        if (result.warnings.length) {
+          result.warnings.forEach((m) => {
+            this.warn(prettifyMessage(m, code));
+          });
+        }
+        if (jsxInject && jsxExtensionsRE.test(id)) {
+          result.code = jsxInject + ";" + result.code;
+        }
+        return {
+          code: result.code,
+          map: result.map
+        };
+      }
+    }
+  };
+}
+const rollupToEsbuildFormatMap = {
+  es: "esm",
+  cjs: "cjs",
+  // passing `var Lib = (() => {})()` to esbuild with format = "iife"
+  // will turn it to `(() => { var Lib = (() => {})() })()`,
+  // so we remove the format config to tell esbuild not doing this
+  //
+  // although esbuild doesn't change format, there is still possibility
+  // that `{ treeShaking: true }` removes a top-level no-side-effect variable
+  // like: `var Lib = 1`, which becomes `` after esbuild transforming,
+  // but thankfully rollup does not do this optimization now
+  iife: void 0
+};
+const buildEsbuildPlugin = (config) => {
+  return {
+    name: "vite:esbuild-transpile",
+    async renderChunk(code, chunk, opts) {
+      if (opts.__vite_skip_esbuild__) {
+        return null;
+      }
+      const options = resolveEsbuildTranspileOptions(config, opts.format);
+      if (!options) {
+        return null;
+      }
+      const res = await transformWithEsbuild(code, chunk.fileName, options);
+      if (config.build.lib) {
+        const esbuildCode = res.code;
+        const contentIndex = opts.format === "iife" ? Math.max(esbuildCode.search(IIFE_BEGIN_RE), 0) : opts.format === "umd" ? esbuildCode.indexOf(`(function(`) : 0;
+        if (contentIndex > 0) {
+          const esbuildHelpers = esbuildCode.slice(0, contentIndex);
+          res.code = esbuildCode.slice(contentIndex).replace(`"use strict";`, `"use strict";` + esbuildHelpers);
+        }
+      }
+      return res;
+    }
+  };
+};
+function resolveEsbuildTranspileOptions(config, format) {
+  const target = config.build.target;
+  const minify = config.build.minify === "esbuild";
+  if ((!target || target === "esnext") && !minify) {
+    return null;
+  }
+  const isEsLibBuild = config.build.lib && format === "es";
+  const esbuildOptions = config.esbuild || {};
+  const options = {
+    charset: "utf8",
+    ...esbuildOptions,
+    loader: "js",
+    target: target || void 0,
+    format: rollupToEsbuildFormatMap[format],
+    supported: {
+      ...defaultEsbuildSupported,
+      ...esbuildOptions.supported
+    }
+  };
+  if (!minify) {
+    return {
+      ...options,
+      minify: false,
+      minifyIdentifiers: false,
+      minifySyntax: false,
+      minifyWhitespace: false,
+      treeShaking: false
+    };
+  }
+  if (options.minifyIdentifiers != null || options.minifySyntax != null || options.minifyWhitespace != null) {
+    if (isEsLibBuild) {
+      return {
+        ...options,
+        minify: false,
+        minifyIdentifiers: options.minifyIdentifiers ?? true,
+        minifySyntax: options.minifySyntax ?? true,
+        minifyWhitespace: false,
+        treeShaking: true
+      };
+    } else {
+      return {
+        ...options,
+        minify: false,
+        minifyIdentifiers: options.minifyIdentifiers ?? true,
+        minifySyntax: options.minifySyntax ?? true,
+        minifyWhitespace: options.minifyWhitespace ?? true,
+        treeShaking: true
+      };
+    }
+  }
+  if (isEsLibBuild) {
+    return {
+      ...options,
+      minify: false,
+      minifyIdentifiers: true,
+      minifySyntax: true,
+      minifyWhitespace: false,
+      treeShaking: true
+    };
+  } else {
+    return {
+      ...options,
+      minify: true,
+      treeShaking: true
+    };
+  }
+}
+function prettifyMessage(m, code) {
+  let res = colors$1.yellow(m.text);
+  if (m.location) {
+    res += `
+` + generateCodeFrame(code, m.location);
+  }
+  return res + `
+`;
+}
+let tsconfckCache;
+async function loadTsconfigJsonForFile(filename) {
+  try {
+    if (!tsconfckCache) {
+      tsconfckCache = new TSConfckCache();
+    }
+    const result = await parse$e(filename, {
+      cache: tsconfckCache,
+      ignoreNodeModules: true
+    });
+    if (server && result.tsconfigFile) {
+      ensureWatchedFile(server.watcher, result.tsconfigFile, server.config.root);
+    }
+    return result.tsconfig;
+  } catch (e) {
+    if (e instanceof TSConfckParseError) {
+      if (server && e.tsconfigFile) {
+        ensureWatchedFile(server.watcher, e.tsconfigFile, server.config.root);
+      }
+    }
+    throw e;
+  }
+}
+async function reloadOnTsconfigChange(changedFile) {
+  if (!server) return;
+  if (path$n.basename(changedFile) === "tsconfig.json" || changedFile.endsWith(".json") && tsconfckCache?.hasParseResult(changedFile)) {
+    server.config.logger.info(
+      `changed tsconfig file detected: ${changedFile} - Clearing cache and forcing full-reload to ensure TypeScript is compiled with updated config values.`,
+      { clear: server.config.clearScreen, timestamp: true }
+    );
+    server.moduleGraph.invalidateAll();
+    tsconfckCache?.clear();
+    if (server) {
+      server.hot.send({
+        type: "full-reload",
+        path: "*"
+      });
+    }
+  }
+}
+
+// src/realWorker.ts
+var Worker = class {
+  /** @internal */
+  _code;
+  /** @internal */
+  _parentFunctions;
+  /** @internal */
+  _max;
+  /** @internal */
+  _pool;
+  /** @internal */
+  _idlePool;
+  /** @internal */
+  _queue;
+  constructor(fn, options = {}) {
+    this._code = genWorkerCode(fn, options.parentFunctions ?? {});
+    this._parentFunctions = options.parentFunctions ?? {};
+    const defaultMax = Math.max(
+      1,
+      // os.availableParallelism is available from Node.js 18.14.0
+      (os$5.availableParallelism?.() ?? os$5.cpus().length) - 1
+    );
+    this._max = options.max || defaultMax;
+    this._pool = [];
+    this._idlePool = [];
+    this._queue = [];
+  }
+  async run(...args) {
+    const worker = await this._getAvailableWorker();
+    return new Promise((resolve, reject) => {
+      worker.currentResolve = resolve;
+      worker.currentReject = reject;
+      worker.postMessage({ type: "run", args });
+    });
+  }
+  stop() {
+    this._pool.forEach((w) => w.unref());
+    this._queue.forEach(
+      ([, reject]) => reject(
+        new Error("Main worker pool stopped before a worker was available.")
+      )
+    );
+    this._pool = [];
+    this._idlePool = [];
+    this._queue = [];
+  }
+  /** @internal */
+  async _getAvailableWorker() {
+    if (this._idlePool.length) {
+      return this._idlePool.shift();
+    }
+    if (this._pool.length < this._max) {
+      const worker = new Worker$1(this._code, { eval: true });
+      worker.on("message", async (args) => {
+        if (args.type === "run") {
+          if ("result" in args) {
+            worker.currentResolve && worker.currentResolve(args.result);
+            worker.currentResolve = null;
+          } else {
+            if (args.error instanceof ReferenceError) {
+              args.error.message += ". Maybe you forgot to pass the function to parentFunction?";
+            }
+            worker.currentReject && worker.currentReject(args.error);
+            worker.currentReject = null;
+          }
+          this._assignDoneWorker(worker);
+        } else if (args.type === "parentFunction") {
+          try {
+            const result = await this._parentFunctions[args.name](...args.args);
+            worker.postMessage({ type: "parentFunction", id: args.id, result });
+          } catch (e) {
+            worker.postMessage({
+              type: "parentFunction",
+              id: args.id,
+              error: e
+            });
+          }
+        }
+      });
+      worker.on("error", (err) => {
+        worker.currentReject && worker.currentReject(err);
+        worker.currentReject = null;
+      });
+      worker.on("exit", (code) => {
+        const i = this._pool.indexOf(worker);
+        if (i > -1)
+          this._pool.splice(i, 1);
+        if (code !== 0 && worker.currentReject) {
+          worker.currentReject(
+            new Error(`Worker stopped with non-0 exit code ${code}`)
+          );
+          worker.currentReject = null;
+        }
+      });
+      this._pool.push(worker);
+      return worker;
+    }
+    let resolve;
+    let reject;
+    const onWorkerAvailablePromise = new Promise((r, rj) => {
+      resolve = r;
+      reject = rj;
+    });
+    this._queue.push([resolve, reject]);
+    return onWorkerAvailablePromise;
+  }
+  /** @internal */
+  _assignDoneWorker(worker) {
+    if (this._queue.length) {
+      const [resolve] = this._queue.shift();
+      resolve(worker);
+      return;
+    }
+    this._idlePool.push(worker);
+  }
+};
+function genWorkerCode(fn, parentFunctions) {
+  const createParentFunctionCaller = (parentPort) => {
+    let id = 0;
+    const resolvers = /* @__PURE__ */ new Map();
+    const call = (key) => async (...args) => {
+      id++;
+      let resolve, reject;
+      const promise = new Promise((res, rej) => {
+        resolve = res;
+        reject = rej;
+      });
+      resolvers.set(id, { resolve, reject });
+      parentPort.postMessage({ type: "parentFunction", id, name: key, args });
+      return await promise;
+    };
+    const receive = (id2, args) => {
+      if (resolvers.has(id2)) {
+        const { resolve, reject } = resolvers.get(id2);
+        resolvers.delete(id2);
+        if ("result" in args) {
+          resolve(args.result);
+        } else {
+          reject(args.error);
+        }
+      }
+    };
+    return { call, receive };
+  };
+  return `
+const { parentPort } = require('worker_threads')
+const parentFunctionCaller = (${createParentFunctionCaller.toString()})(parentPort)
+
+const doWork = (() => {
+  ${Object.keys(parentFunctions).map(
+    (key) => `const ${key} = parentFunctionCaller.call(${JSON.stringify(key)});`
+  ).join("\n")}
+  return (${fn.toString()})()
+})()
+
+parentPort.on('message', async (args) => {
+  if (args.type === 'run') {
+    try {
+      const res = await doWork(...args.args)
+      parentPort.postMessage({ type: 'run', result: res })
+    } catch (e) {
+      parentPort.postMessage({ type: 'run', error: e })
+    }
+  } else if (args.type === 'parentFunction') {
+    parentFunctionCaller.receive(args.id, args)
+  }
+})
+  `;
+}
+var FakeWorker = class {
+  /** @internal */
+  _fn;
+  constructor(fn, options = {}) {
+    const argsAndCode = genFakeWorkerArgsAndCode(
+      fn,
+      options.parentFunctions ?? {}
+    );
+    const require2 = createRequire$1(import.meta.url);
+    this._fn = new Function(...argsAndCode)(require2, options.parentFunctions);
+  }
+  async run(...args) {
+    try {
+      return await this._fn(...args);
+    } catch (err) {
+      if (err instanceof ReferenceError) {
+        err.message += ". Maybe you forgot to pass the function to parentFunction?";
+      }
+      throw err;
+    }
+  }
+  stop() {
+  }
+};
+function genFakeWorkerArgsAndCode(fn, parentFunctions) {
+  return [
+    "require",
+    "parentFunctions",
+    `
+${Object.keys(parentFunctions).map((key) => `const ${key} = parentFunctions[${JSON.stringify(key)}];`).join("\n")}
+return (${fn.toString()})()
+  `
+  ];
+}
+
+// src/workerWithFallback.ts
+var WorkerWithFallback = class {
+  /** @internal */
+  _disableReal;
+  /** @internal */
+  _realWorker;
+  /** @internal */
+  _fakeWorker;
+  /** @internal */
+  _shouldUseFake;
+  constructor(fn, options) {
+    this._disableReal = options.max !== void 0 && options.max <= 0;
+    this._realWorker = new Worker(fn, options);
+    this._fakeWorker = new FakeWorker(fn, options);
+    this._shouldUseFake = options.shouldUseFake;
+  }
+  async run(...args) {
+    const useFake = this._disableReal || this._shouldUseFake(...args);
+    return this[useFake ? "_fakeWorker" : "_realWorker"].run(...args);
+  }
+  stop() {
+    this._realWorker.stop();
+    this._fakeWorker.stop();
+  }
+};
+
+let terserPath;
+const loadTerserPath = (root) => {
+  if (terserPath) return terserPath;
+  try {
+    terserPath = requireResolveFromRootWithFallback(root, "terser");
+  } catch (e) {
+    if (e.code === "MODULE_NOT_FOUND") {
+      throw new Error(
+        "terser not found. Since Vite v3, terser has become an optional dependency. You need to install it."
+      );
+    } else {
+      const message = new Error(`terser failed to load:
+${e.message}`);
+      message.stack = e.stack + "\n" + message.stack;
+      throw message;
+    }
+  }
+  return terserPath;
+};
+function terserPlugin(config) {
+  const { maxWorkers, ...terserOptions } = config.build.terserOptions;
+  const makeWorker = () => new Worker(
+    () => async (terserPath2, code, options) => {
+      const terser = require(terserPath2);
+      return terser.minify(code, options);
+    },
+    {
+      max: maxWorkers
+    }
+  );
+  let worker;
+  return {
+    name: "vite:terser",
+    async renderChunk(code, _chunk, outputOptions) {
+      if (config.build.minify !== "terser" && // @ts-expect-error injected by @vitejs/plugin-legacy
+      !outputOptions.__vite_force_terser__) {
+        return null;
+      }
+      if (config.build.lib && outputOptions.format === "es") {
+        return null;
+      }
+      worker ||= makeWorker();
+      const terserPath2 = loadTerserPath(config.root);
+      const res = await worker.run(terserPath2, code, {
+        safari10: true,
+        ...terserOptions,
+        sourceMap: !!outputOptions.sourcemap,
+        module: outputOptions.format.startsWith("es"),
+        toplevel: outputOptions.format === "cjs"
+      });
+      return {
+        code: res.code,
+        map: res.map
+      };
+    },
+    closeBundle() {
+      worker?.stop();
+    }
+  };
+}
+
+const mimes = {
+  "3g2": "video/3gpp2",
+  "3gp": "video/3gpp",
+  "3gpp": "video/3gpp",
+  "3mf": "model/3mf",
+  "aac": "audio/aac",
+  "ac": "application/pkix-attr-cert",
+  "adp": "audio/adpcm",
+  "adts": "audio/aac",
+  "ai": "application/postscript",
+  "aml": "application/automationml-aml+xml",
+  "amlx": "application/automationml-amlx+zip",
+  "amr": "audio/amr",
+  "apng": "image/apng",
+  "appcache": "text/cache-manifest",
+  "appinstaller": "application/appinstaller",
+  "appx": "application/appx",
+  "appxbundle": "application/appxbundle",
+  "asc": "application/pgp-keys",
+  "atom": "application/atom+xml",
+  "atomcat": "application/atomcat+xml",
+  "atomdeleted": "application/atomdeleted+xml",
+  "atomsvc": "application/atomsvc+xml",
+  "au": "audio/basic",
+  "avci": "image/avci",
+  "avcs": "image/avcs",
+  "avif": "image/avif",
+  "aw": "application/applixware",
+  "bdoc": "application/bdoc",
+  "bin": "application/octet-stream",
+  "bmp": "image/bmp",
+  "bpk": "application/octet-stream",
+  "btf": "image/prs.btif",
+  "btif": "image/prs.btif",
+  "buffer": "application/octet-stream",
+  "ccxml": "application/ccxml+xml",
+  "cdfx": "application/cdfx+xml",
+  "cdmia": "application/cdmi-capability",
+  "cdmic": "application/cdmi-container",
+  "cdmid": "application/cdmi-domain",
+  "cdmio": "application/cdmi-object",
+  "cdmiq": "application/cdmi-queue",
+  "cer": "application/pkix-cert",
+  "cgm": "image/cgm",
+  "cjs": "application/node",
+  "class": "application/java-vm",
+  "coffee": "text/coffeescript",
+  "conf": "text/plain",
+  "cpl": "application/cpl+xml",
+  "cpt": "application/mac-compactpro",
+  "crl": "application/pkix-crl",
+  "css": "text/css",
+  "csv": "text/csv",
+  "cu": "application/cu-seeme",
+  "cwl": "application/cwl",
+  "cww": "application/prs.cww",
+  "davmount": "application/davmount+xml",
+  "dbk": "application/docbook+xml",
+  "deb": "application/octet-stream",
+  "def": "text/plain",
+  "deploy": "application/octet-stream",
+  "dib": "image/bmp",
+  "disposition-notification": "message/disposition-notification",
+  "dist": "application/octet-stream",
+  "distz": "application/octet-stream",
+  "dll": "application/octet-stream",
+  "dmg": "application/octet-stream",
+  "dms": "application/octet-stream",
+  "doc": "application/msword",
+  "dot": "application/msword",
+  "dpx": "image/dpx",
+  "drle": "image/dicom-rle",
+  "dsc": "text/prs.lines.tag",
+  "dssc": "application/dssc+der",
+  "dtd": "application/xml-dtd",
+  "dump": "application/octet-stream",
+  "dwd": "application/atsc-dwd+xml",
+  "ear": "application/java-archive",
+  "ecma": "application/ecmascript",
+  "elc": "application/octet-stream",
+  "emf": "image/emf",
+  "eml": "message/rfc822",
+  "emma": "application/emma+xml",
+  "emotionml": "application/emotionml+xml",
+  "eps": "application/postscript",
+  "epub": "application/epub+zip",
+  "exe": "application/octet-stream",
+  "exi": "application/exi",
+  "exp": "application/express",
+  "exr": "image/aces",
+  "ez": "application/andrew-inset",
+  "fdf": "application/fdf",
+  "fdt": "application/fdt+xml",
+  "fits": "image/fits",
+  "g3": "image/g3fax",
+  "gbr": "application/rpki-ghostbusters",
+  "geojson": "application/geo+json",
+  "gif": "image/gif",
+  "glb": "model/gltf-binary",
+  "gltf": "model/gltf+json",
+  "gml": "application/gml+xml",
+  "gpx": "application/gpx+xml",
+  "gram": "application/srgs",
+  "grxml": "application/srgs+xml",
+  "gxf": "application/gxf",
+  "gz": "application/gzip",
+  "h261": "video/h261",
+  "h263": "video/h263",
+  "h264": "video/h264",
+  "heic": "image/heic",
+  "heics": "image/heic-sequence",
+  "heif": "image/heif",
+  "heifs": "image/heif-sequence",
+  "hej2": "image/hej2k",
+  "held": "application/atsc-held+xml",
+  "hjson": "application/hjson",
+  "hlp": "application/winhlp",
+  "hqx": "application/mac-binhex40",
+  "hsj2": "image/hsj2",
+  "htm": "text/html",
+  "html": "text/html",
+  "ics": "text/calendar",
+  "ief": "image/ief",
+  "ifb": "text/calendar",
+  "iges": "model/iges",
+  "igs": "model/iges",
+  "img": "application/octet-stream",
+  "in": "text/plain",
+  "ini": "text/plain",
+  "ink": "application/inkml+xml",
+  "inkml": "application/inkml+xml",
+  "ipfix": "application/ipfix",
+  "iso": "application/octet-stream",
+  "its": "application/its+xml",
+  "jade": "text/jade",
+  "jar": "application/java-archive",
+  "jhc": "image/jphc",
+  "jls": "image/jls",
+  "jp2": "image/jp2",
+  "jpe": "image/jpeg",
+  "jpeg": "image/jpeg",
+  "jpf": "image/jpx",
+  "jpg": "image/jpeg",
+  "jpg2": "image/jp2",
+  "jpgm": "image/jpm",
+  "jpgv": "video/jpeg",
+  "jph": "image/jph",
+  "jpm": "image/jpm",
+  "jpx": "image/jpx",
+  "js": "text/javascript",
+  "json": "application/json",
+  "json5": "application/json5",
+  "jsonld": "application/ld+json",
+  "jsonml": "application/jsonml+json",
+  "jsx": "text/jsx",
+  "jt": "model/jt",
+  "jxr": "image/jxr",
+  "jxra": "image/jxra",
+  "jxrs": "image/jxrs",
+  "jxs": "image/jxs",
+  "jxsc": "image/jxsc",
+  "jxsi": "image/jxsi",
+  "jxss": "image/jxss",
+  "kar": "audio/midi",
+  "ktx": "image/ktx",
+  "ktx2": "image/ktx2",
+  "less": "text/less",
+  "lgr": "application/lgr+xml",
+  "list": "text/plain",
+  "litcoffee": "text/coffeescript",
+  "log": "text/plain",
+  "lostxml": "application/lost+xml",
+  "lrf": "application/octet-stream",
+  "m1v": "video/mpeg",
+  "m21": "application/mp21",
+  "m2a": "audio/mpeg",
+  "m2v": "video/mpeg",
+  "m3a": "audio/mpeg",
+  "m4a": "audio/mp4",
+  "m4p": "application/mp4",
+  "m4s": "video/iso.segment",
+  "ma": "application/mathematica",
+  "mads": "application/mads+xml",
+  "maei": "application/mmt-aei+xml",
+  "man": "text/troff",
+  "manifest": "text/cache-manifest",
+  "map": "application/json",
+  "mar": "application/octet-stream",
+  "markdown": "text/markdown",
+  "mathml": "application/mathml+xml",
+  "mb": "application/mathematica",
+  "mbox": "application/mbox",
+  "md": "text/markdown",
+  "mdx": "text/mdx",
+  "me": "text/troff",
+  "mesh": "model/mesh",
+  "meta4": "application/metalink4+xml",
+  "metalink": "application/metalink+xml",
+  "mets": "application/mets+xml",
+  "mft": "application/rpki-manifest",
+  "mid": "audio/midi",
+  "midi": "audio/midi",
+  "mime": "message/rfc822",
+  "mj2": "video/mj2",
+  "mjp2": "video/mj2",
+  "mjs": "text/javascript",
+  "mml": "text/mathml",
+  "mods": "application/mods+xml",
+  "mov": "video/quicktime",
+  "mp2": "audio/mpeg",
+  "mp21": "application/mp21",
+  "mp2a": "audio/mpeg",
+  "mp3": "audio/mpeg",
+  "mp4": "video/mp4",
+  "mp4a": "audio/mp4",
+  "mp4s": "application/mp4",
+  "mp4v": "video/mp4",
+  "mpd": "application/dash+xml",
+  "mpe": "video/mpeg",
+  "mpeg": "video/mpeg",
+  "mpf": "application/media-policy-dataset+xml",
+  "mpg": "video/mpeg",
+  "mpg4": "video/mp4",
+  "mpga": "audio/mpeg",
+  "mpp": "application/dash-patch+xml",
+  "mrc": "application/marc",
+  "mrcx": "application/marcxml+xml",
+  "ms": "text/troff",
+  "mscml": "application/mediaservercontrol+xml",
+  "msh": "model/mesh",
+  "msi": "application/octet-stream",
+  "msix": "application/msix",
+  "msixbundle": "application/msixbundle",
+  "msm": "application/octet-stream",
+  "msp": "application/octet-stream",
+  "mtl": "model/mtl",
+  "musd": "application/mmt-usd+xml",
+  "mxf": "application/mxf",
+  "mxmf": "audio/mobile-xmf",
+  "mxml": "application/xv+xml",
+  "n3": "text/n3",
+  "nb": "application/mathematica",
+  "nq": "application/n-quads",
+  "nt": "application/n-triples",
+  "obj": "model/obj",
+  "oda": "application/oda",
+  "oga": "audio/ogg",
+  "ogg": "audio/ogg",
+  "ogv": "video/ogg",
+  "ogx": "application/ogg",
+  "omdoc": "application/omdoc+xml",
+  "onepkg": "application/onenote",
+  "onetmp": "application/onenote",
+  "onetoc": "application/onenote",
+  "onetoc2": "application/onenote",
+  "opf": "application/oebps-package+xml",
+  "opus": "audio/ogg",
+  "otf": "font/otf",
+  "owl": "application/rdf+xml",
+  "oxps": "application/oxps",
+  "p10": "application/pkcs10",
+  "p7c": "application/pkcs7-mime",
+  "p7m": "application/pkcs7-mime",
+  "p7s": "application/pkcs7-signature",
+  "p8": "application/pkcs8",
+  "pdf": "application/pdf",
+  "pfr": "application/font-tdpfr",
+  "pgp": "application/pgp-encrypted",
+  "pkg": "application/octet-stream",
+  "pki": "application/pkixcmp",
+  "pkipath": "application/pkix-pkipath",
+  "pls": "application/pls+xml",
+  "png": "image/png",
+  "prc": "model/prc",
+  "prf": "application/pics-rules",
+  "provx": "application/provenance+xml",
+  "ps": "application/postscript",
+  "pskcxml": "application/pskc+xml",
+  "pti": "image/prs.pti",
+  "qt": "video/quicktime",
+  "raml": "application/raml+yaml",
+  "rapd": "application/route-apd+xml",
+  "rdf": "application/rdf+xml",
+  "relo": "application/p2p-overlay+xml",
+  "rif": "application/reginfo+xml",
+  "rl": "application/resource-lists+xml",
+  "rld": "application/resource-lists-diff+xml",
+  "rmi": "audio/midi",
+  "rnc": "application/relax-ng-compact-syntax",
+  "rng": "application/xml",
+  "roa": "application/rpki-roa",
+  "roff": "text/troff",
+  "rq": "application/sparql-query",
+  "rs": "application/rls-services+xml",
+  "rsat": "application/atsc-rsat+xml",
+  "rsd": "application/rsd+xml",
+  "rsheet": "application/urc-ressheet+xml",
+  "rss": "application/rss+xml",
+  "rtf": "text/rtf",
+  "rtx": "text/richtext",
+  "rusd": "application/route-usd+xml",
+  "s3m": "audio/s3m",
+  "sbml": "application/sbml+xml",
+  "scq": "application/scvp-cv-request",
+  "scs": "application/scvp-cv-response",
+  "sdp": "application/sdp",
+  "senmlx": "application/senml+xml",
+  "sensmlx": "application/sensml+xml",
+  "ser": "application/java-serialized-object",
+  "setpay": "application/set-payment-initiation",
+  "setreg": "application/set-registration-initiation",
+  "sgi": "image/sgi",
+  "sgm": "text/sgml",
+  "sgml": "text/sgml",
+  "shex": "text/shex",
+  "shf": "application/shf+xml",
+  "shtml": "text/html",
+  "sieve": "application/sieve",
+  "sig": "application/pgp-signature",
+  "sil": "audio/silk",
+  "silo": "model/mesh",
+  "siv": "application/sieve",
+  "slim": "text/slim",
+  "slm": "text/slim",
+  "sls": "application/route-s-tsid+xml",
+  "smi": "application/smil+xml",
+  "smil": "application/smil+xml",
+  "snd": "audio/basic",
+  "so": "application/octet-stream",
+  "spdx": "text/spdx",
+  "spp": "application/scvp-vp-response",
+  "spq": "application/scvp-vp-request",
+  "spx": "audio/ogg",
+  "sql": "application/sql",
+  "sru": "application/sru+xml",
+  "srx": "application/sparql-results+xml",
+  "ssdl": "application/ssdl+xml",
+  "ssml": "application/ssml+xml",
+  "stk": "application/hyperstudio",
+  "stl": "model/stl",
+  "stpx": "model/step+xml",
+  "stpxz": "model/step-xml+zip",
+  "stpz": "model/step+zip",
+  "styl": "text/stylus",
+  "stylus": "text/stylus",
+  "svg": "image/svg+xml",
+  "svgz": "image/svg+xml",
+  "swidtag": "application/swid+xml",
+  "t": "text/troff",
+  "t38": "image/t38",
+  "td": "application/urc-targetdesc+xml",
+  "tei": "application/tei+xml",
+  "teicorpus": "application/tei+xml",
+  "text": "text/plain",
+  "tfi": "application/thraud+xml",
+  "tfx": "image/tiff-fx",
+  "tif": "image/tiff",
+  "tiff": "image/tiff",
+  "toml": "application/toml",
+  "tr": "text/troff",
+  "trig": "application/trig",
+  "ts": "video/mp2t",
+  "tsd": "application/timestamped-data",
+  "tsv": "text/tab-separated-values",
+  "ttc": "font/collection",
+  "ttf": "font/ttf",
+  "ttl": "text/turtle",
+  "ttml": "application/ttml+xml",
+  "txt": "text/plain",
+  "u3d": "model/u3d",
+  "u8dsn": "message/global-delivery-status",
+  "u8hdr": "message/global-headers",
+  "u8mdn": "message/global-disposition-notification",
+  "u8msg": "message/global",
+  "ubj": "application/ubjson",
+  "uri": "text/uri-list",
+  "uris": "text/uri-list",
+  "urls": "text/uri-list",
+  "vcard": "text/vcard",
+  "vrml": "model/vrml",
+  "vtt": "text/vtt",
+  "vxml": "application/voicexml+xml",
+  "war": "application/java-archive",
+  "wasm": "application/wasm",
+  "wav": "audio/wav",
+  "weba": "audio/webm",
+  "webm": "video/webm",
+  "webmanifest": "application/manifest+json",
+  "webp": "image/webp",
+  "wgsl": "text/wgsl",
+  "wgt": "application/widget",
+  "wif": "application/watcherinfo+xml",
+  "wmf": "image/wmf",
+  "woff": "font/woff",
+  "woff2": "font/woff2",
+  "wrl": "model/vrml",
+  "wsdl": "application/wsdl+xml",
+  "wspolicy": "application/wspolicy+xml",
+  "x3d": "model/x3d+xml",
+  "x3db": "model/x3d+fastinfoset",
+  "x3dbz": "model/x3d+binary",
+  "x3dv": "model/x3d-vrml",
+  "x3dvz": "model/x3d+vrml",
+  "x3dz": "model/x3d+xml",
+  "xaml": "application/xaml+xml",
+  "xav": "application/xcap-att+xml",
+  "xca": "application/xcap-caps+xml",
+  "xcs": "application/calendar+xml",
+  "xdf": "application/xcap-diff+xml",
+  "xdssc": "application/dssc+xml",
+  "xel": "application/xcap-el+xml",
+  "xenc": "application/xenc+xml",
+  "xer": "application/patch-ops-error+xml",
+  "xfdf": "application/xfdf",
+  "xht": "application/xhtml+xml",
+  "xhtml": "application/xhtml+xml",
+  "xhvml": "application/xv+xml",
+  "xlf": "application/xliff+xml",
+  "xm": "audio/xm",
+  "xml": "text/xml",
+  "xns": "application/xcap-ns+xml",
+  "xop": "application/xop+xml",
+  "xpl": "application/xproc+xml",
+  "xsd": "application/xml",
+  "xsf": "application/prs.xsf+xml",
+  "xsl": "application/xml",
+  "xslt": "application/xml",
+  "xspf": "application/xspf+xml",
+  "xvm": "application/xv+xml",
+  "xvml": "application/xv+xml",
+  "yaml": "text/yaml",
+  "yang": "application/yang",
+  "yin": "application/yin+xml",
+  "yml": "text/yaml",
+  "zip": "application/zip"
+};
+
+function lookup(extn) {
+	let tmp = ('' + extn).trim().toLowerCase();
+	let idx = tmp.lastIndexOf('.');
+	return mimes[!~idx ? tmp : tmp.substring(++idx)];
+}
+
+const publicFilesMap = /* @__PURE__ */ new WeakMap();
+async function initPublicFiles(config) {
+  let fileNames;
+  try {
+    fileNames = await recursiveReaddir(config.publicDir);
+  } catch (e) {
+    if (e.code === ERR_SYMLINK_IN_RECURSIVE_READDIR) {
+      return;
+    }
+    throw e;
+  }
+  const publicFiles = new Set(
+    fileNames.map((fileName) => fileName.slice(config.publicDir.length))
+  );
+  publicFilesMap.set(config, publicFiles);
+  return publicFiles;
+}
+function getPublicFiles(config) {
+  return publicFilesMap.get(config);
+}
+function checkPublicFile(url, config) {
+  const { publicDir } = config;
+  if (!publicDir || url[0] !== "/") {
+    return;
+  }
+  const fileName = cleanUrl(url);
+  const publicFiles = getPublicFiles(config);
+  if (publicFiles) {
+    return publicFiles.has(fileName) ? normalizePath$3(path$n.join(publicDir, fileName)) : void 0;
+  }
+  const publicFile = normalizePath$3(path$n.join(publicDir, fileName));
+  if (!publicFile.startsWith(withTrailingSlash(publicDir))) {
+    return;
+  }
+  return fs__default.existsSync(publicFile) ? publicFile : void 0;
+}
+
+const assetUrlRE = /__VITE_ASSET__([\w$]+)__(?:\$_(.*?)__)?/g;
+const jsSourceMapRE = /\.[cm]?js\.map$/;
+const assetCache = /* @__PURE__ */ new WeakMap();
+const generatedAssets = /* @__PURE__ */ new WeakMap();
+function registerCustomMime() {
+  mimes["ico"] = "image/x-icon";
+  mimes["flac"] = "audio/flac";
+  mimes["eot"] = "application/vnd.ms-fontobject";
+}
+function renderAssetUrlInJS(ctx, config, chunk, opts, code) {
+  const toRelativeRuntime = createToImportMetaURLBasedRelativeRuntime(
+    opts.format,
+    config.isWorker
+  );
+  let match;
+  let s;
+  assetUrlRE.lastIndex = 0;
+  while (match = assetUrlRE.exec(code)) {
+    s ||= new MagicString(code);
+    const [full, referenceId, postfix = ""] = match;
+    const file = ctx.getFileName(referenceId);
+    chunk.viteMetadata.importedAssets.add(cleanUrl(file));
+    const filename = file + postfix;
+    const replacement = toOutputFilePathInJS(
+      filename,
+      "asset",
+      chunk.fileName,
+      "js",
+      config,
+      toRelativeRuntime
+    );
+    const replacementString = typeof replacement === "string" ? JSON.stringify(encodeURIPath(replacement)).slice(1, -1) : `"+${replacement.runtime}+"`;
+    s.update(match.index, match.index + full.length, replacementString);
+  }
+  const publicAssetUrlMap = publicAssetUrlCache.get(config);
+  publicAssetUrlRE.lastIndex = 0;
+  while (match = publicAssetUrlRE.exec(code)) {
+    s ||= new MagicString(code);
+    const [full, hash] = match;
+    const publicUrl = publicAssetUrlMap.get(hash).slice(1);
+    const replacement = toOutputFilePathInJS(
+      publicUrl,
+      "public",
+      chunk.fileName,
+      "js",
+      config,
+      toRelativeRuntime
+    );
+    const replacementString = typeof replacement === "string" ? JSON.stringify(encodeURIPath(replacement)).slice(1, -1) : `"+${replacement.runtime}+"`;
+    s.update(match.index, match.index + full.length, replacementString);
+  }
+  return s;
+}
+function assetPlugin(config) {
+  registerCustomMime();
+  let moduleGraph;
+  return {
+    name: "vite:asset",
+    buildStart() {
+      assetCache.set(config, /* @__PURE__ */ new Map());
+      generatedAssets.set(config, /* @__PURE__ */ new Map());
+    },
+    configureServer(server) {
+      moduleGraph = server.moduleGraph;
+    },
+    resolveId(id) {
+      if (!config.assetsInclude(cleanUrl(id)) && !urlRE$1.test(id)) {
+        return;
+      }
+      const publicFile = checkPublicFile(id, config);
+      if (publicFile) {
+        return id;
+      }
+    },
+    async load(id) {
+      if (id[0] === "\0") {
+        return;
+      }
+      if (rawRE$1.test(id)) {
+        const file = checkPublicFile(id, config) || cleanUrl(id);
+        this.addWatchFile(file);
+        return `export default ${JSON.stringify(
+          await fsp.readFile(file, "utf-8")
+        )}`;
+      }
+      if (!urlRE$1.test(id) && !config.assetsInclude(cleanUrl(id))) {
+        return;
+      }
+      id = removeUrlQuery(id);
+      let url = await fileToUrl$1(id, config, this);
+      if (moduleGraph) {
+        const mod = moduleGraph.getModuleById(id);
+        if (mod && mod.lastHMRTimestamp > 0) {
+          url = injectQuery(url, `t=${mod.lastHMRTimestamp}`);
+        }
+      }
+      return {
+        code: `export default ${JSON.stringify(encodeURIPath(url))}`,
+        // Force rollup to keep this module from being shared between other entry points if it's an entrypoint.
+        // If the resulting chunk is empty, it will be removed in generateBundle.
+        moduleSideEffects: config.command === "build" && this.getModuleInfo(id)?.isEntry ? "no-treeshake" : false,
+        meta: config.command === "build" ? { "vite:asset": true } : void 0
+      };
+    },
+    renderChunk(code, chunk, opts) {
+      const s = renderAssetUrlInJS(this, config, chunk, opts, code);
+      if (s) {
+        return {
+          code: s.toString(),
+          map: config.build.sourcemap ? s.generateMap({ hires: "boundary" }) : null
+        };
+      } else {
+        return null;
+      }
+    },
+    generateBundle(_, bundle) {
+      for (const file in bundle) {
+        const chunk = bundle[file];
+        if (chunk.type === "chunk" && chunk.isEntry && chunk.moduleIds.length === 1 && config.assetsInclude(chunk.moduleIds[0]) && this.getModuleInfo(chunk.moduleIds[0])?.meta["vite:asset"]) {
+          delete bundle[file];
+        }
+      }
+      if (config.command === "build" && config.build.ssr && !config.build.ssrEmitAssets) {
+        for (const file in bundle) {
+          if (bundle[file].type === "asset" && !file.endsWith("ssr-manifest.json") && !jsSourceMapRE.test(file)) {
+            delete bundle[file];
+          }
+        }
+      }
+    }
+  };
+}
+async function fileToUrl$1(id, config, ctx) {
+  if (config.command === "serve") {
+    return fileToDevUrl(id, config);
+  } else {
+    return fileToBuiltUrl(id, config, ctx);
+  }
+}
+function fileToDevUrl(id, config, skipBase = false) {
+  let rtn;
+  if (checkPublicFile(id, config)) {
+    rtn = id;
+  } else if (id.startsWith(withTrailingSlash(config.root))) {
+    rtn = "/" + path$n.posix.relative(config.root, id);
+  } else {
+    rtn = path$n.posix.join(FS_PREFIX, id);
+  }
+  if (skipBase) {
+    return rtn;
+  }
+  const base = joinUrlSegments(config.server?.origin ?? "", config.decodedBase);
+  return joinUrlSegments(base, removeLeadingSlash(rtn));
+}
+function getPublicAssetFilename(hash, config) {
+  return publicAssetUrlCache.get(config)?.get(hash);
+}
+const publicAssetUrlCache = /* @__PURE__ */ new WeakMap();
+const publicAssetUrlRE = /__VITE_PUBLIC_ASSET__([a-z\d]{8})__/g;
+function publicFileToBuiltUrl(url, config) {
+  if (config.command !== "build") {
+    return joinUrlSegments(config.decodedBase, url);
+  }
+  const hash = getHash(url);
+  let cache = publicAssetUrlCache.get(config);
+  if (!cache) {
+    cache = /* @__PURE__ */ new Map();
+    publicAssetUrlCache.set(config, cache);
+  }
+  if (!cache.get(hash)) {
+    cache.set(hash, url);
+  }
+  return `__VITE_PUBLIC_ASSET__${hash}__`;
+}
+const GIT_LFS_PREFIX = Buffer$1.from("version https://git-lfs.github.com");
+function isGitLfsPlaceholder(content) {
+  if (content.length < GIT_LFS_PREFIX.length) return false;
+  return GIT_LFS_PREFIX.compare(content, 0, GIT_LFS_PREFIX.length) === 0;
+}
+async function fileToBuiltUrl(id, config, pluginContext, skipPublicCheck = false, forceInline) {
+  if (!skipPublicCheck && checkPublicFile(id, config)) {
+    return publicFileToBuiltUrl(id, config);
+  }
+  const cache = assetCache.get(config);
+  const cached = cache.get(id);
+  if (cached) {
+    return cached;
+  }
+  const file = cleanUrl(id);
+  const content = await fsp.readFile(file);
+  let url;
+  if (shouldInline(config, file, id, content, pluginContext, forceInline)) {
+    if (config.build.lib && isGitLfsPlaceholder(content)) {
+      config.logger.warn(
+        colors$1.yellow(`Inlined file ${id} was not downloaded via Git LFS`)
+      );
+    }
+    if (file.endsWith(".svg")) {
+      url = svgToDataURL(content);
+    } else {
+      const mimeType = lookup(file) ?? "application/octet-stream";
+      url = `data:${mimeType};base64,${content.toString("base64")}`;
+    }
+  } else {
+    const { search, hash } = parse$h(id);
+    const postfix = (search || "") + (hash || "");
+    const originalFileName = normalizePath$3(path$n.relative(config.root, file));
+    const referenceId = pluginContext.emitFile({
+      type: "asset",
+      // Ignore directory structure for asset file names
+      name: path$n.basename(file),
+      originalFileName,
+      source: content
+    });
+    generatedAssets.get(config).set(referenceId, { originalFileName });
+    url = `__VITE_ASSET__${referenceId}__${postfix ? `$_${postfix}__` : ``}`;
+  }
+  cache.set(id, url);
+  return url;
+}
+async function urlToBuiltUrl(url, importer, config, pluginContext, forceInline) {
+  if (checkPublicFile(url, config)) {
+    return publicFileToBuiltUrl(url, config);
+  }
+  const file = url[0] === "/" ? path$n.join(config.root, url) : path$n.join(path$n.dirname(importer), url);
+  return fileToBuiltUrl(
+    file,
+    config,
+    pluginContext,
+    // skip public check since we just did it above
+    true,
+    forceInline
+  );
+}
+const shouldInline = (config, file, id, content, pluginContext, forceInline) => {
+  if (config.build.lib) return true;
+  if (pluginContext.getModuleInfo(id)?.isEntry) return false;
+  if (forceInline !== void 0) return forceInline;
+  let limit;
+  if (typeof config.build.assetsInlineLimit === "function") {
+    const userShouldInline = config.build.assetsInlineLimit(file, content);
+    if (userShouldInline != null) return userShouldInline;
+    limit = DEFAULT_ASSETS_INLINE_LIMIT;
+  } else {
+    limit = Number(config.build.assetsInlineLimit);
+  }
+  if (file.endsWith(".html")) return false;
+  if (file.endsWith(".svg") && id.includes("#")) return false;
+  return content.length < limit && !isGitLfsPlaceholder(content);
+};
+const nestedQuotesRE = /"[^"']*'[^"]*"|'[^'"]*"[^']*'/;
+function svgToDataURL(content) {
+  const stringContent = content.toString();
+  if (stringContent.includes("\s+<").replaceAll('"', "'").replaceAll("%", "%25").replaceAll("#", "%23").replaceAll("<", "%3c").replaceAll(">", "%3e").replaceAll(/\s+/g, "%20");
+  }
+}
+
+const endsWithJSRE = /\.[cm]?js$/;
+function manifestPlugin(config) {
+  const manifest = {};
+  let outputCount;
+  return {
+    name: "vite:manifest",
+    buildStart() {
+      outputCount = 0;
+    },
+    generateBundle({ format }, bundle) {
+      function getChunkName(chunk) {
+        return getChunkOriginalFileName(chunk, config.root, format);
+      }
+      function getInternalImports(imports) {
+        const filteredImports = [];
+        for (const file of imports) {
+          if (bundle[file] === void 0) {
+            continue;
+          }
+          filteredImports.push(getChunkName(bundle[file]));
+        }
+        return filteredImports;
+      }
+      function createChunk(chunk) {
+        const manifestChunk = {
+          file: chunk.fileName,
+          name: chunk.name
+        };
+        if (chunk.facadeModuleId) {
+          manifestChunk.src = getChunkName(chunk);
+        }
+        if (chunk.isEntry) {
+          manifestChunk.isEntry = true;
+        }
+        if (chunk.isDynamicEntry) {
+          manifestChunk.isDynamicEntry = true;
+        }
+        if (chunk.imports.length) {
+          const internalImports = getInternalImports(chunk.imports);
+          if (internalImports.length > 0) {
+            manifestChunk.imports = internalImports;
+          }
+        }
+        if (chunk.dynamicImports.length) {
+          const internalImports = getInternalImports(chunk.dynamicImports);
+          if (internalImports.length > 0) {
+            manifestChunk.dynamicImports = internalImports;
+          }
+        }
+        if (chunk.viteMetadata?.importedCss.size) {
+          manifestChunk.css = [...chunk.viteMetadata.importedCss];
+        }
+        if (chunk.viteMetadata?.importedAssets.size) {
+          manifestChunk.assets = [...chunk.viteMetadata.importedAssets];
+        }
+        return manifestChunk;
+      }
+      function createAsset(asset, src, isEntry) {
+        const manifestChunk = {
+          file: asset.fileName,
+          src
+        };
+        if (isEntry) manifestChunk.isEntry = true;
+        return manifestChunk;
+      }
+      const assets = generatedAssets.get(config);
+      const entryCssAssetFileNames = /* @__PURE__ */ new Set();
+      for (const [id, asset] of assets.entries()) {
+        if (asset.isEntry) {
+          try {
+            const fileName = this.getFileName(id);
+            entryCssAssetFileNames.add(fileName);
+          } catch (error) {
+            assets.delete(id);
+          }
+        }
+      }
+      const fileNameToAsset = /* @__PURE__ */ new Map();
+      for (const file in bundle) {
+        const chunk = bundle[file];
+        if (chunk.type === "chunk") {
+          manifest[getChunkName(chunk)] = createChunk(chunk);
+        } else if (chunk.type === "asset" && typeof chunk.name === "string") {
+          const src = chunk.originalFileName ?? chunk.name;
+          const isEntry = entryCssAssetFileNames.has(chunk.fileName);
+          const asset = createAsset(chunk, src, isEntry);
+          const file2 = manifest[src]?.file;
+          if (file2 && endsWithJSRE.test(file2)) continue;
+          manifest[src] = asset;
+          fileNameToAsset.set(chunk.fileName, asset);
+        }
+      }
+      for (const [referenceId, { originalFileName }] of assets.entries()) {
+        if (!manifest[originalFileName]) {
+          const fileName = this.getFileName(referenceId);
+          const asset = fileNameToAsset.get(fileName);
+          if (asset) {
+            manifest[originalFileName] = asset;
+          }
+        }
+      }
+      outputCount++;
+      const output = config.build.rollupOptions?.output;
+      const outputLength = Array.isArray(output) ? output.length : 1;
+      if (outputCount >= outputLength) {
+        this.emitFile({
+          fileName: typeof config.build.manifest === "string" ? config.build.manifest : ".vite/manifest.json",
+          type: "asset",
+          source: JSON.stringify(sortObjectKeys(manifest), void 0, 2)
+        });
+      }
+    }
+  };
+}
+function getChunkOriginalFileName(chunk, root, format) {
+  if (chunk.facadeModuleId) {
+    let name = normalizePath$3(path$n.relative(root, chunk.facadeModuleId));
+    if (format === "system" && !chunk.name.includes("-legacy")) {
+      const ext = path$n.extname(name);
+      const endPos = ext.length !== 0 ? -ext.length : void 0;
+      name = name.slice(0, endPos) + `-legacy` + ext;
+    }
+    return name.replace(/\0/g, "");
+  } else {
+    return `_` + path$n.basename(chunk.fileName);
+  }
+}
+
+const dataUriRE = /^([^/]+\/[^;,]+)(;base64)?,([\s\S]*)$/;
+const base64RE = /base64/i;
+const dataUriPrefix = `\0/@data-uri/`;
+function dataURIPlugin() {
+  let resolved;
+  return {
+    name: "vite:data-uri",
+    buildStart() {
+      resolved = /* @__PURE__ */ new Map();
+    },
+    resolveId(id) {
+      if (!id.trimStart().startsWith("data:")) {
+        return;
+      }
+      const uri = new URL$3(id);
+      if (uri.protocol !== "data:") {
+        return;
+      }
+      const match = dataUriRE.exec(uri.pathname);
+      if (!match) {
+        return;
+      }
+      const [, mime, format, data] = match;
+      if (mime !== "text/javascript") {
+        throw new Error(
+          `data URI with non-JavaScript mime type is not supported. If you're using legacy JavaScript MIME types (such as 'application/javascript'), please use 'text/javascript' instead.`
+        );
+      }
+      const base64 = format && base64RE.test(format.substring(1));
+      const content = base64 ? Buffer.from(data, "base64").toString("utf-8") : data;
+      resolved.set(id, content);
+      return dataUriPrefix + id;
+    },
+    load(id) {
+      if (id.startsWith(dataUriPrefix)) {
+        return resolved.get(id.slice(dataUriPrefix.length));
+      }
+    }
+  };
+}
+
+/* es-module-lexer 1.5.4 */
+var ImportType;!function(A){A[A.Static=1]="Static",A[A.Dynamic=2]="Dynamic",A[A.ImportMeta=3]="ImportMeta",A[A.StaticSourcePhase=4]="StaticSourcePhase",A[A.DynamicSourcePhase=5]="DynamicSourcePhase";}(ImportType||(ImportType={}));const A=1===new Uint8Array(new Uint16Array([1]).buffer)[0];function parse$d(E,g="@"){if(!C)return init.then((()=>parse$d(E)));const I=E.length+1,w=(C.__heap_base.value||C.__heap_base)+4*I-C.memory.buffer.byteLength;w>0&&C.memory.grow(Math.ceil(w/65536));const K=C.sa(I-1);if((A?B:Q)(E,new Uint16Array(C.memory.buffer,K,I)),!C.parse())throw Object.assign(new Error(`Parse error ${g}:${E.slice(0,C.e()).split("\n").length}:${C.e()-E.lastIndexOf("\n",C.e()-1)}`),{idx:C.e()});const D=[],o=[];for(;C.ri();){const A=C.is(),Q=C.ie(),B=C.it(),g=C.ai(),I=C.id(),w=C.ss(),K=C.se();let o;C.ip()&&(o=k(E.slice(-1===I?A-1:A,-1===I?Q+1:Q))),D.push({n:o,t:B,s:A,e:Q,ss:w,se:K,d:I,a:g});}for(;C.re();){const A=C.es(),Q=C.ee(),B=C.els(),g=C.ele(),I=E.slice(A,Q),w=I[0],K=B<0?void 0:E.slice(B,g),D=K?K[0]:"";o.push({s:A,e:Q,ls:B,le:g,n:'"'===w||"'"===w?k(I):I,ln:'"'===D||"'"===D?k(K):K});}function k(A){try{return (0, eval)(A)}catch(A){}}return [D,o,!!C.f(),!!C.ms()]}function Q(A,Q){const B=A.length;let C=0;for(;C>>8;}}function B(A,Q){const B=A.length;let C=0;for(;CA.charCodeAt(0))))).then(WebAssembly.instantiate).then((({exports:A})=>{C=A;}));var E;
+
+var convertSourceMap$1 = {};
+
+(function (exports) {
+
+	Object.defineProperty(exports, 'commentRegex', {
+	  get: function getCommentRegex () {
+	    // Groups: 1: media type, 2: MIME type, 3: charset, 4: encoding, 5: data.
+	    return /^\s*?\/[\/\*][@#]\s+?sourceMappingURL=data:(((?:application|text)\/json)(?:;charset=([^;,]+?)?)?)?(?:;(base64))?,(.*?)$/mg;
+	  }
+	});
+
+
+	Object.defineProperty(exports, 'mapFileCommentRegex', {
+	  get: function getMapFileCommentRegex () {
+	    // Matches sourceMappingURL in either // or /* comment styles.
+	    return /(?:\/\/[@#][ \t]+?sourceMappingURL=([^\s'"`]+?)[ \t]*?$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*?(?:\*\/){1}[ \t]*?$)/mg;
+	  }
+	});
+
+	var decodeBase64;
+	if (typeof Buffer !== 'undefined') {
+	  if (typeof Buffer.from === 'function') {
+	    decodeBase64 = decodeBase64WithBufferFrom;
+	  } else {
+	    decodeBase64 = decodeBase64WithNewBuffer;
+	  }
+	} else {
+	  decodeBase64 = decodeBase64WithAtob;
+	}
+
+	function decodeBase64WithBufferFrom(base64) {
+	  return Buffer.from(base64, 'base64').toString();
+	}
+
+	function decodeBase64WithNewBuffer(base64) {
+	  if (typeof value === 'number') {
+	    throw new TypeError('The value to decode must not be of type number.');
+	  }
+	  return new Buffer(base64, 'base64').toString();
+	}
+
+	function decodeBase64WithAtob(base64) {
+	  return decodeURIComponent(escape(atob(base64)));
+	}
+
+	function stripComment(sm) {
+	  return sm.split(',').pop();
+	}
+
+	function readFromFileMap(sm, read) {
+	  var r = exports.mapFileCommentRegex.exec(sm);
+	  // for some odd reason //# .. captures in 1 and /* .. */ in 2
+	  var filename = r[1] || r[2];
+
+	  try {
+	    var sm = read(filename);
+	    if (sm != null && typeof sm.catch === 'function') {
+	      return sm.catch(throwError);
+	    } else {
+	      return sm;
+	    }
+	  } catch (e) {
+	    throwError(e);
+	  }
+
+	  function throwError(e) {
+	    throw new Error('An error occurred while trying to read the map file at ' + filename + '\n' + e.stack);
+	  }
+	}
+
+	function Converter (sm, opts) {
+	  opts = opts || {};
+
+	  if (opts.hasComment) {
+	    sm = stripComment(sm);
+	  }
+
+	  if (opts.encoding === 'base64') {
+	    sm = decodeBase64(sm);
+	  } else if (opts.encoding === 'uri') {
+	    sm = decodeURIComponent(sm);
+	  }
+
+	  if (opts.isJSON || opts.encoding) {
+	    sm = JSON.parse(sm);
+	  }
+
+	  this.sourcemap = sm;
+	}
+
+	Converter.prototype.toJSON = function (space) {
+	  return JSON.stringify(this.sourcemap, null, space);
+	};
+
+	if (typeof Buffer !== 'undefined') {
+	  if (typeof Buffer.from === 'function') {
+	    Converter.prototype.toBase64 = encodeBase64WithBufferFrom;
+	  } else {
+	    Converter.prototype.toBase64 = encodeBase64WithNewBuffer;
+	  }
+	} else {
+	  Converter.prototype.toBase64 = encodeBase64WithBtoa;
+	}
+
+	function encodeBase64WithBufferFrom() {
+	  var json = this.toJSON();
+	  return Buffer.from(json, 'utf8').toString('base64');
+	}
+
+	function encodeBase64WithNewBuffer() {
+	  var json = this.toJSON();
+	  if (typeof json === 'number') {
+	    throw new TypeError('The json to encode must not be of type number.');
+	  }
+	  return new Buffer(json, 'utf8').toString('base64');
+	}
+
+	function encodeBase64WithBtoa() {
+	  var json = this.toJSON();
+	  return btoa(unescape(encodeURIComponent(json)));
+	}
+
+	Converter.prototype.toURI = function () {
+	  var json = this.toJSON();
+	  return encodeURIComponent(json);
+	};
+
+	Converter.prototype.toComment = function (options) {
+	  var encoding, content, data;
+	  if (options != null && options.encoding === 'uri') {
+	    encoding = '';
+	    content = this.toURI();
+	  } else {
+	    encoding = ';base64';
+	    content = this.toBase64();
+	  }
+	  data = 'sourceMappingURL=data:application/json;charset=utf-8' + encoding + ',' + content;
+	  return options != null && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
+	};
+
+	// returns copy instead of original
+	Converter.prototype.toObject = function () {
+	  return JSON.parse(this.toJSON());
+	};
+
+	Converter.prototype.addProperty = function (key, value) {
+	  if (this.sourcemap.hasOwnProperty(key)) throw new Error('property "' + key + '" already exists on the sourcemap, use set property instead');
+	  return this.setProperty(key, value);
+	};
+
+	Converter.prototype.setProperty = function (key, value) {
+	  this.sourcemap[key] = value;
+	  return this;
+	};
+
+	Converter.prototype.getProperty = function (key) {
+	  return this.sourcemap[key];
+	};
+
+	exports.fromObject = function (obj) {
+	  return new Converter(obj);
+	};
+
+	exports.fromJSON = function (json) {
+	  return new Converter(json, { isJSON: true });
+	};
+
+	exports.fromURI = function (uri) {
+	  return new Converter(uri, { encoding: 'uri' });
+	};
+
+	exports.fromBase64 = function (base64) {
+	  return new Converter(base64, { encoding: 'base64' });
+	};
+
+	exports.fromComment = function (comment) {
+	  var m, encoding;
+	  comment = comment
+	    .replace(/^\/\*/g, '//')
+	    .replace(/\*\/$/g, '');
+	  m = exports.commentRegex.exec(comment);
+	  encoding = m && m[4] || 'uri';
+	  return new Converter(comment, { encoding: encoding, hasComment: true });
+	};
+
+	function makeConverter(sm) {
+	  return new Converter(sm, { isJSON: true });
+	}
+
+	exports.fromMapFileComment = function (comment, read) {
+	  if (typeof read === 'string') {
+	    throw new Error(
+	      'String directory paths are no longer supported with `fromMapFileComment`\n' +
+	      'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading'
+	    )
+	  }
+
+	  var sm = readFromFileMap(comment, read);
+	  if (sm != null && typeof sm.then === 'function') {
+	    return sm.then(makeConverter);
+	  } else {
+	    return makeConverter(sm);
+	  }
+	};
+
+	// Finds last sourcemap comment in file or returns null if none was found
+	exports.fromSource = function (content) {
+	  var m = content.match(exports.commentRegex);
+	  return m ? exports.fromComment(m.pop()) : null;
+	};
+
+	// Finds last sourcemap comment in file or returns null if none was found
+	exports.fromMapFileSource = function (content, read) {
+	  if (typeof read === 'string') {
+	    throw new Error(
+	      'String directory paths are no longer supported with `fromMapFileSource`\n' +
+	      'Please review the Upgrading documentation at https://github.com/thlorenz/convert-source-map#upgrading'
+	    )
+	  }
+	  var m = content.match(exports.mapFileCommentRegex);
+	  return m ? exports.fromMapFileComment(m.pop(), read) : null;
+	};
+
+	exports.removeComments = function (src) {
+	  return src.replace(exports.commentRegex, '');
+	};
+
+	exports.removeMapFileComments = function (src) {
+	  return src.replace(exports.mapFileCommentRegex, '');
+	};
+
+	exports.generateMapFileComment = function (file, options) {
+	  var data = 'sourceMappingURL=' + file;
+	  return options && options.multiline ? '/*# ' + data + ' */' : '//# ' + data;
+	}; 
+} (convertSourceMap$1));
+
+var convertSourceMap = /*@__PURE__*/getDefaultExportFromCjs(convertSourceMap$1);
+
+const debug$g = createDebugger("vite:sourcemap", {
+  onlyWhenFocused: true
+});
+const virtualSourceRE = /^(?:dep:|browser-external:|virtual:)|\0/;
+async function computeSourceRoute(map, file) {
+  let sourceRoot;
+  try {
+    sourceRoot = await fsp.realpath(
+      path$n.resolve(path$n.dirname(file), map.sourceRoot || "")
+    );
+  } catch {
+  }
+  return sourceRoot;
+}
+async function injectSourcesContent(map, file, logger) {
+  let sourceRootPromise;
+  const missingSources = [];
+  const sourcesContent = map.sourcesContent || [];
+  const sourcesContentPromises = [];
+  for (let index = 0; index < map.sources.length; index++) {
+    const sourcePath = map.sources[index];
+    if (sourcesContent[index] == null && sourcePath && !virtualSourceRE.test(sourcePath)) {
+      sourcesContentPromises.push(
+        (async () => {
+          sourceRootPromise ??= computeSourceRoute(map, file);
+          const sourceRoot = await sourceRootPromise;
+          let resolvedSourcePath = cleanUrl(decodeURI(sourcePath));
+          if (sourceRoot) {
+            resolvedSourcePath = path$n.resolve(sourceRoot, resolvedSourcePath);
+          }
+          sourcesContent[index] = await fsp.readFile(resolvedSourcePath, "utf-8").catch(() => {
+            missingSources.push(resolvedSourcePath);
+            return null;
+          });
+        })()
+      );
+    }
+  }
+  await Promise.all(sourcesContentPromises);
+  map.sourcesContent = sourcesContent;
+  if (missingSources.length) {
+    logger.warnOnce(`Sourcemap for "${file}" points to missing source files`);
+    debug$g?.(`Missing sources:
+  ` + missingSources.join(`
+  `));
+  }
+}
+function genSourceMapUrl(map) {
+  if (typeof map !== "string") {
+    map = JSON.stringify(map);
+  }
+  return `data:application/json;base64,${Buffer.from(map).toString("base64")}`;
+}
+function getCodeWithSourcemap(type, code, map) {
+  if (debug$g) {
+    code += `
+/*${JSON.stringify(map, null, 2).replace(/\*\//g, "*\\/")}*/
+`;
+  }
+  if (type === "js") {
+    code += `
+//# sourceMappingURL=${genSourceMapUrl(map)}`;
+  } else if (type === "css") {
+    code += `
+/*# sourceMappingURL=${genSourceMapUrl(map)} */`;
+  }
+  return code;
+}
+function applySourcemapIgnoreList(map, sourcemapPath, sourcemapIgnoreList, logger) {
+  let { x_google_ignoreList } = map;
+  if (x_google_ignoreList === void 0) {
+    x_google_ignoreList = [];
+  }
+  for (let sourcesIndex = 0; sourcesIndex < map.sources.length; ++sourcesIndex) {
+    const sourcePath = map.sources[sourcesIndex];
+    if (!sourcePath) continue;
+    const ignoreList = sourcemapIgnoreList(
+      path$n.isAbsolute(sourcePath) ? sourcePath : path$n.resolve(path$n.dirname(sourcemapPath), sourcePath),
+      sourcemapPath
+    );
+    if (logger && typeof ignoreList !== "boolean") {
+      logger.warn("sourcemapIgnoreList function must return a boolean.");
+    }
+    if (ignoreList && !x_google_ignoreList.includes(sourcesIndex)) {
+      x_google_ignoreList.push(sourcesIndex);
+    }
+  }
+  if (x_google_ignoreList.length > 0) {
+    if (!map.x_google_ignoreList) map.x_google_ignoreList = x_google_ignoreList;
+  }
+}
+async function extractSourcemapFromFile(code, filePath) {
+  const map = (convertSourceMap.fromSource(code) || await convertSourceMap.fromMapFileSource(
+    code,
+    createConvertSourceMapReadMap(filePath)
+  ))?.toObject();
+  if (map) {
+    return {
+      code: code.replace(convertSourceMap.mapFileCommentRegex, blankReplacer),
+      map
+    };
+  }
+}
+function createConvertSourceMapReadMap(originalFileName) {
+  return (filename) => {
+    return fsp.readFile(
+      path$n.resolve(path$n.dirname(originalFileName), filename),
+      "utf-8"
+    );
+  };
+}
+
+var tasks = {};
+
+var utils$g = {};
+
+var array$1 = {};
+
+Object.defineProperty(array$1, "__esModule", { value: true });
+array$1.splitWhen = array$1.flatten = void 0;
+function flatten$1(items) {
+    return items.reduce((collection, item) => [].concat(collection, item), []);
+}
+array$1.flatten = flatten$1;
+function splitWhen(items, predicate) {
+    const result = [[]];
+    let groupIndex = 0;
+    for (const item of items) {
+        if (predicate(item)) {
+            groupIndex++;
+            result[groupIndex] = [];
+        }
+        else {
+            result[groupIndex].push(item);
+        }
+    }
+    return result;
+}
+array$1.splitWhen = splitWhen;
+
+var errno$1 = {};
+
+Object.defineProperty(errno$1, "__esModule", { value: true });
+errno$1.isEnoentCodeError = void 0;
+function isEnoentCodeError(error) {
+    return error.code === 'ENOENT';
+}
+errno$1.isEnoentCodeError = isEnoentCodeError;
+
+var fs$i = {};
+
+Object.defineProperty(fs$i, "__esModule", { value: true });
+fs$i.createDirentFromStats = void 0;
+let DirentFromStats$1 = class DirentFromStats {
+    constructor(name, stats) {
+        this.name = name;
+        this.isBlockDevice = stats.isBlockDevice.bind(stats);
+        this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
+        this.isDirectory = stats.isDirectory.bind(stats);
+        this.isFIFO = stats.isFIFO.bind(stats);
+        this.isFile = stats.isFile.bind(stats);
+        this.isSocket = stats.isSocket.bind(stats);
+        this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
+    }
+};
+function createDirentFromStats$1(name, stats) {
+    return new DirentFromStats$1(name, stats);
+}
+fs$i.createDirentFromStats = createDirentFromStats$1;
+
+var path$i = {};
+
+Object.defineProperty(path$i, "__esModule", { value: true });
+path$i.convertPosixPathToPattern = path$i.convertWindowsPathToPattern = path$i.convertPathToPattern = path$i.escapePosixPath = path$i.escapeWindowsPath = path$i.escape = path$i.removeLeadingDotSegment = path$i.makeAbsolute = path$i.unixify = void 0;
+const os$4 = require$$2;
+const path$h = require$$0$4;
+const IS_WINDOWS_PLATFORM = os$4.platform() === 'win32';
+const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
+/**
+ * All non-escaped special characters.
+ * Posix: ()*?[]{|}, !+@ before (, ! at the beginning, \\ before non-special characters.
+ * Windows: (){}[], !+@ before (, ! at the beginning.
+ */
+const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
+const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()[\]{}]|^!|[!+@](?=\())/g;
+/**
+ * The device path (\\.\ or \\?\).
+ * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths
+ */
+const DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
+/**
+ * All backslashes except those escaping special characters.
+ * Windows: !()+@{}
+ * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
+ */
+const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@[\]{}])/g;
+/**
+ * Designed to work only with simple paths: `dir\\file`.
+ */
+function unixify(filepath) {
+    return filepath.replace(/\\/g, '/');
+}
+path$i.unixify = unixify;
+function makeAbsolute(cwd, filepath) {
+    return path$h.resolve(cwd, filepath);
+}
+path$i.makeAbsolute = makeAbsolute;
+function removeLeadingDotSegment(entry) {
+    // We do not use `startsWith` because this is 10x slower than current implementation for some cases.
+    // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
+    if (entry.charAt(0) === '.') {
+        const secondCharactery = entry.charAt(1);
+        if (secondCharactery === '/' || secondCharactery === '\\') {
+            return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
+        }
+    }
+    return entry;
+}
+path$i.removeLeadingDotSegment = removeLeadingDotSegment;
+path$i.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
+function escapeWindowsPath(pattern) {
+    return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
+}
+path$i.escapeWindowsPath = escapeWindowsPath;
+function escapePosixPath(pattern) {
+    return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
+}
+path$i.escapePosixPath = escapePosixPath;
+path$i.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
+function convertWindowsPathToPattern(filepath) {
+    return escapeWindowsPath(filepath)
+        .replace(DOS_DEVICE_PATH_RE, '//$1')
+        .replace(WINDOWS_BACKSLASHES_RE, '/');
+}
+path$i.convertWindowsPathToPattern = convertWindowsPathToPattern;
+function convertPosixPathToPattern(filepath) {
+    return escapePosixPath(filepath);
+}
+path$i.convertPosixPathToPattern = convertPosixPathToPattern;
+
+var pattern$1 = {};
+
+/*!
+ * is-extglob 
+ *
+ * Copyright (c) 2014-2016, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+var isExtglob$1 = function isExtglob(str) {
+  if (typeof str !== 'string' || str === '') {
+    return false;
+  }
+
+  var match;
+  while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
+    if (match[2]) return true;
+    str = str.slice(match.index + match[0].length);
+  }
+
+  return false;
+};
+
+/*!
+ * is-glob 
+ *
+ * Copyright (c) 2014-2017, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+var isExtglob = isExtglob$1;
+var chars = { '{': '}', '(': ')', '[': ']'};
+var strictCheck = function(str) {
+  if (str[0] === '!') {
+    return true;
+  }
+  var index = 0;
+  var pipeIndex = -2;
+  var closeSquareIndex = -2;
+  var closeCurlyIndex = -2;
+  var closeParenIndex = -2;
+  var backSlashIndex = -2;
+  while (index < str.length) {
+    if (str[index] === '*') {
+      return true;
+    }
+
+    if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
+      return true;
+    }
+
+    if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
+      if (closeSquareIndex < index) {
+        closeSquareIndex = str.indexOf(']', index);
+      }
+      if (closeSquareIndex > index) {
+        if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
+          return true;
+        }
+        backSlashIndex = str.indexOf('\\', index);
+        if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
+          return true;
+        }
+      }
+    }
+
+    if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
+      closeCurlyIndex = str.indexOf('}', index);
+      if (closeCurlyIndex > index) {
+        backSlashIndex = str.indexOf('\\', index);
+        if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
+          return true;
+        }
+      }
+    }
+
+    if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
+      closeParenIndex = str.indexOf(')', index);
+      if (closeParenIndex > index) {
+        backSlashIndex = str.indexOf('\\', index);
+        if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
+          return true;
+        }
+      }
+    }
+
+    if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
+      if (pipeIndex < index) {
+        pipeIndex = str.indexOf('|', index);
+      }
+      if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
+        closeParenIndex = str.indexOf(')', pipeIndex);
+        if (closeParenIndex > pipeIndex) {
+          backSlashIndex = str.indexOf('\\', pipeIndex);
+          if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
+            return true;
+          }
+        }
+      }
+    }
+
+    if (str[index] === '\\') {
+      var open = str[index + 1];
+      index += 2;
+      var close = chars[open];
+
+      if (close) {
+        var n = str.indexOf(close, index);
+        if (n !== -1) {
+          index = n + 1;
+        }
+      }
+
+      if (str[index] === '!') {
+        return true;
+      }
+    } else {
+      index++;
+    }
+  }
+  return false;
+};
+
+var relaxedCheck = function(str) {
+  if (str[0] === '!') {
+    return true;
+  }
+  var index = 0;
+  while (index < str.length) {
+    if (/[*?{}()[\]]/.test(str[index])) {
+      return true;
+    }
+
+    if (str[index] === '\\') {
+      var open = str[index + 1];
+      index += 2;
+      var close = chars[open];
+
+      if (close) {
+        var n = str.indexOf(close, index);
+        if (n !== -1) {
+          index = n + 1;
+        }
+      }
+
+      if (str[index] === '!') {
+        return true;
+      }
+    } else {
+      index++;
+    }
+  }
+  return false;
+};
+
+var isGlob$2 = function isGlob(str, options) {
+  if (typeof str !== 'string' || str === '') {
+    return false;
+  }
+
+  if (isExtglob(str)) {
+    return true;
+  }
+
+  var check = strictCheck;
+
+  // optionally relax check
+  if (options && options.strict === false) {
+    check = relaxedCheck;
+  }
+
+  return check(str);
+};
+
+var isGlob$1 = isGlob$2;
+var pathPosixDirname = require$$0$4.posix.dirname;
+var isWin32 = require$$2.platform() === 'win32';
+
+var slash = '/';
+var backslash = /\\/g;
+var enclosure = /[\{\[].*[\}\]]$/;
+var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
+var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
+
+/**
+ * @param {string} str
+ * @param {Object} opts
+ * @param {boolean} [opts.flipBackslashes=true]
+ * @returns {string}
+ */
+var globParent$2 = function globParent(str, opts) {
+  var options = Object.assign({ flipBackslashes: true }, opts);
+
+  // flip windows path separators
+  if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
+    str = str.replace(backslash, slash);
+  }
+
+  // special case for strings ending in enclosure containing path separator
+  if (enclosure.test(str)) {
+    str += slash;
+  }
+
+  // preserves full path in case of trailing path separator
+  str += 'a';
+
+  // remove path parts that are globby
+  do {
+    str = pathPosixDirname(str);
+  } while (isGlob$1(str) || globby.test(str));
+
+  // remove escape chars and return result
+  return str.replace(escaped, '$1');
+};
+
+var utils$f = {};
+
+(function (exports) {
+
+	exports.isInteger = num => {
+	  if (typeof num === 'number') {
+	    return Number.isInteger(num);
+	  }
+	  if (typeof num === 'string' && num.trim() !== '') {
+	    return Number.isInteger(Number(num));
+	  }
+	  return false;
+	};
+
+	/**
+	 * Find a node of the given type
+	 */
+
+	exports.find = (node, type) => node.nodes.find(node => node.type === type);
+
+	/**
+	 * Find a node of the given type
+	 */
+
+	exports.exceedsLimit = (min, max, step = 1, limit) => {
+	  if (limit === false) return false;
+	  if (!exports.isInteger(min) || !exports.isInteger(max)) return false;
+	  return ((Number(max) - Number(min)) / Number(step)) >= limit;
+	};
+
+	/**
+	 * Escape the given node with '\\' before node.value
+	 */
+
+	exports.escapeNode = (block, n = 0, type) => {
+	  const node = block.nodes[n];
+	  if (!node) return;
+
+	  if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
+	    if (node.escaped !== true) {
+	      node.value = '\\' + node.value;
+	      node.escaped = true;
+	    }
+	  }
+	};
+
+	/**
+	 * Returns true if the given brace node should be enclosed in literal braces
+	 */
+
+	exports.encloseBrace = node => {
+	  if (node.type !== 'brace') return false;
+	  if ((node.commas >> 0 + node.ranges >> 0) === 0) {
+	    node.invalid = true;
+	    return true;
+	  }
+	  return false;
+	};
+
+	/**
+	 * Returns true if a brace node is invalid.
+	 */
+
+	exports.isInvalidBrace = block => {
+	  if (block.type !== 'brace') return false;
+	  if (block.invalid === true || block.dollar) return true;
+	  if ((block.commas >> 0 + block.ranges >> 0) === 0) {
+	    block.invalid = true;
+	    return true;
+	  }
+	  if (block.open !== true || block.close !== true) {
+	    block.invalid = true;
+	    return true;
+	  }
+	  return false;
+	};
+
+	/**
+	 * Returns true if a node is an open or close node
+	 */
+
+	exports.isOpenOrClose = node => {
+	  if (node.type === 'open' || node.type === 'close') {
+	    return true;
+	  }
+	  return node.open === true || node.close === true;
+	};
+
+	/**
+	 * Reduce an array of text nodes.
+	 */
+
+	exports.reduce = nodes => nodes.reduce((acc, node) => {
+	  if (node.type === 'text') acc.push(node.value);
+	  if (node.type === 'range') node.type = 'text';
+	  return acc;
+	}, []);
+
+	/**
+	 * Flatten an array
+	 */
+
+	exports.flatten = (...args) => {
+	  const result = [];
+
+	  const flat = arr => {
+	    for (let i = 0; i < arr.length; i++) {
+	      const ele = arr[i];
+
+	      if (Array.isArray(ele)) {
+	        flat(ele);
+	        continue;
+	      }
+
+	      if (ele !== undefined) {
+	        result.push(ele);
+	      }
+	    }
+	    return result;
+	  };
+
+	  flat(args);
+	  return result;
+	}; 
+} (utils$f));
+
+const utils$e = utils$f;
+
+var stringify$7 = (ast, options = {}) => {
+  const stringify = (node, parent = {}) => {
+    const invalidBlock = options.escapeInvalid && utils$e.isInvalidBrace(parent);
+    const invalidNode = node.invalid === true && options.escapeInvalid === true;
+    let output = '';
+
+    if (node.value) {
+      if ((invalidBlock || invalidNode) && utils$e.isOpenOrClose(node)) {
+        return '\\' + node.value;
+      }
+      return node.value;
+    }
+
+    if (node.value) {
+      return node.value;
+    }
+
+    if (node.nodes) {
+      for (const child of node.nodes) {
+        output += stringify(child);
+      }
+    }
+    return output;
+  };
+
+  return stringify(ast);
+};
+
+/*!
+ * is-number 
+ *
+ * Copyright (c) 2014-present, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+var isNumber$2 = function(num) {
+  if (typeof num === 'number') {
+    return num - num === 0;
+  }
+  if (typeof num === 'string' && num.trim() !== '') {
+    return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
+  }
+  return false;
+};
+
+/*!
+ * to-regex-range 
+ *
+ * Copyright (c) 2015-present, Jon Schlinkert.
+ * Released under the MIT License.
+ */
+
+const isNumber$1 = isNumber$2;
+
+const toRegexRange$1 = (min, max, options) => {
+  if (isNumber$1(min) === false) {
+    throw new TypeError('toRegexRange: expected the first argument to be a number');
+  }
+
+  if (max === void 0 || min === max) {
+    return String(min);
+  }
+
+  if (isNumber$1(max) === false) {
+    throw new TypeError('toRegexRange: expected the second argument to be a number.');
+  }
+
+  let opts = { relaxZeros: true, ...options };
+  if (typeof opts.strictZeros === 'boolean') {
+    opts.relaxZeros = opts.strictZeros === false;
+  }
+
+  let relax = String(opts.relaxZeros);
+  let shorthand = String(opts.shorthand);
+  let capture = String(opts.capture);
+  let wrap = String(opts.wrap);
+  let cacheKey = min + ':' + max + '=' + relax + shorthand + capture + wrap;
+
+  if (toRegexRange$1.cache.hasOwnProperty(cacheKey)) {
+    return toRegexRange$1.cache[cacheKey].result;
+  }
+
+  let a = Math.min(min, max);
+  let b = Math.max(min, max);
+
+  if (Math.abs(a - b) === 1) {
+    let result = min + '|' + max;
+    if (opts.capture) {
+      return `(${result})`;
+    }
+    if (opts.wrap === false) {
+      return result;
+    }
+    return `(?:${result})`;
+  }
+
+  let isPadded = hasPadding(min) || hasPadding(max);
+  let state = { min, max, a, b };
+  let positives = [];
+  let negatives = [];
+
+  if (isPadded) {
+    state.isPadded = isPadded;
+    state.maxLen = String(state.max).length;
+  }
+
+  if (a < 0) {
+    let newMin = b < 0 ? Math.abs(b) : 1;
+    negatives = splitToPatterns(newMin, Math.abs(a), state, opts);
+    a = state.a = 0;
+  }
+
+  if (b >= 0) {
+    positives = splitToPatterns(a, b, state, opts);
+  }
+
+  state.negatives = negatives;
+  state.positives = positives;
+  state.result = collatePatterns(negatives, positives);
+
+  if (opts.capture === true) {
+    state.result = `(${state.result})`;
+  } else if (opts.wrap !== false && (positives.length + negatives.length) > 1) {
+    state.result = `(?:${state.result})`;
+  }
+
+  toRegexRange$1.cache[cacheKey] = state;
+  return state.result;
+};
+
+function collatePatterns(neg, pos, options) {
+  let onlyNegative = filterPatterns(neg, pos, '-', false) || [];
+  let onlyPositive = filterPatterns(pos, neg, '', false) || [];
+  let intersected = filterPatterns(neg, pos, '-?', true) || [];
+  let subpatterns = onlyNegative.concat(intersected).concat(onlyPositive);
+  return subpatterns.join('|');
+}
+
+function splitToRanges(min, max) {
+  let nines = 1;
+  let zeros = 1;
+
+  let stop = countNines(min, nines);
+  let stops = new Set([max]);
+
+  while (min <= stop && stop <= max) {
+    stops.add(stop);
+    nines += 1;
+    stop = countNines(min, nines);
+  }
+
+  stop = countZeros(max + 1, zeros) - 1;
+
+  while (min < stop && stop <= max) {
+    stops.add(stop);
+    zeros += 1;
+    stop = countZeros(max + 1, zeros) - 1;
+  }
+
+  stops = [...stops];
+  stops.sort(compare);
+  return stops;
+}
+
+/**
+ * Convert a range to a regex pattern
+ * @param {Number} `start`
+ * @param {Number} `stop`
+ * @return {String}
+ */
+
+function rangeToPattern(start, stop, options) {
+  if (start === stop) {
+    return { pattern: start, count: [], digits: 0 };
+  }
+
+  let zipped = zip(start, stop);
+  let digits = zipped.length;
+  let pattern = '';
+  let count = 0;
+
+  for (let i = 0; i < digits; i++) {
+    let [startDigit, stopDigit] = zipped[i];
+
+    if (startDigit === stopDigit) {
+      pattern += startDigit;
+
+    } else if (startDigit !== '0' || stopDigit !== '9') {
+      pattern += toCharacterClass(startDigit, stopDigit);
+
+    } else {
+      count++;
+    }
+  }
+
+  if (count) {
+    pattern += options.shorthand === true ? '\\d' : '[0-9]';
+  }
+
+  return { pattern, count: [count], digits };
+}
+
+function splitToPatterns(min, max, tok, options) {
+  let ranges = splitToRanges(min, max);
+  let tokens = [];
+  let start = min;
+  let prev;
+
+  for (let i = 0; i < ranges.length; i++) {
+    let max = ranges[i];
+    let obj = rangeToPattern(String(start), String(max), options);
+    let zeros = '';
+
+    if (!tok.isPadded && prev && prev.pattern === obj.pattern) {
+      if (prev.count.length > 1) {
+        prev.count.pop();
+      }
+
+      prev.count.push(obj.count[0]);
+      prev.string = prev.pattern + toQuantifier(prev.count);
+      start = max + 1;
+      continue;
+    }
+
+    if (tok.isPadded) {
+      zeros = padZeros(max, tok, options);
+    }
+
+    obj.string = zeros + obj.pattern + toQuantifier(obj.count);
+    tokens.push(obj);
+    start = max + 1;
+    prev = obj;
+  }
+
+  return tokens;
+}
+
+function filterPatterns(arr, comparison, prefix, intersection, options) {
+  let result = [];
+
+  for (let ele of arr) {
+    let { string } = ele;
+
+    // only push if _both_ are negative...
+    if (!intersection && !contains(comparison, 'string', string)) {
+      result.push(prefix + string);
+    }
+
+    // or _both_ are positive
+    if (intersection && contains(comparison, 'string', string)) {
+      result.push(prefix + string);
+    }
+  }
+  return result;
+}
+
+/**
+ * Zip strings
+ */
+
+function zip(a, b) {
+  let arr = [];
+  for (let i = 0; i < a.length; i++) arr.push([a[i], b[i]]);
+  return arr;
+}
+
+function compare(a, b) {
+  return a > b ? 1 : b > a ? -1 : 0;
+}
+
+function contains(arr, key, val) {
+  return arr.some(ele => ele[key] === val);
+}
+
+function countNines(min, len) {
+  return Number(String(min).slice(0, -len) + '9'.repeat(len));
+}
+
+function countZeros(integer, zeros) {
+  return integer - (integer % Math.pow(10, zeros));
+}
+
+function toQuantifier(digits) {
+  let [start = 0, stop = ''] = digits;
+  if (stop || start > 1) {
+    return `{${start + (stop ? ',' + stop : '')}}`;
+  }
+  return '';
+}
+
+function toCharacterClass(a, b, options) {
+  return `[${a}${(b - a === 1) ? '' : '-'}${b}]`;
+}
+
+function hasPadding(str) {
+  return /^-?(0+)\d/.test(str);
+}
+
+function padZeros(value, tok, options) {
+  if (!tok.isPadded) {
+    return value;
+  }
+
+  let diff = Math.abs(tok.maxLen - String(value).length);
+  let relax = options.relaxZeros !== false;
+
+  switch (diff) {
+    case 0:
+      return '';
+    case 1:
+      return relax ? '0?' : '0';
+    case 2:
+      return relax ? '0{0,2}' : '00';
+    default: {
+      return relax ? `0{0,${diff}}` : `0{${diff}}`;
+    }
+  }
+}
+
+/**
+ * Cache
+ */
+
+toRegexRange$1.cache = {};
+toRegexRange$1.clearCache = () => (toRegexRange$1.cache = {});
+
+/**
+ * Expose `toRegexRange`
+ */
+
+var toRegexRange_1 = toRegexRange$1;
+
+/*!
+ * fill-range 
+ *
+ * Copyright (c) 2014-present, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+const util$1 = require$$0$5;
+const toRegexRange = toRegexRange_1;
+
+const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
+
+const transform = toNumber => {
+  return value => toNumber === true ? Number(value) : String(value);
+};
+
+const isValidValue = value => {
+  return typeof value === 'number' || (typeof value === 'string' && value !== '');
+};
+
+const isNumber = num => Number.isInteger(+num);
+
+const zeros = input => {
+  let value = `${input}`;
+  let index = -1;
+  if (value[0] === '-') value = value.slice(1);
+  if (value === '0') return false;
+  while (value[++index] === '0');
+  return index > 0;
+};
+
+const stringify$6 = (start, end, options) => {
+  if (typeof start === 'string' || typeof end === 'string') {
+    return true;
+  }
+  return options.stringify === true;
+};
+
+const pad = (input, maxLength, toNumber) => {
+  if (maxLength > 0) {
+    let dash = input[0] === '-' ? '-' : '';
+    if (dash) input = input.slice(1);
+    input = (dash + input.padStart(dash ? maxLength - 1 : maxLength, '0'));
+  }
+  if (toNumber === false) {
+    return String(input);
+  }
+  return input;
+};
+
+const toMaxLen = (input, maxLength) => {
+  let negative = input[0] === '-' ? '-' : '';
+  if (negative) {
+    input = input.slice(1);
+    maxLength--;
+  }
+  while (input.length < maxLength) input = '0' + input;
+  return negative ? ('-' + input) : input;
+};
+
+const toSequence = (parts, options, maxLen) => {
+  parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
+  parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
+
+  let prefix = options.capture ? '' : '?:';
+  let positives = '';
+  let negatives = '';
+  let result;
+
+  if (parts.positives.length) {
+    positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
+  }
+
+  if (parts.negatives.length) {
+    negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
+  }
+
+  if (positives && negatives) {
+    result = `${positives}|${negatives}`;
+  } else {
+    result = positives || negatives;
+  }
+
+  if (options.wrap) {
+    return `(${prefix}${result})`;
+  }
+
+  return result;
+};
+
+const toRange = (a, b, isNumbers, options) => {
+  if (isNumbers) {
+    return toRegexRange(a, b, { wrap: false, ...options });
+  }
+
+  let start = String.fromCharCode(a);
+  if (a === b) return start;
+
+  let stop = String.fromCharCode(b);
+  return `[${start}-${stop}]`;
+};
+
+const toRegex = (start, end, options) => {
+  if (Array.isArray(start)) {
+    let wrap = options.wrap === true;
+    let prefix = options.capture ? '' : '?:';
+    return wrap ? `(${prefix}${start.join('|')})` : start.join('|');
+  }
+  return toRegexRange(start, end, options);
+};
+
+const rangeError = (...args) => {
+  return new RangeError('Invalid range arguments: ' + util$1.inspect(...args));
+};
+
+const invalidRange = (start, end, options) => {
+  if (options.strictRanges === true) throw rangeError([start, end]);
+  return [];
+};
+
+const invalidStep = (step, options) => {
+  if (options.strictRanges === true) {
+    throw new TypeError(`Expected step "${step}" to be a number`);
+  }
+  return [];
+};
+
+const fillNumbers = (start, end, step = 1, options = {}) => {
+  let a = Number(start);
+  let b = Number(end);
+
+  if (!Number.isInteger(a) || !Number.isInteger(b)) {
+    if (options.strictRanges === true) throw rangeError([start, end]);
+    return [];
+  }
+
+  // fix negative zero
+  if (a === 0) a = 0;
+  if (b === 0) b = 0;
+
+  let descending = a > b;
+  let startString = String(start);
+  let endString = String(end);
+  let stepString = String(step);
+  step = Math.max(Math.abs(step), 1);
+
+  let padded = zeros(startString) || zeros(endString) || zeros(stepString);
+  let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
+  let toNumber = padded === false && stringify$6(start, end, options) === false;
+  let format = options.transform || transform(toNumber);
+
+  if (options.toRegex && step === 1) {
+    return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
+  }
+
+  let parts = { negatives: [], positives: [] };
+  let push = num => parts[num < 0 ? 'negatives' : 'positives'].push(Math.abs(num));
+  let range = [];
+  let index = 0;
+
+  while (descending ? a >= b : a <= b) {
+    if (options.toRegex === true && step > 1) {
+      push(a);
+    } else {
+      range.push(pad(format(a, index), maxLen, toNumber));
+    }
+    a = descending ? a - step : a + step;
+    index++;
+  }
+
+  if (options.toRegex === true) {
+    return step > 1
+      ? toSequence(parts, options, maxLen)
+      : toRegex(range, null, { wrap: false, ...options });
+  }
+
+  return range;
+};
+
+const fillLetters = (start, end, step = 1, options = {}) => {
+  if ((!isNumber(start) && start.length > 1) || (!isNumber(end) && end.length > 1)) {
+    return invalidRange(start, end, options);
+  }
+
+  let format = options.transform || (val => String.fromCharCode(val));
+  let a = `${start}`.charCodeAt(0);
+  let b = `${end}`.charCodeAt(0);
+
+  let descending = a > b;
+  let min = Math.min(a, b);
+  let max = Math.max(a, b);
+
+  if (options.toRegex && step === 1) {
+    return toRange(min, max, false, options);
+  }
+
+  let range = [];
+  let index = 0;
+
+  while (descending ? a >= b : a <= b) {
+    range.push(format(a, index));
+    a = descending ? a - step : a + step;
+    index++;
+  }
+
+  if (options.toRegex === true) {
+    return toRegex(range, null, { wrap: false, options });
+  }
+
+  return range;
+};
+
+const fill$2 = (start, end, step, options = {}) => {
+  if (end == null && isValidValue(start)) {
+    return [start];
+  }
+
+  if (!isValidValue(start) || !isValidValue(end)) {
+    return invalidRange(start, end, options);
+  }
+
+  if (typeof step === 'function') {
+    return fill$2(start, end, 1, { transform: step });
+  }
+
+  if (isObject(step)) {
+    return fill$2(start, end, 0, step);
+  }
+
+  let opts = { ...options };
+  if (opts.capture === true) opts.wrap = true;
+  step = step || opts.step || 1;
+
+  if (!isNumber(step)) {
+    if (step != null && !isObject(step)) return invalidStep(step, opts);
+    return fill$2(start, end, 1, step);
+  }
+
+  if (isNumber(start) && isNumber(end)) {
+    return fillNumbers(start, end, step, opts);
+  }
+
+  return fillLetters(start, end, Math.max(Math.abs(step), 1), opts);
+};
+
+var fillRange = fill$2;
+
+const fill$1 = fillRange;
+const utils$d = utils$f;
+
+const compile$1 = (ast, options = {}) => {
+  const walk = (node, parent = {}) => {
+    const invalidBlock = utils$d.isInvalidBrace(parent);
+    const invalidNode = node.invalid === true && options.escapeInvalid === true;
+    const invalid = invalidBlock === true || invalidNode === true;
+    const prefix = options.escapeInvalid === true ? '\\' : '';
+    let output = '';
+
+    if (node.isOpen === true) {
+      return prefix + node.value;
+    }
+
+    if (node.isClose === true) {
+      console.log('node.isClose', prefix, node.value);
+      return prefix + node.value;
+    }
+
+    if (node.type === 'open') {
+      return invalid ? prefix + node.value : '(';
+    }
+
+    if (node.type === 'close') {
+      return invalid ? prefix + node.value : ')';
+    }
+
+    if (node.type === 'comma') {
+      return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
+    }
+
+    if (node.value) {
+      return node.value;
+    }
+
+    if (node.nodes && node.ranges > 0) {
+      const args = utils$d.reduce(node.nodes);
+      const range = fill$1(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
+
+      if (range.length !== 0) {
+        return args.length > 1 && range.length > 1 ? `(${range})` : range;
+      }
+    }
+
+    if (node.nodes) {
+      for (const child of node.nodes) {
+        output += walk(child, node);
+      }
+    }
+
+    return output;
+  };
+
+  return walk(ast);
+};
+
+var compile_1 = compile$1;
+
+const fill = fillRange;
+const stringify$5 = stringify$7;
+const utils$c = utils$f;
+
+const append$1 = (queue = '', stash = '', enclose = false) => {
+  const result = [];
+
+  queue = [].concat(queue);
+  stash = [].concat(stash);
+
+  if (!stash.length) return queue;
+  if (!queue.length) {
+    return enclose ? utils$c.flatten(stash).map(ele => `{${ele}}`) : stash;
+  }
+
+  for (const item of queue) {
+    if (Array.isArray(item)) {
+      for (const value of item) {
+        result.push(append$1(value, stash, enclose));
+      }
+    } else {
+      for (let ele of stash) {
+        if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
+        result.push(Array.isArray(ele) ? append$1(item, ele, enclose) : item + ele);
+      }
+    }
+  }
+  return utils$c.flatten(result);
+};
+
+const expand$2 = (ast, options = {}) => {
+  const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
+
+  const walk = (node, parent = {}) => {
+    node.queue = [];
+
+    let p = parent;
+    let q = parent.queue;
+
+    while (p.type !== 'brace' && p.type !== 'root' && p.parent) {
+      p = p.parent;
+      q = p.queue;
+    }
+
+    if (node.invalid || node.dollar) {
+      q.push(append$1(q.pop(), stringify$5(node, options)));
+      return;
+    }
+
+    if (node.type === 'brace' && node.invalid !== true && node.nodes.length === 2) {
+      q.push(append$1(q.pop(), ['{}']));
+      return;
+    }
+
+    if (node.nodes && node.ranges > 0) {
+      const args = utils$c.reduce(node.nodes);
+
+      if (utils$c.exceedsLimit(...args, options.step, rangeLimit)) {
+        throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
+      }
+
+      let range = fill(...args, options);
+      if (range.length === 0) {
+        range = stringify$5(node, options);
+      }
+
+      q.push(append$1(q.pop(), range));
+      node.nodes = [];
+      return;
+    }
+
+    const enclose = utils$c.encloseBrace(node);
+    let queue = node.queue;
+    let block = node;
+
+    while (block.type !== 'brace' && block.type !== 'root' && block.parent) {
+      block = block.parent;
+      queue = block.queue;
+    }
+
+    for (let i = 0; i < node.nodes.length; i++) {
+      const child = node.nodes[i];
+
+      if (child.type === 'comma' && node.type === 'brace') {
+        if (i === 1) queue.push('');
+        queue.push('');
+        continue;
+      }
+
+      if (child.type === 'close') {
+        q.push(append$1(q.pop(), queue, enclose));
+        continue;
+      }
+
+      if (child.value && child.type !== 'open') {
+        queue.push(append$1(queue.pop(), child.value));
+        continue;
+      }
+
+      if (child.nodes) {
+        walk(child, node);
+      }
+    }
+
+    return queue;
+  };
+
+  return utils$c.flatten(walk(ast));
+};
+
+var expand_1$1 = expand$2;
+
+var constants$3 = {
+  MAX_LENGTH: 10000,
+
+  // Digits
+  CHAR_0: '0', /* 0 */
+  CHAR_9: '9', /* 9 */
+
+  // Alphabet chars.
+  CHAR_UPPERCASE_A: 'A', /* A */
+  CHAR_LOWERCASE_A: 'a', /* a */
+  CHAR_UPPERCASE_Z: 'Z', /* Z */
+  CHAR_LOWERCASE_Z: 'z', /* z */
+
+  CHAR_LEFT_PARENTHESES: '(', /* ( */
+  CHAR_RIGHT_PARENTHESES: ')', /* ) */
+
+  CHAR_ASTERISK: '*', /* * */
+
+  // Non-alphabetic chars.
+  CHAR_AMPERSAND: '&', /* & */
+  CHAR_AT: '@', /* @ */
+  CHAR_BACKSLASH: '\\', /* \ */
+  CHAR_BACKTICK: '`', /* ` */
+  CHAR_CARRIAGE_RETURN: '\r', /* \r */
+  CHAR_CIRCUMFLEX_ACCENT: '^', /* ^ */
+  CHAR_COLON: ':', /* : */
+  CHAR_COMMA: ',', /* , */
+  CHAR_DOLLAR: '$', /* . */
+  CHAR_DOT: '.', /* . */
+  CHAR_DOUBLE_QUOTE: '"', /* " */
+  CHAR_EQUAL: '=', /* = */
+  CHAR_EXCLAMATION_MARK: '!', /* ! */
+  CHAR_FORM_FEED: '\f', /* \f */
+  CHAR_FORWARD_SLASH: '/', /* / */
+  CHAR_HASH: '#', /* # */
+  CHAR_HYPHEN_MINUS: '-', /* - */
+  CHAR_LEFT_ANGLE_BRACKET: '<', /* < */
+  CHAR_LEFT_CURLY_BRACE: '{', /* { */
+  CHAR_LEFT_SQUARE_BRACKET: '[', /* [ */
+  CHAR_LINE_FEED: '\n', /* \n */
+  CHAR_NO_BREAK_SPACE: '\u00A0', /* \u00A0 */
+  CHAR_PERCENT: '%', /* % */
+  CHAR_PLUS: '+', /* + */
+  CHAR_QUESTION_MARK: '?', /* ? */
+  CHAR_RIGHT_ANGLE_BRACKET: '>', /* > */
+  CHAR_RIGHT_CURLY_BRACE: '}', /* } */
+  CHAR_RIGHT_SQUARE_BRACKET: ']', /* ] */
+  CHAR_SEMICOLON: ';', /* ; */
+  CHAR_SINGLE_QUOTE: '\'', /* ' */
+  CHAR_SPACE: ' ', /*   */
+  CHAR_TAB: '\t', /* \t */
+  CHAR_UNDERSCORE: '_', /* _ */
+  CHAR_VERTICAL_LINE: '|', /* | */
+  CHAR_ZERO_WIDTH_NOBREAK_SPACE: '\uFEFF' /* \uFEFF */
+};
+
+const stringify$4 = stringify$7;
+
+/**
+ * Constants
+ */
+
+const {
+  MAX_LENGTH,
+  CHAR_BACKSLASH, /* \ */
+  CHAR_BACKTICK, /* ` */
+  CHAR_COMMA, /* , */
+  CHAR_DOT, /* . */
+  CHAR_LEFT_PARENTHESES, /* ( */
+  CHAR_RIGHT_PARENTHESES, /* ) */
+  CHAR_LEFT_CURLY_BRACE, /* { */
+  CHAR_RIGHT_CURLY_BRACE, /* } */
+  CHAR_LEFT_SQUARE_BRACKET, /* [ */
+  CHAR_RIGHT_SQUARE_BRACKET, /* ] */
+  CHAR_DOUBLE_QUOTE, /* " */
+  CHAR_SINGLE_QUOTE, /* ' */
+  CHAR_NO_BREAK_SPACE,
+  CHAR_ZERO_WIDTH_NOBREAK_SPACE
+} = constants$3;
+
+/**
+ * parse
+ */
+
+const parse$c = (input, options = {}) => {
+  if (typeof input !== 'string') {
+    throw new TypeError('Expected a string');
+  }
+
+  const opts = options || {};
+  const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+  if (input.length > max) {
+    throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
+  }
+
+  const ast = { type: 'root', input, nodes: [] };
+  const stack = [ast];
+  let block = ast;
+  let prev = ast;
+  let brackets = 0;
+  const length = input.length;
+  let index = 0;
+  let depth = 0;
+  let value;
+
+  /**
+   * Helpers
+   */
+
+  const advance = () => input[index++];
+  const push = node => {
+    if (node.type === 'text' && prev.type === 'dot') {
+      prev.type = 'text';
+    }
+
+    if (prev && prev.type === 'text' && node.type === 'text') {
+      prev.value += node.value;
+      return;
+    }
+
+    block.nodes.push(node);
+    node.parent = block;
+    node.prev = prev;
+    prev = node;
+    return node;
+  };
+
+  push({ type: 'bos' });
+
+  while (index < length) {
+    block = stack[stack.length - 1];
+    value = advance();
+
+    /**
+     * Invalid chars
+     */
+
+    if (value === CHAR_ZERO_WIDTH_NOBREAK_SPACE || value === CHAR_NO_BREAK_SPACE) {
+      continue;
+    }
+
+    /**
+     * Escaped chars
+     */
+
+    if (value === CHAR_BACKSLASH) {
+      push({ type: 'text', value: (options.keepEscaping ? value : '') + advance() });
+      continue;
+    }
+
+    /**
+     * Right square bracket (literal): ']'
+     */
+
+    if (value === CHAR_RIGHT_SQUARE_BRACKET) {
+      push({ type: 'text', value: '\\' + value });
+      continue;
+    }
+
+    /**
+     * Left square bracket: '['
+     */
+
+    if (value === CHAR_LEFT_SQUARE_BRACKET) {
+      brackets++;
+
+      let next;
+
+      while (index < length && (next = advance())) {
+        value += next;
+
+        if (next === CHAR_LEFT_SQUARE_BRACKET) {
+          brackets++;
+          continue;
+        }
+
+        if (next === CHAR_BACKSLASH) {
+          value += advance();
+          continue;
+        }
+
+        if (next === CHAR_RIGHT_SQUARE_BRACKET) {
+          brackets--;
+
+          if (brackets === 0) {
+            break;
+          }
+        }
+      }
+
+      push({ type: 'text', value });
+      continue;
+    }
+
+    /**
+     * Parentheses
+     */
+
+    if (value === CHAR_LEFT_PARENTHESES) {
+      block = push({ type: 'paren', nodes: [] });
+      stack.push(block);
+      push({ type: 'text', value });
+      continue;
+    }
+
+    if (value === CHAR_RIGHT_PARENTHESES) {
+      if (block.type !== 'paren') {
+        push({ type: 'text', value });
+        continue;
+      }
+      block = stack.pop();
+      push({ type: 'text', value });
+      block = stack[stack.length - 1];
+      continue;
+    }
+
+    /**
+     * Quotes: '|"|`
+     */
+
+    if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
+      const open = value;
+      let next;
+
+      if (options.keepQuotes !== true) {
+        value = '';
+      }
+
+      while (index < length && (next = advance())) {
+        if (next === CHAR_BACKSLASH) {
+          value += next + advance();
+          continue;
+        }
+
+        if (next === open) {
+          if (options.keepQuotes === true) value += next;
+          break;
+        }
+
+        value += next;
+      }
+
+      push({ type: 'text', value });
+      continue;
+    }
+
+    /**
+     * Left curly brace: '{'
+     */
+
+    if (value === CHAR_LEFT_CURLY_BRACE) {
+      depth++;
+
+      const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
+      const brace = {
+        type: 'brace',
+        open: true,
+        close: false,
+        dollar,
+        depth,
+        commas: 0,
+        ranges: 0,
+        nodes: []
+      };
+
+      block = push(brace);
+      stack.push(block);
+      push({ type: 'open', value });
+      continue;
+    }
+
+    /**
+     * Right curly brace: '}'
+     */
+
+    if (value === CHAR_RIGHT_CURLY_BRACE) {
+      if (block.type !== 'brace') {
+        push({ type: 'text', value });
+        continue;
+      }
+
+      const type = 'close';
+      block = stack.pop();
+      block.close = true;
+
+      push({ type, value });
+      depth--;
+
+      block = stack[stack.length - 1];
+      continue;
+    }
+
+    /**
+     * Comma: ','
+     */
+
+    if (value === CHAR_COMMA && depth > 0) {
+      if (block.ranges > 0) {
+        block.ranges = 0;
+        const open = block.nodes.shift();
+        block.nodes = [open, { type: 'text', value: stringify$4(block) }];
+      }
+
+      push({ type: 'comma', value });
+      block.commas++;
+      continue;
+    }
+
+    /**
+     * Dot: '.'
+     */
+
+    if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
+      const siblings = block.nodes;
+
+      if (depth === 0 || siblings.length === 0) {
+        push({ type: 'text', value });
+        continue;
+      }
+
+      if (prev.type === 'dot') {
+        block.range = [];
+        prev.value += value;
+        prev.type = 'range';
+
+        if (block.nodes.length !== 3 && block.nodes.length !== 5) {
+          block.invalid = true;
+          block.ranges = 0;
+          prev.type = 'text';
+          continue;
+        }
+
+        block.ranges++;
+        block.args = [];
+        continue;
+      }
+
+      if (prev.type === 'range') {
+        siblings.pop();
+
+        const before = siblings[siblings.length - 1];
+        before.value += prev.value + value;
+        prev = before;
+        block.ranges--;
+        continue;
+      }
+
+      push({ type: 'dot', value });
+      continue;
+    }
+
+    /**
+     * Text
+     */
+
+    push({ type: 'text', value });
+  }
+
+  // Mark imbalanced braces and brackets as invalid
+  do {
+    block = stack.pop();
+
+    if (block.type !== 'root') {
+      block.nodes.forEach(node => {
+        if (!node.nodes) {
+          if (node.type === 'open') node.isOpen = true;
+          if (node.type === 'close') node.isClose = true;
+          if (!node.nodes) node.type = 'text';
+          node.invalid = true;
+        }
+      });
+
+      // get the location of the block on parent.nodes (block's siblings)
+      const parent = stack[stack.length - 1];
+      const index = parent.nodes.indexOf(block);
+      // replace the (invalid) block with it's nodes
+      parent.nodes.splice(index, 1, ...block.nodes);
+    }
+  } while (stack.length > 0);
+
+  push({ type: 'eos' });
+  return ast;
+};
+
+var parse_1$2 = parse$c;
+
+const stringify$3 = stringify$7;
+const compile = compile_1;
+const expand$1 = expand_1$1;
+const parse$b = parse_1$2;
+
+/**
+ * Expand the given pattern or create a regex-compatible string.
+ *
+ * ```js
+ * const braces = require('braces');
+ * console.log(braces('{a,b,c}', { compile: true })); //=> ['(a|b|c)']
+ * console.log(braces('{a,b,c}')); //=> ['a', 'b', 'c']
+ * ```
+ * @param {String} `str`
+ * @param {Object} `options`
+ * @return {String}
+ * @api public
+ */
+
+const braces$2 = (input, options = {}) => {
+  let output = [];
+
+  if (Array.isArray(input)) {
+    for (const pattern of input) {
+      const result = braces$2.create(pattern, options);
+      if (Array.isArray(result)) {
+        output.push(...result);
+      } else {
+        output.push(result);
+      }
+    }
+  } else {
+    output = [].concat(braces$2.create(input, options));
+  }
+
+  if (options && options.expand === true && options.nodupes === true) {
+    output = [...new Set(output)];
+  }
+  return output;
+};
+
+/**
+ * Parse the given `str` with the given `options`.
+ *
+ * ```js
+ * // braces.parse(pattern, [, options]);
+ * const ast = braces.parse('a/{b,c}/d');
+ * console.log(ast);
+ * ```
+ * @param {String} pattern Brace pattern to parse
+ * @param {Object} options
+ * @return {Object} Returns an AST
+ * @api public
+ */
+
+braces$2.parse = (input, options = {}) => parse$b(input, options);
+
+/**
+ * Creates a braces string from an AST, or an AST node.
+ *
+ * ```js
+ * const braces = require('braces');
+ * let ast = braces.parse('foo/{a,b}/bar');
+ * console.log(stringify(ast.nodes[2])); //=> '{a,b}'
+ * ```
+ * @param {String} `input` Brace pattern or AST.
+ * @param {Object} `options`
+ * @return {Array} Returns an array of expanded values.
+ * @api public
+ */
+
+braces$2.stringify = (input, options = {}) => {
+  if (typeof input === 'string') {
+    return stringify$3(braces$2.parse(input, options), options);
+  }
+  return stringify$3(input, options);
+};
+
+/**
+ * Compiles a brace pattern into a regex-compatible, optimized string.
+ * This method is called by the main [braces](#braces) function by default.
+ *
+ * ```js
+ * const braces = require('braces');
+ * console.log(braces.compile('a/{b,c}/d'));
+ * //=> ['a/(b|c)/d']
+ * ```
+ * @param {String} `input` Brace pattern or AST.
+ * @param {Object} `options`
+ * @return {Array} Returns an array of expanded values.
+ * @api public
+ */
+
+braces$2.compile = (input, options = {}) => {
+  if (typeof input === 'string') {
+    input = braces$2.parse(input, options);
+  }
+  return compile(input, options);
+};
+
+/**
+ * Expands a brace pattern into an array. This method is called by the
+ * main [braces](#braces) function when `options.expand` is true. Before
+ * using this method it's recommended that you read the [performance notes](#performance))
+ * and advantages of using [.compile](#compile) instead.
+ *
+ * ```js
+ * const braces = require('braces');
+ * console.log(braces.expand('a/{b,c}/d'));
+ * //=> ['a/b/d', 'a/c/d'];
+ * ```
+ * @param {String} `pattern` Brace pattern
+ * @param {Object} `options`
+ * @return {Array} Returns an array of expanded values.
+ * @api public
+ */
+
+braces$2.expand = (input, options = {}) => {
+  if (typeof input === 'string') {
+    input = braces$2.parse(input, options);
+  }
+
+  let result = expand$1(input, options);
+
+  // filter out empty strings if specified
+  if (options.noempty === true) {
+    result = result.filter(Boolean);
+  }
+
+  // filter out duplicates if specified
+  if (options.nodupes === true) {
+    result = [...new Set(result)];
+  }
+
+  return result;
+};
+
+/**
+ * Processes a brace pattern and returns either an expanded array
+ * (if `options.expand` is true), a highly optimized regex-compatible string.
+ * This method is called by the main [braces](#braces) function.
+ *
+ * ```js
+ * const braces = require('braces');
+ * console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
+ * //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
+ * ```
+ * @param {String} `pattern` Brace pattern
+ * @param {Object} `options`
+ * @return {Array} Returns an array of expanded values.
+ * @api public
+ */
+
+braces$2.create = (input, options = {}) => {
+  if (input === '' || input.length < 3) {
+    return [input];
+  }
+
+  return options.expand !== true
+    ? braces$2.compile(input, options)
+    : braces$2.expand(input, options);
+};
+
+/**
+ * Expose "braces"
+ */
+
+var braces_1 = braces$2;
+
+const util = require$$0$5;
+const braces$1 = braces_1;
+const picomatch$2 = picomatch$3;
+const utils$b = utils$k;
+
+const isEmptyString = v => v === '' || v === './';
+const hasBraces = v => {
+  const index = v.indexOf('{');
+  return index > -1 && v.indexOf('}', index) > -1;
+};
+
+/**
+ * Returns an array of strings that match one or more glob patterns.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm(list, patterns[, options]);
+ *
+ * console.log(mm(['a.js', 'a.txt'], ['*.js']));
+ * //=> [ 'a.js' ]
+ * ```
+ * @param {String|Array} `list` List of strings to match.
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
+ * @param {Object} `options` See available [options](#options)
+ * @return {Array} Returns an array of matches
+ * @summary false
+ * @api public
+ */
+
+const micromatch$1 = (list, patterns, options) => {
+  patterns = [].concat(patterns);
+  list = [].concat(list);
+
+  let omit = new Set();
+  let keep = new Set();
+  let items = new Set();
+  let negatives = 0;
+
+  let onResult = state => {
+    items.add(state.output);
+    if (options && options.onResult) {
+      options.onResult(state);
+    }
+  };
+
+  for (let i = 0; i < patterns.length; i++) {
+    let isMatch = picomatch$2(String(patterns[i]), { ...options, onResult }, true);
+    let negated = isMatch.state.negated || isMatch.state.negatedExtglob;
+    if (negated) negatives++;
+
+    for (let item of list) {
+      let matched = isMatch(item, true);
+
+      let match = negated ? !matched.isMatch : matched.isMatch;
+      if (!match) continue;
+
+      if (negated) {
+        omit.add(matched.output);
+      } else {
+        omit.delete(matched.output);
+        keep.add(matched.output);
+      }
+    }
+  }
+
+  let result = negatives === patterns.length ? [...items] : [...keep];
+  let matches = result.filter(item => !omit.has(item));
+
+  if (options && matches.length === 0) {
+    if (options.failglob === true) {
+      throw new Error(`No matches found for "${patterns.join(', ')}"`);
+    }
+
+    if (options.nonull === true || options.nullglob === true) {
+      return options.unescape ? patterns.map(p => p.replace(/\\/g, '')) : patterns;
+    }
+  }
+
+  return matches;
+};
+
+/**
+ * Backwards compatibility
+ */
+
+micromatch$1.match = micromatch$1;
+
+/**
+ * Returns a matcher function from the given glob `pattern` and `options`.
+ * The returned function takes a string to match as its only argument and returns
+ * true if the string is a match.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.matcher(pattern[, options]);
+ *
+ * const isMatch = mm.matcher('*.!(*a)');
+ * console.log(isMatch('a.a')); //=> false
+ * console.log(isMatch('a.b')); //=> true
+ * ```
+ * @param {String} `pattern` Glob pattern
+ * @param {Object} `options`
+ * @return {Function} Returns a matcher function.
+ * @api public
+ */
+
+micromatch$1.matcher = (pattern, options) => picomatch$2(pattern, options);
+
+/**
+ * Returns true if **any** of the given glob `patterns` match the specified `string`.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.isMatch(string, patterns[, options]);
+ *
+ * console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
+ * console.log(mm.isMatch('a.a', 'b.*')); //=> false
+ * ```
+ * @param {String} `str` The string to test.
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
+ * @param {Object} `[options]` See available [options](#options).
+ * @return {Boolean} Returns true if any patterns match `str`
+ * @api public
+ */
+
+micromatch$1.isMatch = (str, patterns, options) => picomatch$2(patterns, options)(str);
+
+/**
+ * Backwards compatibility
+ */
+
+micromatch$1.any = micromatch$1.isMatch;
+
+/**
+ * Returns a list of strings that _**do not match any**_ of the given `patterns`.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.not(list, patterns[, options]);
+ *
+ * console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
+ * //=> ['b.b', 'c.c']
+ * ```
+ * @param {Array} `list` Array of strings to match.
+ * @param {String|Array} `patterns` One or more glob pattern to use for matching.
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
+ * @return {Array} Returns an array of strings that **do not match** the given patterns.
+ * @api public
+ */
+
+micromatch$1.not = (list, patterns, options = {}) => {
+  patterns = [].concat(patterns).map(String);
+  let result = new Set();
+  let items = [];
+
+  let onResult = state => {
+    if (options.onResult) options.onResult(state);
+    items.push(state.output);
+  };
+
+  let matches = new Set(micromatch$1(list, patterns, { ...options, onResult }));
+
+  for (let item of items) {
+    if (!matches.has(item)) {
+      result.add(item);
+    }
+  }
+  return [...result];
+};
+
+/**
+ * Returns true if the given `string` contains the given pattern. Similar
+ * to [.isMatch](#isMatch) but the pattern can match any part of the string.
+ *
+ * ```js
+ * var mm = require('micromatch');
+ * // mm.contains(string, pattern[, options]);
+ *
+ * console.log(mm.contains('aa/bb/cc', '*b'));
+ * //=> true
+ * console.log(mm.contains('aa/bb/cc', '*d'));
+ * //=> false
+ * ```
+ * @param {String} `str` The string to match.
+ * @param {String|Array} `patterns` Glob pattern to use for matching.
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
+ * @return {Boolean} Returns true if any of the patterns matches any part of `str`.
+ * @api public
+ */
+
+micromatch$1.contains = (str, pattern, options) => {
+  if (typeof str !== 'string') {
+    throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
+  }
+
+  if (Array.isArray(pattern)) {
+    return pattern.some(p => micromatch$1.contains(str, p, options));
+  }
+
+  if (typeof pattern === 'string') {
+    if (isEmptyString(str) || isEmptyString(pattern)) {
+      return false;
+    }
+
+    if (str.includes(pattern) || (str.startsWith('./') && str.slice(2).includes(pattern))) {
+      return true;
+    }
+  }
+
+  return micromatch$1.isMatch(str, pattern, { ...options, contains: true });
+};
+
+/**
+ * Filter the keys of the given object with the given `glob` pattern
+ * and `options`. Does not attempt to match nested keys. If you need this feature,
+ * use [glob-object][] instead.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.matchKeys(object, patterns[, options]);
+ *
+ * const obj = { aa: 'a', ab: 'b', ac: 'c' };
+ * console.log(mm.matchKeys(obj, '*b'));
+ * //=> { ab: 'b' }
+ * ```
+ * @param {Object} `object` The object with keys to filter.
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
+ * @return {Object} Returns an object with only keys that match the given patterns.
+ * @api public
+ */
+
+micromatch$1.matchKeys = (obj, patterns, options) => {
+  if (!utils$b.isObject(obj)) {
+    throw new TypeError('Expected the first argument to be an object');
+  }
+  let keys = micromatch$1(Object.keys(obj), patterns, options);
+  let res = {};
+  for (let key of keys) res[key] = obj[key];
+  return res;
+};
+
+/**
+ * Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.some(list, patterns[, options]);
+ *
+ * console.log(mm.some(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
+ * // true
+ * console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
+ * // false
+ * ```
+ * @param {String|Array} `list` The string or array of strings to test. Returns as soon as the first match is found.
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
+ * @return {Boolean} Returns true if any `patterns` matches any of the strings in `list`
+ * @api public
+ */
+
+micromatch$1.some = (list, patterns, options) => {
+  let items = [].concat(list);
+
+  for (let pattern of [].concat(patterns)) {
+    let isMatch = picomatch$2(String(pattern), options);
+    if (items.some(item => isMatch(item))) {
+      return true;
+    }
+  }
+  return false;
+};
+
+/**
+ * Returns true if every string in the given `list` matches
+ * any of the given glob `patterns`.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.every(list, patterns[, options]);
+ *
+ * console.log(mm.every('foo.js', ['foo.js']));
+ * // true
+ * console.log(mm.every(['foo.js', 'bar.js'], ['*.js']));
+ * // true
+ * console.log(mm.every(['foo.js', 'bar.js'], ['*.js', '!foo.js']));
+ * // false
+ * console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
+ * // false
+ * ```
+ * @param {String|Array} `list` The string or array of strings to test.
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
+ * @return {Boolean} Returns true if all `patterns` matches all of the strings in `list`
+ * @api public
+ */
+
+micromatch$1.every = (list, patterns, options) => {
+  let items = [].concat(list);
+
+  for (let pattern of [].concat(patterns)) {
+    let isMatch = picomatch$2(String(pattern), options);
+    if (!items.every(item => isMatch(item))) {
+      return false;
+    }
+  }
+  return true;
+};
+
+/**
+ * Returns true if **all** of the given `patterns` match
+ * the specified string.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.all(string, patterns[, options]);
+ *
+ * console.log(mm.all('foo.js', ['foo.js']));
+ * // true
+ *
+ * console.log(mm.all('foo.js', ['*.js', '!foo.js']));
+ * // false
+ *
+ * console.log(mm.all('foo.js', ['*.js', 'foo.js']));
+ * // true
+ *
+ * console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
+ * // true
+ * ```
+ * @param {String|Array} `str` The string to test.
+ * @param {String|Array} `patterns` One or more glob patterns to use for matching.
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
+ * @return {Boolean} Returns true if any patterns match `str`
+ * @api public
+ */
+
+micromatch$1.all = (str, patterns, options) => {
+  if (typeof str !== 'string') {
+    throw new TypeError(`Expected a string: "${util.inspect(str)}"`);
+  }
+
+  return [].concat(patterns).every(p => picomatch$2(p, options)(str));
+};
+
+/**
+ * Returns an array of matches captured by `pattern` in `string, or `null` if the pattern did not match.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.capture(pattern, string[, options]);
+ *
+ * console.log(mm.capture('test/*.js', 'test/foo.js'));
+ * //=> ['foo']
+ * console.log(mm.capture('test/*.js', 'foo/bar.css'));
+ * //=> null
+ * ```
+ * @param {String} `glob` Glob pattern to use for matching.
+ * @param {String} `input` String to match
+ * @param {Object} `options` See available [options](#options) for changing how matches are performed
+ * @return {Array|null} Returns an array of captures if the input matches the glob pattern, otherwise `null`.
+ * @api public
+ */
+
+micromatch$1.capture = (glob, input, options) => {
+  let posix = utils$b.isWindows(options);
+  let regex = picomatch$2.makeRe(String(glob), { ...options, capture: true });
+  let match = regex.exec(posix ? utils$b.toPosixSlashes(input) : input);
+
+  if (match) {
+    return match.slice(1).map(v => v === void 0 ? '' : v);
+  }
+};
+
+/**
+ * Create a regular expression from the given glob `pattern`.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * // mm.makeRe(pattern[, options]);
+ *
+ * console.log(mm.makeRe('*.js'));
+ * //=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
+ * ```
+ * @param {String} `pattern` A glob pattern to convert to regex.
+ * @param {Object} `options`
+ * @return {RegExp} Returns a regex created from the given pattern.
+ * @api public
+ */
+
+micromatch$1.makeRe = (...args) => picomatch$2.makeRe(...args);
+
+/**
+ * Scan a glob pattern to separate the pattern into segments. Used
+ * by the [split](#split) method.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * const state = mm.scan(pattern[, options]);
+ * ```
+ * @param {String} `pattern`
+ * @param {Object} `options`
+ * @return {Object} Returns an object with
+ * @api public
+ */
+
+micromatch$1.scan = (...args) => picomatch$2.scan(...args);
+
+/**
+ * Parse a glob pattern to create the source string for a regular
+ * expression.
+ *
+ * ```js
+ * const mm = require('micromatch');
+ * const state = mm.parse(pattern[, options]);
+ * ```
+ * @param {String} `glob`
+ * @param {Object} `options`
+ * @return {Object} Returns an object with useful properties and output to be used as regex source string.
+ * @api public
+ */
+
+micromatch$1.parse = (patterns, options) => {
+  let res = [];
+  for (let pattern of [].concat(patterns || [])) {
+    for (let str of braces$1(String(pattern), options)) {
+      res.push(picomatch$2.parse(str, options));
+    }
+  }
+  return res;
+};
+
+/**
+ * Process the given brace `pattern`.
+ *
+ * ```js
+ * const { braces } = require('micromatch');
+ * console.log(braces('foo/{a,b,c}/bar'));
+ * //=> [ 'foo/(a|b|c)/bar' ]
+ *
+ * console.log(braces('foo/{a,b,c}/bar', { expand: true }));
+ * //=> [ 'foo/a/bar', 'foo/b/bar', 'foo/c/bar' ]
+ * ```
+ * @param {String} `pattern` String with brace pattern to process.
+ * @param {Object} `options` Any [options](#options) to change how expansion is performed. See the [braces][] library for all available options.
+ * @return {Array}
+ * @api public
+ */
+
+micromatch$1.braces = (pattern, options) => {
+  if (typeof pattern !== 'string') throw new TypeError('Expected a string');
+  if ((options && options.nobrace === true) || !hasBraces(pattern)) {
+    return [pattern];
+  }
+  return braces$1(pattern, options);
+};
+
+/**
+ * Expand braces
+ */
+
+micromatch$1.braceExpand = (pattern, options) => {
+  if (typeof pattern !== 'string') throw new TypeError('Expected a string');
+  return micromatch$1.braces(pattern, { ...options, expand: true });
+};
+
+/**
+ * Expose micromatch
+ */
+
+// exposed for tests
+micromatch$1.hasBraces = hasBraces;
+var micromatch_1 = micromatch$1;
+
+var micromatch$2 = /*@__PURE__*/getDefaultExportFromCjs(micromatch_1);
+
+Object.defineProperty(pattern$1, "__esModule", { value: true });
+pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
+const path$g = require$$0$4;
+const globParent$1 = globParent$2;
+const micromatch = micromatch_1;
+const GLOBSTAR$1 = '**';
+const ESCAPE_SYMBOL = '\\';
+const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
+const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
+const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
+const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
+const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
+/**
+ * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
+ * The latter is due to the presence of the device path at the beginning of the UNC path.
+ */
+const DOUBLE_SLASH_RE$1 = /(?!^)\/{2,}/g;
+function isStaticPattern(pattern, options = {}) {
+    return !isDynamicPattern(pattern, options);
+}
+pattern$1.isStaticPattern = isStaticPattern;
+function isDynamicPattern(pattern, options = {}) {
+    /**
+     * A special case with an empty string is necessary for matching patterns that start with a forward slash.
+     * An empty string cannot be a dynamic pattern.
+     * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
+     */
+    if (pattern === '') {
+        return false;
+    }
+    /**
+     * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
+     * filepath directly (without read directory).
+     */
+    if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
+        return true;
+    }
+    if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
+        return true;
+    }
+    if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
+        return true;
+    }
+    if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
+        return true;
+    }
+    return false;
+}
+pattern$1.isDynamicPattern = isDynamicPattern;
+function hasBraceExpansion(pattern) {
+    const openingBraceIndex = pattern.indexOf('{');
+    if (openingBraceIndex === -1) {
+        return false;
+    }
+    const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1);
+    if (closingBraceIndex === -1) {
+        return false;
+    }
+    const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
+    return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
+}
+function convertToPositivePattern(pattern) {
+    return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
+}
+pattern$1.convertToPositivePattern = convertToPositivePattern;
+function convertToNegativePattern(pattern) {
+    return '!' + pattern;
+}
+pattern$1.convertToNegativePattern = convertToNegativePattern;
+function isNegativePattern(pattern) {
+    return pattern.startsWith('!') && pattern[1] !== '(';
+}
+pattern$1.isNegativePattern = isNegativePattern;
+function isPositivePattern(pattern) {
+    return !isNegativePattern(pattern);
+}
+pattern$1.isPositivePattern = isPositivePattern;
+function getNegativePatterns(patterns) {
+    return patterns.filter(isNegativePattern);
+}
+pattern$1.getNegativePatterns = getNegativePatterns;
+function getPositivePatterns$1(patterns) {
+    return patterns.filter(isPositivePattern);
+}
+pattern$1.getPositivePatterns = getPositivePatterns$1;
+/**
+ * Returns patterns that can be applied inside the current directory.
+ *
+ * @example
+ * // ['./*', '*', 'a/*']
+ * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
+ */
+function getPatternsInsideCurrentDirectory(patterns) {
+    return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
+}
+pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
+/**
+ * Returns patterns to be expanded relative to (outside) the current directory.
+ *
+ * @example
+ * // ['../*', './../*']
+ * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
+ */
+function getPatternsOutsideCurrentDirectory(patterns) {
+    return patterns.filter(isPatternRelatedToParentDirectory);
+}
+pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
+function isPatternRelatedToParentDirectory(pattern) {
+    return pattern.startsWith('..') || pattern.startsWith('./..');
+}
+pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
+function getBaseDirectory(pattern) {
+    return globParent$1(pattern, { flipBackslashes: false });
+}
+pattern$1.getBaseDirectory = getBaseDirectory;
+function hasGlobStar(pattern) {
+    return pattern.includes(GLOBSTAR$1);
+}
+pattern$1.hasGlobStar = hasGlobStar;
+function endsWithSlashGlobStar(pattern) {
+    return pattern.endsWith('/' + GLOBSTAR$1);
+}
+pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
+function isAffectDepthOfReadingPattern(pattern) {
+    const basename = path$g.basename(pattern);
+    return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
+}
+pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
+function expandPatternsWithBraceExpansion(patterns) {
+    return patterns.reduce((collection, pattern) => {
+        return collection.concat(expandBraceExpansion(pattern));
+    }, []);
+}
+pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
+function expandBraceExpansion(pattern) {
+    const patterns = micromatch.braces(pattern, { expand: true, nodupes: true, keepEscaping: true });
+    /**
+     * Sort the patterns by length so that the same depth patterns are processed side by side.
+     * `a/{b,}/{c,}/*` – `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']`
+     */
+    patterns.sort((a, b) => a.length - b.length);
+    /**
+     * Micromatch can return an empty string in the case of patterns like `{a,}`.
+     */
+    return patterns.filter((pattern) => pattern !== '');
+}
+pattern$1.expandBraceExpansion = expandBraceExpansion;
+function getPatternParts(pattern, options) {
+    let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
+    /**
+     * The scan method returns an empty array in some cases.
+     * See micromatch/picomatch#58 for more details.
+     */
+    if (parts.length === 0) {
+        parts = [pattern];
+    }
+    /**
+     * The scan method does not return an empty part for the pattern with a forward slash.
+     * This is another part of micromatch/picomatch#58.
+     */
+    if (parts[0].startsWith('/')) {
+        parts[0] = parts[0].slice(1);
+        parts.unshift('');
+    }
+    return parts;
+}
+pattern$1.getPatternParts = getPatternParts;
+function makeRe(pattern, options) {
+    return micromatch.makeRe(pattern, options);
+}
+pattern$1.makeRe = makeRe;
+function convertPatternsToRe(patterns, options) {
+    return patterns.map((pattern) => makeRe(pattern, options));
+}
+pattern$1.convertPatternsToRe = convertPatternsToRe;
+function matchAny(entry, patternsRe) {
+    return patternsRe.some((patternRe) => patternRe.test(entry));
+}
+pattern$1.matchAny = matchAny;
+/**
+ * This package only works with forward slashes as a path separator.
+ * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
+ */
+function removeDuplicateSlashes(pattern) {
+    return pattern.replace(DOUBLE_SLASH_RE$1, '/');
+}
+pattern$1.removeDuplicateSlashes = removeDuplicateSlashes;
+
+var stream$4 = {};
+
+/*
+ * merge2
+ * https://github.com/teambition/merge2
+ *
+ * Copyright (c) 2014-2020 Teambition
+ * Licensed under the MIT license.
+ */
+const Stream = require$$0$6;
+const PassThrough = Stream.PassThrough;
+const slice = Array.prototype.slice;
+
+var merge2_1 = merge2$1;
+
+function merge2$1 () {
+  const streamsQueue = [];
+  const args = slice.call(arguments);
+  let merging = false;
+  let options = args[args.length - 1];
+
+  if (options && !Array.isArray(options) && options.pipe == null) {
+    args.pop();
+  } else {
+    options = {};
+  }
+
+  const doEnd = options.end !== false;
+  const doPipeError = options.pipeError === true;
+  if (options.objectMode == null) {
+    options.objectMode = true;
+  }
+  if (options.highWaterMark == null) {
+    options.highWaterMark = 64 * 1024;
+  }
+  const mergedStream = PassThrough(options);
+
+  function addStream () {
+    for (let i = 0, len = arguments.length; i < len; i++) {
+      streamsQueue.push(pauseStreams(arguments[i], options));
+    }
+    mergeStream();
+    return this
+  }
+
+  function mergeStream () {
+    if (merging) {
+      return
+    }
+    merging = true;
+
+    let streams = streamsQueue.shift();
+    if (!streams) {
+      process.nextTick(endStream);
+      return
+    }
+    if (!Array.isArray(streams)) {
+      streams = [streams];
+    }
+
+    let pipesCount = streams.length + 1;
+
+    function next () {
+      if (--pipesCount > 0) {
+        return
+      }
+      merging = false;
+      mergeStream();
+    }
+
+    function pipe (stream) {
+      function onend () {
+        stream.removeListener('merge2UnpipeEnd', onend);
+        stream.removeListener('end', onend);
+        if (doPipeError) {
+          stream.removeListener('error', onerror);
+        }
+        next();
+      }
+      function onerror (err) {
+        mergedStream.emit('error', err);
+      }
+      // skip ended stream
+      if (stream._readableState.endEmitted) {
+        return next()
+      }
+
+      stream.on('merge2UnpipeEnd', onend);
+      stream.on('end', onend);
+
+      if (doPipeError) {
+        stream.on('error', onerror);
+      }
+
+      stream.pipe(mergedStream, { end: false });
+      // compatible for old stream
+      stream.resume();
+    }
+
+    for (let i = 0; i < streams.length; i++) {
+      pipe(streams[i]);
+    }
+
+    next();
+  }
+
+  function endStream () {
+    merging = false;
+    // emit 'queueDrain' when all streams merged.
+    mergedStream.emit('queueDrain');
+    if (doEnd) {
+      mergedStream.end();
+    }
+  }
+
+  mergedStream.setMaxListeners(0);
+  mergedStream.add = addStream;
+  mergedStream.on('unpipe', function (stream) {
+    stream.emit('merge2UnpipeEnd');
+  });
+
+  if (args.length) {
+    addStream.apply(null, args);
+  }
+  return mergedStream
+}
+
+// check and pause streams for pipe.
+function pauseStreams (streams, options) {
+  if (!Array.isArray(streams)) {
+    // Backwards-compat with old-style streams
+    if (!streams._readableState && streams.pipe) {
+      streams = streams.pipe(PassThrough(options));
+    }
+    if (!streams._readableState || !streams.pause || !streams.pipe) {
+      throw new Error('Only readable stream can be merged.')
+    }
+    streams.pause();
+  } else {
+    for (let i = 0, len = streams.length; i < len; i++) {
+      streams[i] = pauseStreams(streams[i], options);
+    }
+  }
+  return streams
+}
+
+Object.defineProperty(stream$4, "__esModule", { value: true });
+stream$4.merge = void 0;
+const merge2 = merge2_1;
+function merge$1(streams) {
+    const mergedStream = merge2(streams);
+    streams.forEach((stream) => {
+        stream.once('error', (error) => mergedStream.emit('error', error));
+    });
+    mergedStream.once('close', () => propagateCloseEventToSources(streams));
+    mergedStream.once('end', () => propagateCloseEventToSources(streams));
+    return mergedStream;
+}
+stream$4.merge = merge$1;
+function propagateCloseEventToSources(streams) {
+    streams.forEach((stream) => stream.emit('close'));
+}
+
+var string$2 = {};
+
+Object.defineProperty(string$2, "__esModule", { value: true });
+string$2.isEmpty = string$2.isString = void 0;
+function isString$1(input) {
+    return typeof input === 'string';
+}
+string$2.isString = isString$1;
+function isEmpty$1(input) {
+    return input === '';
+}
+string$2.isEmpty = isEmpty$1;
+
+Object.defineProperty(utils$g, "__esModule", { value: true });
+utils$g.string = utils$g.stream = utils$g.pattern = utils$g.path = utils$g.fs = utils$g.errno = utils$g.array = void 0;
+const array = array$1;
+utils$g.array = array;
+const errno = errno$1;
+utils$g.errno = errno;
+const fs$h = fs$i;
+utils$g.fs = fs$h;
+const path$f = path$i;
+utils$g.path = path$f;
+const pattern = pattern$1;
+utils$g.pattern = pattern;
+const stream$3 = stream$4;
+utils$g.stream = stream$3;
+const string$1 = string$2;
+utils$g.string = string$1;
+
+Object.defineProperty(tasks, "__esModule", { value: true });
+tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0;
+const utils$a = utils$g;
+function generate(input, settings) {
+    const patterns = processPatterns(input, settings);
+    const ignore = processPatterns(settings.ignore, settings);
+    const positivePatterns = getPositivePatterns(patterns);
+    const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
+    const staticPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isStaticPattern(pattern, settings));
+    const dynamicPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isDynamicPattern(pattern, settings));
+    const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
+    const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
+    return staticTasks.concat(dynamicTasks);
+}
+tasks.generate = generate;
+function processPatterns(input, settings) {
+    let patterns = input;
+    /**
+     * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry
+     * and some problems with the micromatch package (see fast-glob issues: #365, #394).
+     *
+     * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown
+     * in matching in the case of a large set of patterns after expansion.
+     */
+    if (settings.braceExpansion) {
+        patterns = utils$a.pattern.expandPatternsWithBraceExpansion(patterns);
+    }
+    /**
+     * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used
+     * at any nesting level.
+     *
+     * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change
+     * the pattern in the filter before creating a regular expression. There is no need to change the patterns
+     * in the application. Only on the input.
+     */
+    if (settings.baseNameMatch) {
+        patterns = patterns.map((pattern) => pattern.includes('/') ? pattern : `**/${pattern}`);
+    }
+    /**
+     * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion.
+     */
+    return patterns.map((pattern) => utils$a.pattern.removeDuplicateSlashes(pattern));
+}
+/**
+ * Returns tasks grouped by basic pattern directories.
+ *
+ * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
+ * This is necessary because directory traversal starts at the base directory and goes deeper.
+ */
+function convertPatternsToTasks(positive, negative, dynamic) {
+    const tasks = [];
+    const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive);
+    const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive);
+    const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
+    const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
+    tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
+    /*
+     * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory
+     * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest.
+     */
+    if ('.' in insideCurrentDirectoryGroup) {
+        tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic));
+    }
+    else {
+        tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
+    }
+    return tasks;
+}
+tasks.convertPatternsToTasks = convertPatternsToTasks;
+function getPositivePatterns(patterns) {
+    return utils$a.pattern.getPositivePatterns(patterns);
+}
+tasks.getPositivePatterns = getPositivePatterns;
+function getNegativePatternsAsPositive(patterns, ignore) {
+    const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore);
+    const positive = negative.map(utils$a.pattern.convertToPositivePattern);
+    return positive;
+}
+tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
+function groupPatternsByBaseDirectory(patterns) {
+    const group = {};
+    return patterns.reduce((collection, pattern) => {
+        const base = utils$a.pattern.getBaseDirectory(pattern);
+        if (base in collection) {
+            collection[base].push(pattern);
+        }
+        else {
+            collection[base] = [pattern];
+        }
+        return collection;
+    }, group);
+}
+tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
+function convertPatternGroupsToTasks(positive, negative, dynamic) {
+    return Object.keys(positive).map((base) => {
+        return convertPatternGroupToTask(base, positive[base], negative, dynamic);
+    });
+}
+tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
+function convertPatternGroupToTask(base, positive, negative, dynamic) {
+    return {
+        dynamic,
+        positive,
+        negative,
+        base,
+        patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern))
+    };
+}
+tasks.convertPatternGroupToTask = convertPatternGroupToTask;
+
+var async$7 = {};
+
+var async$6 = {};
+
+var out$3 = {};
+
+var async$5 = {};
+
+var async$4 = {};
+
+var out$2 = {};
+
+var async$3 = {};
+
+var out$1 = {};
+
+var async$2 = {};
+
+Object.defineProperty(async$2, "__esModule", { value: true });
+async$2.read = void 0;
+function read$3(path, settings, callback) {
+    settings.fs.lstat(path, (lstatError, lstat) => {
+        if (lstatError !== null) {
+            callFailureCallback$2(callback, lstatError);
+            return;
+        }
+        if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
+            callSuccessCallback$2(callback, lstat);
+            return;
+        }
+        settings.fs.stat(path, (statError, stat) => {
+            if (statError !== null) {
+                if (settings.throwErrorOnBrokenSymbolicLink) {
+                    callFailureCallback$2(callback, statError);
+                    return;
+                }
+                callSuccessCallback$2(callback, lstat);
+                return;
+            }
+            if (settings.markSymbolicLink) {
+                stat.isSymbolicLink = () => true;
+            }
+            callSuccessCallback$2(callback, stat);
+        });
+    });
+}
+async$2.read = read$3;
+function callFailureCallback$2(callback, error) {
+    callback(error);
+}
+function callSuccessCallback$2(callback, result) {
+    callback(null, result);
+}
+
+var sync$8 = {};
+
+Object.defineProperty(sync$8, "__esModule", { value: true });
+sync$8.read = void 0;
+function read$2(path, settings) {
+    const lstat = settings.fs.lstatSync(path);
+    if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
+        return lstat;
+    }
+    try {
+        const stat = settings.fs.statSync(path);
+        if (settings.markSymbolicLink) {
+            stat.isSymbolicLink = () => true;
+        }
+        return stat;
+    }
+    catch (error) {
+        if (!settings.throwErrorOnBrokenSymbolicLink) {
+            return lstat;
+        }
+        throw error;
+    }
+}
+sync$8.read = read$2;
+
+var settings$3 = {};
+
+var fs$g = {};
+
+(function (exports) {
+	Object.defineProperty(exports, "__esModule", { value: true });
+	exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
+	const fs = require$$0__default;
+	exports.FILE_SYSTEM_ADAPTER = {
+	    lstat: fs.lstat,
+	    stat: fs.stat,
+	    lstatSync: fs.lstatSync,
+	    statSync: fs.statSync
+	};
+	function createFileSystemAdapter(fsMethods) {
+	    if (fsMethods === undefined) {
+	        return exports.FILE_SYSTEM_ADAPTER;
+	    }
+	    return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
+	}
+	exports.createFileSystemAdapter = createFileSystemAdapter; 
+} (fs$g));
+
+Object.defineProperty(settings$3, "__esModule", { value: true });
+const fs$f = fs$g;
+let Settings$2 = class Settings {
+    constructor(_options = {}) {
+        this._options = _options;
+        this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
+        this.fs = fs$f.createFileSystemAdapter(this._options.fs);
+        this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
+        this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
+    }
+    _getValue(option, value) {
+        return option !== null && option !== void 0 ? option : value;
+    }
+};
+settings$3.default = Settings$2;
+
+Object.defineProperty(out$1, "__esModule", { value: true });
+out$1.statSync = out$1.stat = out$1.Settings = void 0;
+const async$1 = async$2;
+const sync$7 = sync$8;
+const settings_1$3 = settings$3;
+out$1.Settings = settings_1$3.default;
+function stat$4(path, optionsOrSettingsOrCallback, callback) {
+    if (typeof optionsOrSettingsOrCallback === 'function') {
+        async$1.read(path, getSettings$2(), optionsOrSettingsOrCallback);
+        return;
+    }
+    async$1.read(path, getSettings$2(optionsOrSettingsOrCallback), callback);
+}
+out$1.stat = stat$4;
+function statSync(path, optionsOrSettings) {
+    const settings = getSettings$2(optionsOrSettings);
+    return sync$7.read(path, settings);
+}
+out$1.statSync = statSync;
+function getSettings$2(settingsOrOptions = {}) {
+    if (settingsOrOptions instanceof settings_1$3.default) {
+        return settingsOrOptions;
+    }
+    return new settings_1$3.default(settingsOrOptions);
+}
+
+/*! queue-microtask. MIT License. Feross Aboukhadijeh  */
+
+let promise;
+
+var queueMicrotask_1 = typeof queueMicrotask === 'function'
+  ? queueMicrotask.bind(typeof window !== 'undefined' ? window : commonjsGlobal)
+  // reuse resolved promise, and allocate it lazily
+  : cb => (promise || (promise = Promise.resolve()))
+    .then(cb)
+    .catch(err => setTimeout(() => { throw err }, 0));
+
+/*! run-parallel. MIT License. Feross Aboukhadijeh  */
+
+var runParallel_1 = runParallel;
+
+const queueMicrotask$1 = queueMicrotask_1;
+
+function runParallel (tasks, cb) {
+  let results, pending, keys;
+  let isSync = true;
+
+  if (Array.isArray(tasks)) {
+    results = [];
+    pending = tasks.length;
+  } else {
+    keys = Object.keys(tasks);
+    results = {};
+    pending = keys.length;
+  }
+
+  function done (err) {
+    function end () {
+      if (cb) cb(err, results);
+      cb = null;
+    }
+    if (isSync) queueMicrotask$1(end);
+    else end();
+  }
+
+  function each (i, err, result) {
+    results[i] = result;
+    if (--pending === 0 || err) {
+      done(err);
+    }
+  }
+
+  if (!pending) {
+    // empty
+    done(null);
+  } else if (keys) {
+    // object
+    keys.forEach(function (key) {
+      tasks[key](function (err, result) { each(key, err, result); });
+    });
+  } else {
+    // array
+    tasks.forEach(function (task, i) {
+      task(function (err, result) { each(i, err, result); });
+    });
+  }
+
+  isSync = false;
+}
+
+var constants$2 = {};
+
+Object.defineProperty(constants$2, "__esModule", { value: true });
+constants$2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = void 0;
+const NODE_PROCESS_VERSION_PARTS = process.versions.node.split('.');
+if (NODE_PROCESS_VERSION_PARTS[0] === undefined || NODE_PROCESS_VERSION_PARTS[1] === undefined) {
+    throw new Error(`Unexpected behavior. The 'process.versions.node' variable has invalid value: ${process.versions.node}`);
+}
+const MAJOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[0], 10);
+const MINOR_VERSION = Number.parseInt(NODE_PROCESS_VERSION_PARTS[1], 10);
+const SUPPORTED_MAJOR_VERSION = 10;
+const SUPPORTED_MINOR_VERSION = 10;
+const IS_MATCHED_BY_MAJOR = MAJOR_VERSION > SUPPORTED_MAJOR_VERSION;
+const IS_MATCHED_BY_MAJOR_AND_MINOR = MAJOR_VERSION === SUPPORTED_MAJOR_VERSION && MINOR_VERSION >= SUPPORTED_MINOR_VERSION;
+/**
+ * IS `true` for Node.js 10.10 and greater.
+ */
+constants$2.IS_SUPPORT_READDIR_WITH_FILE_TYPES = IS_MATCHED_BY_MAJOR || IS_MATCHED_BY_MAJOR_AND_MINOR;
+
+var utils$9 = {};
+
+var fs$e = {};
+
+Object.defineProperty(fs$e, "__esModule", { value: true });
+fs$e.createDirentFromStats = void 0;
+class DirentFromStats {
+    constructor(name, stats) {
+        this.name = name;
+        this.isBlockDevice = stats.isBlockDevice.bind(stats);
+        this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
+        this.isDirectory = stats.isDirectory.bind(stats);
+        this.isFIFO = stats.isFIFO.bind(stats);
+        this.isFile = stats.isFile.bind(stats);
+        this.isSocket = stats.isSocket.bind(stats);
+        this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
+    }
+}
+function createDirentFromStats(name, stats) {
+    return new DirentFromStats(name, stats);
+}
+fs$e.createDirentFromStats = createDirentFromStats;
+
+Object.defineProperty(utils$9, "__esModule", { value: true });
+utils$9.fs = void 0;
+const fs$d = fs$e;
+utils$9.fs = fs$d;
+
+var common$a = {};
+
+Object.defineProperty(common$a, "__esModule", { value: true });
+common$a.joinPathSegments = void 0;
+function joinPathSegments$1(a, b, separator) {
+    /**
+     * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
+     */
+    if (a.endsWith(separator)) {
+        return a + b;
+    }
+    return a + separator + b;
+}
+common$a.joinPathSegments = joinPathSegments$1;
+
+Object.defineProperty(async$3, "__esModule", { value: true });
+async$3.readdir = async$3.readdirWithFileTypes = async$3.read = void 0;
+const fsStat$5 = out$1;
+const rpl = runParallel_1;
+const constants_1$1 = constants$2;
+const utils$8 = utils$9;
+const common$9 = common$a;
+function read$1(directory, settings, callback) {
+    if (!settings.stats && constants_1$1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
+        readdirWithFileTypes$1(directory, settings, callback);
+        return;
+    }
+    readdir$3(directory, settings, callback);
+}
+async$3.read = read$1;
+function readdirWithFileTypes$1(directory, settings, callback) {
+    settings.fs.readdir(directory, { withFileTypes: true }, (readdirError, dirents) => {
+        if (readdirError !== null) {
+            callFailureCallback$1(callback, readdirError);
+            return;
+        }
+        const entries = dirents.map((dirent) => ({
+            dirent,
+            name: dirent.name,
+            path: common$9.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
+        }));
+        if (!settings.followSymbolicLinks) {
+            callSuccessCallback$1(callback, entries);
+            return;
+        }
+        const tasks = entries.map((entry) => makeRplTaskEntry(entry, settings));
+        rpl(tasks, (rplError, rplEntries) => {
+            if (rplError !== null) {
+                callFailureCallback$1(callback, rplError);
+                return;
+            }
+            callSuccessCallback$1(callback, rplEntries);
+        });
+    });
+}
+async$3.readdirWithFileTypes = readdirWithFileTypes$1;
+function makeRplTaskEntry(entry, settings) {
+    return (done) => {
+        if (!entry.dirent.isSymbolicLink()) {
+            done(null, entry);
+            return;
+        }
+        settings.fs.stat(entry.path, (statError, stats) => {
+            if (statError !== null) {
+                if (settings.throwErrorOnBrokenSymbolicLink) {
+                    done(statError);
+                    return;
+                }
+                done(null, entry);
+                return;
+            }
+            entry.dirent = utils$8.fs.createDirentFromStats(entry.name, stats);
+            done(null, entry);
+        });
+    };
+}
+function readdir$3(directory, settings, callback) {
+    settings.fs.readdir(directory, (readdirError, names) => {
+        if (readdirError !== null) {
+            callFailureCallback$1(callback, readdirError);
+            return;
+        }
+        const tasks = names.map((name) => {
+            const path = common$9.joinPathSegments(directory, name, settings.pathSegmentSeparator);
+            return (done) => {
+                fsStat$5.stat(path, settings.fsStatSettings, (error, stats) => {
+                    if (error !== null) {
+                        done(error);
+                        return;
+                    }
+                    const entry = {
+                        name,
+                        path,
+                        dirent: utils$8.fs.createDirentFromStats(name, stats)
+                    };
+                    if (settings.stats) {
+                        entry.stats = stats;
+                    }
+                    done(null, entry);
+                });
+            };
+        });
+        rpl(tasks, (rplError, entries) => {
+            if (rplError !== null) {
+                callFailureCallback$1(callback, rplError);
+                return;
+            }
+            callSuccessCallback$1(callback, entries);
+        });
+    });
+}
+async$3.readdir = readdir$3;
+function callFailureCallback$1(callback, error) {
+    callback(error);
+}
+function callSuccessCallback$1(callback, result) {
+    callback(null, result);
+}
+
+var sync$6 = {};
+
+Object.defineProperty(sync$6, "__esModule", { value: true });
+sync$6.readdir = sync$6.readdirWithFileTypes = sync$6.read = void 0;
+const fsStat$4 = out$1;
+const constants_1 = constants$2;
+const utils$7 = utils$9;
+const common$8 = common$a;
+function read(directory, settings) {
+    if (!settings.stats && constants_1.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
+        return readdirWithFileTypes(directory, settings);
+    }
+    return readdir$2(directory, settings);
+}
+sync$6.read = read;
+function readdirWithFileTypes(directory, settings) {
+    const dirents = settings.fs.readdirSync(directory, { withFileTypes: true });
+    return dirents.map((dirent) => {
+        const entry = {
+            dirent,
+            name: dirent.name,
+            path: common$8.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
+        };
+        if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) {
+            try {
+                const stats = settings.fs.statSync(entry.path);
+                entry.dirent = utils$7.fs.createDirentFromStats(entry.name, stats);
+            }
+            catch (error) {
+                if (settings.throwErrorOnBrokenSymbolicLink) {
+                    throw error;
+                }
+            }
+        }
+        return entry;
+    });
+}
+sync$6.readdirWithFileTypes = readdirWithFileTypes;
+function readdir$2(directory, settings) {
+    const names = settings.fs.readdirSync(directory);
+    return names.map((name) => {
+        const entryPath = common$8.joinPathSegments(directory, name, settings.pathSegmentSeparator);
+        const stats = fsStat$4.statSync(entryPath, settings.fsStatSettings);
+        const entry = {
+            name,
+            path: entryPath,
+            dirent: utils$7.fs.createDirentFromStats(name, stats)
+        };
+        if (settings.stats) {
+            entry.stats = stats;
+        }
+        return entry;
+    });
+}
+sync$6.readdir = readdir$2;
+
+var settings$2 = {};
+
+var fs$c = {};
+
+(function (exports) {
+	Object.defineProperty(exports, "__esModule", { value: true });
+	exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
+	const fs = require$$0__default;
+	exports.FILE_SYSTEM_ADAPTER = {
+	    lstat: fs.lstat,
+	    stat: fs.stat,
+	    lstatSync: fs.lstatSync,
+	    statSync: fs.statSync,
+	    readdir: fs.readdir,
+	    readdirSync: fs.readdirSync
+	};
+	function createFileSystemAdapter(fsMethods) {
+	    if (fsMethods === undefined) {
+	        return exports.FILE_SYSTEM_ADAPTER;
+	    }
+	    return Object.assign(Object.assign({}, exports.FILE_SYSTEM_ADAPTER), fsMethods);
+	}
+	exports.createFileSystemAdapter = createFileSystemAdapter; 
+} (fs$c));
+
+Object.defineProperty(settings$2, "__esModule", { value: true });
+const path$e = require$$0$4;
+const fsStat$3 = out$1;
+const fs$b = fs$c;
+let Settings$1 = class Settings {
+    constructor(_options = {}) {
+        this._options = _options;
+        this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
+        this.fs = fs$b.createFileSystemAdapter(this._options.fs);
+        this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$e.sep);
+        this.stats = this._getValue(this._options.stats, false);
+        this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
+        this.fsStatSettings = new fsStat$3.Settings({
+            followSymbolicLink: this.followSymbolicLinks,
+            fs: this.fs,
+            throwErrorOnBrokenSymbolicLink: this.throwErrorOnBrokenSymbolicLink
+        });
+    }
+    _getValue(option, value) {
+        return option !== null && option !== void 0 ? option : value;
+    }
+};
+settings$2.default = Settings$1;
+
+Object.defineProperty(out$2, "__esModule", { value: true });
+out$2.Settings = out$2.scandirSync = out$2.scandir = void 0;
+const async = async$3;
+const sync$5 = sync$6;
+const settings_1$2 = settings$2;
+out$2.Settings = settings_1$2.default;
+function scandir(path, optionsOrSettingsOrCallback, callback) {
+    if (typeof optionsOrSettingsOrCallback === 'function') {
+        async.read(path, getSettings$1(), optionsOrSettingsOrCallback);
+        return;
+    }
+    async.read(path, getSettings$1(optionsOrSettingsOrCallback), callback);
+}
+out$2.scandir = scandir;
+function scandirSync(path, optionsOrSettings) {
+    const settings = getSettings$1(optionsOrSettings);
+    return sync$5.read(path, settings);
+}
+out$2.scandirSync = scandirSync;
+function getSettings$1(settingsOrOptions = {}) {
+    if (settingsOrOptions instanceof settings_1$2.default) {
+        return settingsOrOptions;
+    }
+    return new settings_1$2.default(settingsOrOptions);
+}
+
+var queue = {exports: {}};
+
+function reusify$1 (Constructor) {
+  var head = new Constructor();
+  var tail = head;
+
+  function get () {
+    var current = head;
+
+    if (current.next) {
+      head = current.next;
+    } else {
+      head = new Constructor();
+      tail = head;
+    }
+
+    current.next = null;
+
+    return current
+  }
+
+  function release (obj) {
+    tail.next = obj;
+    tail = obj;
+  }
+
+  return {
+    get: get,
+    release: release
+  }
+}
+
+var reusify_1 = reusify$1;
+
+/* eslint-disable no-var */
+
+var reusify = reusify_1;
+
+function fastqueue (context, worker, _concurrency) {
+  if (typeof context === 'function') {
+    _concurrency = worker;
+    worker = context;
+    context = null;
+  }
+
+  if (!(_concurrency >= 1)) {
+    throw new Error('fastqueue concurrency must be equal to or greater than 1')
+  }
+
+  var cache = reusify(Task);
+  var queueHead = null;
+  var queueTail = null;
+  var _running = 0;
+  var errorHandler = null;
+
+  var self = {
+    push: push,
+    drain: noop$4,
+    saturated: noop$4,
+    pause: pause,
+    paused: false,
+
+    get concurrency () {
+      return _concurrency
+    },
+    set concurrency (value) {
+      if (!(value >= 1)) {
+        throw new Error('fastqueue concurrency must be equal to or greater than 1')
+      }
+      _concurrency = value;
+
+      if (self.paused) return
+      for (; queueHead && _running < _concurrency;) {
+        _running++;
+        release();
+      }
+    },
+
+    running: running,
+    resume: resume,
+    idle: idle,
+    length: length,
+    getQueue: getQueue,
+    unshift: unshift,
+    empty: noop$4,
+    kill: kill,
+    killAndDrain: killAndDrain,
+    error: error
+  };
+
+  return self
+
+  function running () {
+    return _running
+  }
+
+  function pause () {
+    self.paused = true;
+  }
+
+  function length () {
+    var current = queueHead;
+    var counter = 0;
+
+    while (current) {
+      current = current.next;
+      counter++;
+    }
+
+    return counter
+  }
+
+  function getQueue () {
+    var current = queueHead;
+    var tasks = [];
+
+    while (current) {
+      tasks.push(current.value);
+      current = current.next;
+    }
+
+    return tasks
+  }
+
+  function resume () {
+    if (!self.paused) return
+    self.paused = false;
+    if (queueHead === null) {
+      _running++;
+      release();
+      return
+    }
+    for (; queueHead && _running < _concurrency;) {
+      _running++;
+      release();
+    }
+  }
+
+  function idle () {
+    return _running === 0 && self.length() === 0
+  }
+
+  function push (value, done) {
+    var current = cache.get();
+
+    current.context = context;
+    current.release = release;
+    current.value = value;
+    current.callback = done || noop$4;
+    current.errorHandler = errorHandler;
+
+    if (_running >= _concurrency || self.paused) {
+      if (queueTail) {
+        queueTail.next = current;
+        queueTail = current;
+      } else {
+        queueHead = current;
+        queueTail = current;
+        self.saturated();
+      }
+    } else {
+      _running++;
+      worker.call(context, current.value, current.worked);
+    }
+  }
+
+  function unshift (value, done) {
+    var current = cache.get();
+
+    current.context = context;
+    current.release = release;
+    current.value = value;
+    current.callback = done || noop$4;
+    current.errorHandler = errorHandler;
+
+    if (_running >= _concurrency || self.paused) {
+      if (queueHead) {
+        current.next = queueHead;
+        queueHead = current;
+      } else {
+        queueHead = current;
+        queueTail = current;
+        self.saturated();
+      }
+    } else {
+      _running++;
+      worker.call(context, current.value, current.worked);
+    }
+  }
+
+  function release (holder) {
+    if (holder) {
+      cache.release(holder);
+    }
+    var next = queueHead;
+    if (next && _running <= _concurrency) {
+      if (!self.paused) {
+        if (queueTail === queueHead) {
+          queueTail = null;
+        }
+        queueHead = next.next;
+        next.next = null;
+        worker.call(context, next.value, next.worked);
+        if (queueTail === null) {
+          self.empty();
+        }
+      } else {
+        _running--;
+      }
+    } else if (--_running === 0) {
+      self.drain();
+    }
+  }
+
+  function kill () {
+    queueHead = null;
+    queueTail = null;
+    self.drain = noop$4;
+  }
+
+  function killAndDrain () {
+    queueHead = null;
+    queueTail = null;
+    self.drain();
+    self.drain = noop$4;
+  }
+
+  function error (handler) {
+    errorHandler = handler;
+  }
+}
+
+function noop$4 () {}
+
+function Task () {
+  this.value = null;
+  this.callback = noop$4;
+  this.next = null;
+  this.release = noop$4;
+  this.context = null;
+  this.errorHandler = null;
+
+  var self = this;
+
+  this.worked = function worked (err, result) {
+    var callback = self.callback;
+    var errorHandler = self.errorHandler;
+    var val = self.value;
+    self.value = null;
+    self.callback = noop$4;
+    if (self.errorHandler) {
+      errorHandler(err, val);
+    }
+    callback.call(self.context, err, result);
+    self.release(self);
+  };
+}
+
+function queueAsPromised (context, worker, _concurrency) {
+  if (typeof context === 'function') {
+    _concurrency = worker;
+    worker = context;
+    context = null;
+  }
+
+  function asyncWrapper (arg, cb) {
+    worker.call(this, arg)
+      .then(function (res) {
+        cb(null, res);
+      }, cb);
+  }
+
+  var queue = fastqueue(context, asyncWrapper, _concurrency);
+
+  var pushCb = queue.push;
+  var unshiftCb = queue.unshift;
+
+  queue.push = push;
+  queue.unshift = unshift;
+  queue.drained = drained;
+
+  return queue
+
+  function push (value) {
+    var p = new Promise(function (resolve, reject) {
+      pushCb(value, function (err, result) {
+        if (err) {
+          reject(err);
+          return
+        }
+        resolve(result);
+      });
+    });
+
+    // Let's fork the promise chain to
+    // make the error bubble up to the user but
+    // not lead to a unhandledRejection
+    p.catch(noop$4);
+
+    return p
+  }
+
+  function unshift (value) {
+    var p = new Promise(function (resolve, reject) {
+      unshiftCb(value, function (err, result) {
+        if (err) {
+          reject(err);
+          return
+        }
+        resolve(result);
+      });
+    });
+
+    // Let's fork the promise chain to
+    // make the error bubble up to the user but
+    // not lead to a unhandledRejection
+    p.catch(noop$4);
+
+    return p
+  }
+
+  function drained () {
+    if (queue.idle()) {
+      return new Promise(function (resolve) {
+        resolve();
+      })
+    }
+
+    var previousDrain = queue.drain;
+
+    var p = new Promise(function (resolve) {
+      queue.drain = function () {
+        previousDrain();
+        resolve();
+      };
+    });
+
+    return p
+  }
+}
+
+queue.exports = fastqueue;
+queue.exports.promise = queueAsPromised;
+
+var queueExports = queue.exports;
+
+var common$7 = {};
+
+Object.defineProperty(common$7, "__esModule", { value: true });
+common$7.joinPathSegments = common$7.replacePathSegmentSeparator = common$7.isAppliedFilter = common$7.isFatalError = void 0;
+function isFatalError(settings, error) {
+    if (settings.errorFilter === null) {
+        return true;
+    }
+    return !settings.errorFilter(error);
+}
+common$7.isFatalError = isFatalError;
+function isAppliedFilter(filter, value) {
+    return filter === null || filter(value);
+}
+common$7.isAppliedFilter = isAppliedFilter;
+function replacePathSegmentSeparator(filepath, separator) {
+    return filepath.split(/[/\\]/).join(separator);
+}
+common$7.replacePathSegmentSeparator = replacePathSegmentSeparator;
+function joinPathSegments(a, b, separator) {
+    if (a === '') {
+        return b;
+    }
+    /**
+     * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
+     */
+    if (a.endsWith(separator)) {
+        return a + b;
+    }
+    return a + separator + b;
+}
+common$7.joinPathSegments = joinPathSegments;
+
+var reader$1 = {};
+
+Object.defineProperty(reader$1, "__esModule", { value: true });
+const common$6 = common$7;
+let Reader$1 = class Reader {
+    constructor(_root, _settings) {
+        this._root = _root;
+        this._settings = _settings;
+        this._root = common$6.replacePathSegmentSeparator(_root, _settings.pathSegmentSeparator);
+    }
+};
+reader$1.default = Reader$1;
+
+Object.defineProperty(async$4, "__esModule", { value: true });
+const events_1 = require$$0$7;
+const fsScandir$2 = out$2;
+const fastq = queueExports;
+const common$5 = common$7;
+const reader_1$4 = reader$1;
+class AsyncReader extends reader_1$4.default {
+    constructor(_root, _settings) {
+        super(_root, _settings);
+        this._settings = _settings;
+        this._scandir = fsScandir$2.scandir;
+        this._emitter = new events_1.EventEmitter();
+        this._queue = fastq(this._worker.bind(this), this._settings.concurrency);
+        this._isFatalError = false;
+        this._isDestroyed = false;
+        this._queue.drain = () => {
+            if (!this._isFatalError) {
+                this._emitter.emit('end');
+            }
+        };
+    }
+    read() {
+        this._isFatalError = false;
+        this._isDestroyed = false;
+        setImmediate(() => {
+            this._pushToQueue(this._root, this._settings.basePath);
+        });
+        return this._emitter;
+    }
+    get isDestroyed() {
+        return this._isDestroyed;
+    }
+    destroy() {
+        if (this._isDestroyed) {
+            throw new Error('The reader is already destroyed');
+        }
+        this._isDestroyed = true;
+        this._queue.killAndDrain();
+    }
+    onEntry(callback) {
+        this._emitter.on('entry', callback);
+    }
+    onError(callback) {
+        this._emitter.once('error', callback);
+    }
+    onEnd(callback) {
+        this._emitter.once('end', callback);
+    }
+    _pushToQueue(directory, base) {
+        const queueItem = { directory, base };
+        this._queue.push(queueItem, (error) => {
+            if (error !== null) {
+                this._handleError(error);
+            }
+        });
+    }
+    _worker(item, done) {
+        this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries) => {
+            if (error !== null) {
+                done(error, undefined);
+                return;
+            }
+            for (const entry of entries) {
+                this._handleEntry(entry, item.base);
+            }
+            done(null, undefined);
+        });
+    }
+    _handleError(error) {
+        if (this._isDestroyed || !common$5.isFatalError(this._settings, error)) {
+            return;
+        }
+        this._isFatalError = true;
+        this._isDestroyed = true;
+        this._emitter.emit('error', error);
+    }
+    _handleEntry(entry, base) {
+        if (this._isDestroyed || this._isFatalError) {
+            return;
+        }
+        const fullpath = entry.path;
+        if (base !== undefined) {
+            entry.path = common$5.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
+        }
+        if (common$5.isAppliedFilter(this._settings.entryFilter, entry)) {
+            this._emitEntry(entry);
+        }
+        if (entry.dirent.isDirectory() && common$5.isAppliedFilter(this._settings.deepFilter, entry)) {
+            this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
+        }
+    }
+    _emitEntry(entry) {
+        this._emitter.emit('entry', entry);
+    }
+}
+async$4.default = AsyncReader;
+
+Object.defineProperty(async$5, "__esModule", { value: true });
+const async_1$4 = async$4;
+class AsyncProvider {
+    constructor(_root, _settings) {
+        this._root = _root;
+        this._settings = _settings;
+        this._reader = new async_1$4.default(this._root, this._settings);
+        this._storage = [];
+    }
+    read(callback) {
+        this._reader.onError((error) => {
+            callFailureCallback(callback, error);
+        });
+        this._reader.onEntry((entry) => {
+            this._storage.push(entry);
+        });
+        this._reader.onEnd(() => {
+            callSuccessCallback(callback, this._storage);
+        });
+        this._reader.read();
+    }
+}
+async$5.default = AsyncProvider;
+function callFailureCallback(callback, error) {
+    callback(error);
+}
+function callSuccessCallback(callback, entries) {
+    callback(null, entries);
+}
+
+var stream$2 = {};
+
+Object.defineProperty(stream$2, "__esModule", { value: true });
+const stream_1$5 = require$$0$6;
+const async_1$3 = async$4;
+class StreamProvider {
+    constructor(_root, _settings) {
+        this._root = _root;
+        this._settings = _settings;
+        this._reader = new async_1$3.default(this._root, this._settings);
+        this._stream = new stream_1$5.Readable({
+            objectMode: true,
+            read: () => { },
+            destroy: () => {
+                if (!this._reader.isDestroyed) {
+                    this._reader.destroy();
+                }
+            }
+        });
+    }
+    read() {
+        this._reader.onError((error) => {
+            this._stream.emit('error', error);
+        });
+        this._reader.onEntry((entry) => {
+            this._stream.push(entry);
+        });
+        this._reader.onEnd(() => {
+            this._stream.push(null);
+        });
+        this._reader.read();
+        return this._stream;
+    }
+}
+stream$2.default = StreamProvider;
+
+var sync$4 = {};
+
+var sync$3 = {};
+
+Object.defineProperty(sync$3, "__esModule", { value: true });
+const fsScandir$1 = out$2;
+const common$4 = common$7;
+const reader_1$3 = reader$1;
+class SyncReader extends reader_1$3.default {
+    constructor() {
+        super(...arguments);
+        this._scandir = fsScandir$1.scandirSync;
+        this._storage = [];
+        this._queue = new Set();
+    }
+    read() {
+        this._pushToQueue(this._root, this._settings.basePath);
+        this._handleQueue();
+        return this._storage;
+    }
+    _pushToQueue(directory, base) {
+        this._queue.add({ directory, base });
+    }
+    _handleQueue() {
+        for (const item of this._queue.values()) {
+            this._handleDirectory(item.directory, item.base);
+        }
+    }
+    _handleDirectory(directory, base) {
+        try {
+            const entries = this._scandir(directory, this._settings.fsScandirSettings);
+            for (const entry of entries) {
+                this._handleEntry(entry, base);
+            }
+        }
+        catch (error) {
+            this._handleError(error);
+        }
+    }
+    _handleError(error) {
+        if (!common$4.isFatalError(this._settings, error)) {
+            return;
+        }
+        throw error;
+    }
+    _handleEntry(entry, base) {
+        const fullpath = entry.path;
+        if (base !== undefined) {
+            entry.path = common$4.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
+        }
+        if (common$4.isAppliedFilter(this._settings.entryFilter, entry)) {
+            this._pushToStorage(entry);
+        }
+        if (entry.dirent.isDirectory() && common$4.isAppliedFilter(this._settings.deepFilter, entry)) {
+            this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
+        }
+    }
+    _pushToStorage(entry) {
+        this._storage.push(entry);
+    }
+}
+sync$3.default = SyncReader;
+
+Object.defineProperty(sync$4, "__esModule", { value: true });
+const sync_1$3 = sync$3;
+class SyncProvider {
+    constructor(_root, _settings) {
+        this._root = _root;
+        this._settings = _settings;
+        this._reader = new sync_1$3.default(this._root, this._settings);
+    }
+    read() {
+        return this._reader.read();
+    }
+}
+sync$4.default = SyncProvider;
+
+var settings$1 = {};
+
+Object.defineProperty(settings$1, "__esModule", { value: true });
+const path$d = require$$0$4;
+const fsScandir = out$2;
+class Settings {
+    constructor(_options = {}) {
+        this._options = _options;
+        this.basePath = this._getValue(this._options.basePath, undefined);
+        this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
+        this.deepFilter = this._getValue(this._options.deepFilter, null);
+        this.entryFilter = this._getValue(this._options.entryFilter, null);
+        this.errorFilter = this._getValue(this._options.errorFilter, null);
+        this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$d.sep);
+        this.fsScandirSettings = new fsScandir.Settings({
+            followSymbolicLinks: this._options.followSymbolicLinks,
+            fs: this._options.fs,
+            pathSegmentSeparator: this._options.pathSegmentSeparator,
+            stats: this._options.stats,
+            throwErrorOnBrokenSymbolicLink: this._options.throwErrorOnBrokenSymbolicLink
+        });
+    }
+    _getValue(option, value) {
+        return option !== null && option !== void 0 ? option : value;
+    }
+}
+settings$1.default = Settings;
+
+Object.defineProperty(out$3, "__esModule", { value: true });
+out$3.Settings = out$3.walkStream = out$3.walkSync = out$3.walk = void 0;
+const async_1$2 = async$5;
+const stream_1$4 = stream$2;
+const sync_1$2 = sync$4;
+const settings_1$1 = settings$1;
+out$3.Settings = settings_1$1.default;
+function walk$2(directory, optionsOrSettingsOrCallback, callback) {
+    if (typeof optionsOrSettingsOrCallback === 'function') {
+        new async_1$2.default(directory, getSettings()).read(optionsOrSettingsOrCallback);
+        return;
+    }
+    new async_1$2.default(directory, getSettings(optionsOrSettingsOrCallback)).read(callback);
+}
+out$3.walk = walk$2;
+function walkSync(directory, optionsOrSettings) {
+    const settings = getSettings(optionsOrSettings);
+    const provider = new sync_1$2.default(directory, settings);
+    return provider.read();
+}
+out$3.walkSync = walkSync;
+function walkStream(directory, optionsOrSettings) {
+    const settings = getSettings(optionsOrSettings);
+    const provider = new stream_1$4.default(directory, settings);
+    return provider.read();
+}
+out$3.walkStream = walkStream;
+function getSettings(settingsOrOptions = {}) {
+    if (settingsOrOptions instanceof settings_1$1.default) {
+        return settingsOrOptions;
+    }
+    return new settings_1$1.default(settingsOrOptions);
+}
+
+var reader = {};
+
+Object.defineProperty(reader, "__esModule", { value: true });
+const path$c = require$$0$4;
+const fsStat$2 = out$1;
+const utils$6 = utils$g;
+class Reader {
+    constructor(_settings) {
+        this._settings = _settings;
+        this._fsStatSettings = new fsStat$2.Settings({
+            followSymbolicLink: this._settings.followSymbolicLinks,
+            fs: this._settings.fs,
+            throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
+        });
+    }
+    _getFullEntryPath(filepath) {
+        return path$c.resolve(this._settings.cwd, filepath);
+    }
+    _makeEntry(stats, pattern) {
+        const entry = {
+            name: pattern,
+            path: pattern,
+            dirent: utils$6.fs.createDirentFromStats(pattern, stats)
+        };
+        if (this._settings.stats) {
+            entry.stats = stats;
+        }
+        return entry;
+    }
+    _isFatalError(error) {
+        return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
+    }
+}
+reader.default = Reader;
+
+var stream$1 = {};
+
+Object.defineProperty(stream$1, "__esModule", { value: true });
+const stream_1$3 = require$$0$6;
+const fsStat$1 = out$1;
+const fsWalk$2 = out$3;
+const reader_1$2 = reader;
+class ReaderStream extends reader_1$2.default {
+    constructor() {
+        super(...arguments);
+        this._walkStream = fsWalk$2.walkStream;
+        this._stat = fsStat$1.stat;
+    }
+    dynamic(root, options) {
+        return this._walkStream(root, options);
+    }
+    static(patterns, options) {
+        const filepaths = patterns.map(this._getFullEntryPath, this);
+        const stream = new stream_1$3.PassThrough({ objectMode: true });
+        stream._write = (index, _enc, done) => {
+            return this._getEntry(filepaths[index], patterns[index], options)
+                .then((entry) => {
+                if (entry !== null && options.entryFilter(entry)) {
+                    stream.push(entry);
+                }
+                if (index === filepaths.length - 1) {
+                    stream.end();
+                }
+                done();
+            })
+                .catch(done);
+        };
+        for (let i = 0; i < filepaths.length; i++) {
+            stream.write(i);
+        }
+        return stream;
+    }
+    _getEntry(filepath, pattern, options) {
+        return this._getStat(filepath)
+            .then((stats) => this._makeEntry(stats, pattern))
+            .catch((error) => {
+            if (options.errorFilter(error)) {
+                return null;
+            }
+            throw error;
+        });
+    }
+    _getStat(filepath) {
+        return new Promise((resolve, reject) => {
+            this._stat(filepath, this._fsStatSettings, (error, stats) => {
+                return error === null ? resolve(stats) : reject(error);
+            });
+        });
+    }
+}
+stream$1.default = ReaderStream;
+
+Object.defineProperty(async$6, "__esModule", { value: true });
+const fsWalk$1 = out$3;
+const reader_1$1 = reader;
+const stream_1$2 = stream$1;
+class ReaderAsync extends reader_1$1.default {
+    constructor() {
+        super(...arguments);
+        this._walkAsync = fsWalk$1.walk;
+        this._readerStream = new stream_1$2.default(this._settings);
+    }
+    dynamic(root, options) {
+        return new Promise((resolve, reject) => {
+            this._walkAsync(root, options, (error, entries) => {
+                if (error === null) {
+                    resolve(entries);
+                }
+                else {
+                    reject(error);
+                }
+            });
+        });
+    }
+    async static(patterns, options) {
+        const entries = [];
+        const stream = this._readerStream.static(patterns, options);
+        // After #235, replace it with an asynchronous iterator.
+        return new Promise((resolve, reject) => {
+            stream.once('error', reject);
+            stream.on('data', (entry) => entries.push(entry));
+            stream.once('end', () => resolve(entries));
+        });
+    }
+}
+async$6.default = ReaderAsync;
+
+var provider = {};
+
+var deep = {};
+
+var partial = {};
+
+var matcher = {};
+
+Object.defineProperty(matcher, "__esModule", { value: true });
+const utils$5 = utils$g;
+class Matcher {
+    constructor(_patterns, _settings, _micromatchOptions) {
+        this._patterns = _patterns;
+        this._settings = _settings;
+        this._micromatchOptions = _micromatchOptions;
+        this._storage = [];
+        this._fillStorage();
+    }
+    _fillStorage() {
+        for (const pattern of this._patterns) {
+            const segments = this._getPatternSegments(pattern);
+            const sections = this._splitSegmentsIntoSections(segments);
+            this._storage.push({
+                complete: sections.length <= 1,
+                pattern,
+                segments,
+                sections
+            });
+        }
+    }
+    _getPatternSegments(pattern) {
+        const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions);
+        return parts.map((part) => {
+            const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings);
+            if (!dynamic) {
+                return {
+                    dynamic: false,
+                    pattern: part
+                };
+            }
+            return {
+                dynamic: true,
+                pattern: part,
+                patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
+            };
+        });
+    }
+    _splitSegmentsIntoSections(segments) {
+        return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
+    }
+}
+matcher.default = Matcher;
+
+Object.defineProperty(partial, "__esModule", { value: true });
+const matcher_1 = matcher;
+class PartialMatcher extends matcher_1.default {
+    match(filepath) {
+        const parts = filepath.split('/');
+        const levels = parts.length;
+        const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
+        for (const pattern of patterns) {
+            const section = pattern.sections[0];
+            /**
+             * In this case, the pattern has a globstar and we must read all directories unconditionally,
+             * but only if the level has reached the end of the first group.
+             *
+             * fixtures/{a,b}/**
+             *  ^ true/false  ^ always true
+            */
+            if (!pattern.complete && levels > section.length) {
+                return true;
+            }
+            const match = parts.every((part, index) => {
+                const segment = pattern.segments[index];
+                if (segment.dynamic && segment.patternRe.test(part)) {
+                    return true;
+                }
+                if (!segment.dynamic && segment.pattern === part) {
+                    return true;
+                }
+                return false;
+            });
+            if (match) {
+                return true;
+            }
+        }
+        return false;
+    }
+}
+partial.default = PartialMatcher;
+
+Object.defineProperty(deep, "__esModule", { value: true });
+const utils$4 = utils$g;
+const partial_1 = partial;
+class DeepFilter {
+    constructor(_settings, _micromatchOptions) {
+        this._settings = _settings;
+        this._micromatchOptions = _micromatchOptions;
+    }
+    getFilter(basePath, positive, negative) {
+        const matcher = this._getMatcher(positive);
+        const negativeRe = this._getNegativePatternsRe(negative);
+        return (entry) => this._filter(basePath, entry, matcher, negativeRe);
+    }
+    _getMatcher(patterns) {
+        return new partial_1.default(patterns, this._settings, this._micromatchOptions);
+    }
+    _getNegativePatternsRe(patterns) {
+        const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
+        return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
+    }
+    _filter(basePath, entry, matcher, negativeRe) {
+        if (this._isSkippedByDeep(basePath, entry.path)) {
+            return false;
+        }
+        if (this._isSkippedSymbolicLink(entry)) {
+            return false;
+        }
+        const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
+        if (this._isSkippedByPositivePatterns(filepath, matcher)) {
+            return false;
+        }
+        return this._isSkippedByNegativePatterns(filepath, negativeRe);
+    }
+    _isSkippedByDeep(basePath, entryPath) {
+        /**
+         * Avoid unnecessary depth calculations when it doesn't matter.
+         */
+        if (this._settings.deep === Infinity) {
+            return false;
+        }
+        return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
+    }
+    _getEntryLevel(basePath, entryPath) {
+        const entryPathDepth = entryPath.split('/').length;
+        if (basePath === '') {
+            return entryPathDepth;
+        }
+        const basePathDepth = basePath.split('/').length;
+        return entryPathDepth - basePathDepth;
+    }
+    _isSkippedSymbolicLink(entry) {
+        return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
+    }
+    _isSkippedByPositivePatterns(entryPath, matcher) {
+        return !this._settings.baseNameMatch && !matcher.match(entryPath);
+    }
+    _isSkippedByNegativePatterns(entryPath, patternsRe) {
+        return !utils$4.pattern.matchAny(entryPath, patternsRe);
+    }
+}
+deep.default = DeepFilter;
+
+var entry$1 = {};
+
+Object.defineProperty(entry$1, "__esModule", { value: true });
+const utils$3 = utils$g;
+class EntryFilter {
+    constructor(_settings, _micromatchOptions) {
+        this._settings = _settings;
+        this._micromatchOptions = _micromatchOptions;
+        this.index = new Map();
+    }
+    getFilter(positive, negative) {
+        const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions);
+        const negativeRe = utils$3.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }));
+        return (entry) => this._filter(entry, positiveRe, negativeRe);
+    }
+    _filter(entry, positiveRe, negativeRe) {
+        const filepath = utils$3.path.removeLeadingDotSegment(entry.path);
+        if (this._settings.unique && this._isDuplicateEntry(filepath)) {
+            return false;
+        }
+        if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
+            return false;
+        }
+        if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) {
+            return false;
+        }
+        const isDirectory = entry.dirent.isDirectory();
+        const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory);
+        if (this._settings.unique && isMatched) {
+            this._createIndexRecord(filepath);
+        }
+        return isMatched;
+    }
+    _isDuplicateEntry(filepath) {
+        return this.index.has(filepath);
+    }
+    _createIndexRecord(filepath) {
+        this.index.set(filepath, undefined);
+    }
+    _onlyFileFilter(entry) {
+        return this._settings.onlyFiles && !entry.dirent.isFile();
+    }
+    _onlyDirectoryFilter(entry) {
+        return this._settings.onlyDirectories && !entry.dirent.isDirectory();
+    }
+    _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
+        if (!this._settings.absolute) {
+            return false;
+        }
+        const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, entryPath);
+        return utils$3.pattern.matchAny(fullpath, patternsRe);
+    }
+    _isMatchToPatterns(filepath, patternsRe, isDirectory) {
+        // Trying to match files and directories by patterns.
+        const isMatched = utils$3.pattern.matchAny(filepath, patternsRe);
+        // A pattern with a trailling slash can be used for directory matching.
+        // To apply such pattern, we need to add a tralling slash to the path.
+        if (!isMatched && isDirectory) {
+            return utils$3.pattern.matchAny(filepath + '/', patternsRe);
+        }
+        return isMatched;
+    }
+}
+entry$1.default = EntryFilter;
+
+var error$1 = {};
+
+Object.defineProperty(error$1, "__esModule", { value: true });
+const utils$2 = utils$g;
+class ErrorFilter {
+    constructor(_settings) {
+        this._settings = _settings;
+    }
+    getFilter() {
+        return (error) => this._isNonFatalError(error);
+    }
+    _isNonFatalError(error) {
+        return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
+    }
+}
+error$1.default = ErrorFilter;
+
+var entry = {};
+
+Object.defineProperty(entry, "__esModule", { value: true });
+const utils$1 = utils$g;
+class EntryTransformer {
+    constructor(_settings) {
+        this._settings = _settings;
+    }
+    getTransformer() {
+        return (entry) => this._transform(entry);
+    }
+    _transform(entry) {
+        let filepath = entry.path;
+        if (this._settings.absolute) {
+            filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
+            filepath = utils$1.path.unixify(filepath);
+        }
+        if (this._settings.markDirectories && entry.dirent.isDirectory()) {
+            filepath += '/';
+        }
+        if (!this._settings.objectMode) {
+            return filepath;
+        }
+        return Object.assign(Object.assign({}, entry), { path: filepath });
+    }
+}
+entry.default = EntryTransformer;
+
+Object.defineProperty(provider, "__esModule", { value: true });
+const path$b = require$$0$4;
+const deep_1 = deep;
+const entry_1 = entry$1;
+const error_1 = error$1;
+const entry_2 = entry;
+class Provider {
+    constructor(_settings) {
+        this._settings = _settings;
+        this.errorFilter = new error_1.default(this._settings);
+        this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
+        this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
+        this.entryTransformer = new entry_2.default(this._settings);
+    }
+    _getRootDirectory(task) {
+        return path$b.resolve(this._settings.cwd, task.base);
+    }
+    _getReaderOptions(task) {
+        const basePath = task.base === '.' ? '' : task.base;
+        return {
+            basePath,
+            pathSegmentSeparator: '/',
+            concurrency: this._settings.concurrency,
+            deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
+            entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
+            errorFilter: this.errorFilter.getFilter(),
+            followSymbolicLinks: this._settings.followSymbolicLinks,
+            fs: this._settings.fs,
+            stats: this._settings.stats,
+            throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
+            transform: this.entryTransformer.getTransformer()
+        };
+    }
+    _getMicromatchOptions() {
+        return {
+            dot: this._settings.dot,
+            matchBase: this._settings.baseNameMatch,
+            nobrace: !this._settings.braceExpansion,
+            nocase: !this._settings.caseSensitiveMatch,
+            noext: !this._settings.extglob,
+            noglobstar: !this._settings.globstar,
+            posix: true,
+            strictSlashes: false
+        };
+    }
+}
+provider.default = Provider;
+
+Object.defineProperty(async$7, "__esModule", { value: true });
+const async_1$1 = async$6;
+const provider_1$2 = provider;
+class ProviderAsync extends provider_1$2.default {
+    constructor() {
+        super(...arguments);
+        this._reader = new async_1$1.default(this._settings);
+    }
+    async read(task) {
+        const root = this._getRootDirectory(task);
+        const options = this._getReaderOptions(task);
+        const entries = await this.api(root, task, options);
+        return entries.map((entry) => options.transform(entry));
+    }
+    api(root, task, options) {
+        if (task.dynamic) {
+            return this._reader.dynamic(root, options);
+        }
+        return this._reader.static(task.patterns, options);
+    }
+}
+async$7.default = ProviderAsync;
+
+var stream = {};
+
+Object.defineProperty(stream, "__esModule", { value: true });
+const stream_1$1 = require$$0$6;
+const stream_2 = stream$1;
+const provider_1$1 = provider;
+class ProviderStream extends provider_1$1.default {
+    constructor() {
+        super(...arguments);
+        this._reader = new stream_2.default(this._settings);
+    }
+    read(task) {
+        const root = this._getRootDirectory(task);
+        const options = this._getReaderOptions(task);
+        const source = this.api(root, task, options);
+        const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } });
+        source
+            .once('error', (error) => destination.emit('error', error))
+            .on('data', (entry) => destination.emit('data', options.transform(entry)))
+            .once('end', () => destination.emit('end'));
+        destination
+            .once('close', () => source.destroy());
+        return destination;
+    }
+    api(root, task, options) {
+        if (task.dynamic) {
+            return this._reader.dynamic(root, options);
+        }
+        return this._reader.static(task.patterns, options);
+    }
+}
+stream.default = ProviderStream;
+
+var sync$2 = {};
+
+var sync$1 = {};
+
+Object.defineProperty(sync$1, "__esModule", { value: true });
+const fsStat = out$1;
+const fsWalk = out$3;
+const reader_1 = reader;
+class ReaderSync extends reader_1.default {
+    constructor() {
+        super(...arguments);
+        this._walkSync = fsWalk.walkSync;
+        this._statSync = fsStat.statSync;
+    }
+    dynamic(root, options) {
+        return this._walkSync(root, options);
+    }
+    static(patterns, options) {
+        const entries = [];
+        for (const pattern of patterns) {
+            const filepath = this._getFullEntryPath(pattern);
+            const entry = this._getEntry(filepath, pattern, options);
+            if (entry === null || !options.entryFilter(entry)) {
+                continue;
+            }
+            entries.push(entry);
+        }
+        return entries;
+    }
+    _getEntry(filepath, pattern, options) {
+        try {
+            const stats = this._getStat(filepath);
+            return this._makeEntry(stats, pattern);
+        }
+        catch (error) {
+            if (options.errorFilter(error)) {
+                return null;
+            }
+            throw error;
+        }
+    }
+    _getStat(filepath) {
+        return this._statSync(filepath, this._fsStatSettings);
+    }
+}
+sync$1.default = ReaderSync;
+
+Object.defineProperty(sync$2, "__esModule", { value: true });
+const sync_1$1 = sync$1;
+const provider_1 = provider;
+class ProviderSync extends provider_1.default {
+    constructor() {
+        super(...arguments);
+        this._reader = new sync_1$1.default(this._settings);
+    }
+    read(task) {
+        const root = this._getRootDirectory(task);
+        const options = this._getReaderOptions(task);
+        const entries = this.api(root, task, options);
+        return entries.map(options.transform);
+    }
+    api(root, task, options) {
+        if (task.dynamic) {
+            return this._reader.dynamic(root, options);
+        }
+        return this._reader.static(task.patterns, options);
+    }
+}
+sync$2.default = ProviderSync;
+
+var settings = {};
+
+(function (exports) {
+	Object.defineProperty(exports, "__esModule", { value: true });
+	exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
+	const fs = require$$0__default;
+	const os = require$$2;
+	/**
+	 * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
+	 * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
+	 */
+	const CPU_COUNT = Math.max(os.cpus().length, 1);
+	exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
+	    lstat: fs.lstat,
+	    lstatSync: fs.lstatSync,
+	    stat: fs.stat,
+	    statSync: fs.statSync,
+	    readdir: fs.readdir,
+	    readdirSync: fs.readdirSync
+	};
+	class Settings {
+	    constructor(_options = {}) {
+	        this._options = _options;
+	        this.absolute = this._getValue(this._options.absolute, false);
+	        this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
+	        this.braceExpansion = this._getValue(this._options.braceExpansion, true);
+	        this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
+	        this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
+	        this.cwd = this._getValue(this._options.cwd, process.cwd());
+	        this.deep = this._getValue(this._options.deep, Infinity);
+	        this.dot = this._getValue(this._options.dot, false);
+	        this.extglob = this._getValue(this._options.extglob, true);
+	        this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
+	        this.fs = this._getFileSystemMethods(this._options.fs);
+	        this.globstar = this._getValue(this._options.globstar, true);
+	        this.ignore = this._getValue(this._options.ignore, []);
+	        this.markDirectories = this._getValue(this._options.markDirectories, false);
+	        this.objectMode = this._getValue(this._options.objectMode, false);
+	        this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
+	        this.onlyFiles = this._getValue(this._options.onlyFiles, true);
+	        this.stats = this._getValue(this._options.stats, false);
+	        this.suppressErrors = this._getValue(this._options.suppressErrors, false);
+	        this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
+	        this.unique = this._getValue(this._options.unique, true);
+	        if (this.onlyDirectories) {
+	            this.onlyFiles = false;
+	        }
+	        if (this.stats) {
+	            this.objectMode = true;
+	        }
+	        // Remove the cast to the array in the next major (#404).
+	        this.ignore = [].concat(this.ignore);
+	    }
+	    _getValue(option, value) {
+	        return option === undefined ? value : option;
+	    }
+	    _getFileSystemMethods(methods = {}) {
+	        return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
+	    }
+	}
+	exports.default = Settings; 
+} (settings));
+
+const taskManager = tasks;
+const async_1 = async$7;
+const stream_1 = stream;
+const sync_1 = sync$2;
+const settings_1 = settings;
+const utils = utils$g;
+async function FastGlob(source, options) {
+    assertPatternsInput(source);
+    const works = getWorks(source, async_1.default, options);
+    const result = await Promise.all(works);
+    return utils.array.flatten(result);
+}
+// https://github.com/typescript-eslint/typescript-eslint/issues/60
+// eslint-disable-next-line no-redeclare
+(function (FastGlob) {
+    FastGlob.glob = FastGlob;
+    FastGlob.globSync = sync;
+    FastGlob.globStream = stream;
+    FastGlob.async = FastGlob;
+    function sync(source, options) {
+        assertPatternsInput(source);
+        const works = getWorks(source, sync_1.default, options);
+        return utils.array.flatten(works);
+    }
+    FastGlob.sync = sync;
+    function stream(source, options) {
+        assertPatternsInput(source);
+        const works = getWorks(source, stream_1.default, options);
+        /**
+         * The stream returned by the provider cannot work with an asynchronous iterator.
+         * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
+         * This affects performance (+25%). I don't see best solution right now.
+         */
+        return utils.stream.merge(works);
+    }
+    FastGlob.stream = stream;
+    function generateTasks(source, options) {
+        assertPatternsInput(source);
+        const patterns = [].concat(source);
+        const settings = new settings_1.default(options);
+        return taskManager.generate(patterns, settings);
+    }
+    FastGlob.generateTasks = generateTasks;
+    function isDynamicPattern(source, options) {
+        assertPatternsInput(source);
+        const settings = new settings_1.default(options);
+        return utils.pattern.isDynamicPattern(source, settings);
+    }
+    FastGlob.isDynamicPattern = isDynamicPattern;
+    function escapePath(source) {
+        assertPatternsInput(source);
+        return utils.path.escape(source);
+    }
+    FastGlob.escapePath = escapePath;
+    function convertPathToPattern(source) {
+        assertPatternsInput(source);
+        return utils.path.convertPathToPattern(source);
+    }
+    FastGlob.convertPathToPattern = convertPathToPattern;
+    (function (posix) {
+        function escapePath(source) {
+            assertPatternsInput(source);
+            return utils.path.escapePosixPath(source);
+        }
+        posix.escapePath = escapePath;
+        function convertPathToPattern(source) {
+            assertPatternsInput(source);
+            return utils.path.convertPosixPathToPattern(source);
+        }
+        posix.convertPathToPattern = convertPathToPattern;
+    })(FastGlob.posix || (FastGlob.posix = {}));
+    (function (win32) {
+        function escapePath(source) {
+            assertPatternsInput(source);
+            return utils.path.escapeWindowsPath(source);
+        }
+        win32.escapePath = escapePath;
+        function convertPathToPattern(source) {
+            assertPatternsInput(source);
+            return utils.path.convertWindowsPathToPattern(source);
+        }
+        win32.convertPathToPattern = convertPathToPattern;
+    })(FastGlob.win32 || (FastGlob.win32 = {}));
+})(FastGlob || (FastGlob = {}));
+function getWorks(source, _Provider, options) {
+    const patterns = [].concat(source);
+    const settings = new settings_1.default(options);
+    const tasks = taskManager.generate(patterns, settings);
+    const provider = new _Provider(settings);
+    return tasks.map(provider.read, provider);
+}
+function assertPatternsInput(input) {
+    const source = [].concat(input);
+    const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
+    if (!isValidSource) {
+        throw new TypeError('Patterns must be a string (non empty) or an array of strings');
+    }
+}
+var out = FastGlob;
+
+var glob = /*@__PURE__*/getDefaultExportFromCjs(out);
+
+var src$2 = {};
+
+// @ts-check
+const path$a = require$$0$4;
+const fs$a = require$$0__default;
+const os$3 = require$$2;
+
+const fsReadFileAsync = fs$a.promises.readFile;
+
+/** @type {(name: string, sync: boolean) => string[]} */
+function getDefaultSearchPlaces(name, sync) {
+	return [
+		'package.json',
+		`.${name}rc.json`,
+		`.${name}rc.js`,
+		`.${name}rc.cjs`,
+		...(sync ? [] : [`.${name}rc.mjs`]),
+		`.config/${name}rc`,
+		`.config/${name}rc.json`,
+		`.config/${name}rc.js`,
+		`.config/${name}rc.cjs`,
+		...(sync ? [] : [`.config/${name}rc.mjs`]),
+		`${name}.config.js`,
+		`${name}.config.cjs`,
+		...(sync ? [] : [`${name}.config.mjs`]),
+	];
+}
+
+/**
+ * @type {(p: string) => string}
+ *
+ * see #17
+ * On *nix, if cwd is not under homedir,
+ * the last path will be '', ('/build' -> '')
+ * but it should be '/' actually.
+ * And on Windows, this will never happen. ('C:\build' -> 'C:')
+ */
+function parentDir(p) {
+	return path$a.dirname(p) || path$a.sep;
+}
+
+/** @type {import('./index').LoaderSync} */
+const jsonLoader = (_, content) => JSON.parse(content);
+// Use plain require in webpack context for dynamic import
+const requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
+/** @type {import('./index').LoadersSync} */
+const defaultLoadersSync = Object.freeze({
+	'.js': requireFunc,
+	'.json': requireFunc,
+	'.cjs': requireFunc,
+	noExt: jsonLoader,
+});
+src$2.defaultLoadersSync = defaultLoadersSync;
+
+/** @type {import('./index').Loader} */
+const dynamicImport = async id => {
+	try {
+		const mod = await import(/* webpackIgnore: true */ id);
+
+		return mod.default;
+	} catch (e) {
+		try {
+			return requireFunc(id);
+		} catch (/** @type {any} */ requireE) {
+			if (
+				requireE.code === 'ERR_REQUIRE_ESM' ||
+				(requireE instanceof SyntaxError &&
+					requireE
+						.toString()
+						.includes('Cannot use import statement outside a module'))
+			) {
+				throw e;
+			}
+			throw requireE;
+		}
+	}
+};
+
+/** @type {import('./index').Loaders} */
+const defaultLoaders = Object.freeze({
+	'.js': dynamicImport,
+	'.mjs': dynamicImport,
+	'.cjs': dynamicImport,
+	'.json': jsonLoader,
+	noExt: jsonLoader,
+});
+src$2.defaultLoaders = defaultLoaders;
+
+/**
+ * @param {string} name
+ * @param {import('./index').Options | import('./index').OptionsSync} options
+ * @param {boolean} sync
+ * @returns {Required}
+ */
+function getOptions(name, options, sync) {
+	/** @type {Required} */
+	const conf = {
+		stopDir: os$3.homedir(),
+		searchPlaces: getDefaultSearchPlaces(name, sync),
+		ignoreEmptySearchPlaces: true,
+		cache: true,
+		transform: x => x,
+		packageProp: [name],
+		...options,
+		loaders: {
+			...(sync ? defaultLoadersSync : defaultLoaders),
+			...options.loaders,
+		},
+	};
+	conf.searchPlaces.forEach(place => {
+		const key = path$a.extname(place) || 'noExt';
+		const loader = conf.loaders[key];
+		if (!loader) {
+			throw new Error(`Missing loader for extension "${place}"`);
+		}
+
+		if (typeof loader !== 'function') {
+			throw new Error(
+				`Loader for extension "${place}" is not a function: Received ${typeof loader}.`,
+			);
+		}
+	});
+
+	return conf;
+}
+
+/** @type {(props: string | string[], obj: Record) => unknown} */
+function getPackageProp(props, obj) {
+	if (typeof props === 'string' && props in obj) return obj[props];
+	return (
+		(Array.isArray(props) ? props : props.split('.')).reduce(
+			(acc, prop) => (acc === undefined ? acc : acc[prop]),
+			obj,
+		) || null
+	);
+}
+
+/** @param {string} filepath */
+function validateFilePath(filepath) {
+	if (!filepath) throw new Error('load must pass a non-empty string');
+}
+
+/** @type {(loader: import('./index').Loader, ext: string) => void} */
+function validateLoader(loader, ext) {
+	if (!loader) throw new Error(`No loader specified for extension "${ext}"`);
+	if (typeof loader !== 'function') throw new Error('loader is not a function');
+}
+
+/** @type {(enableCache: boolean) => (c: Map, filepath: string, res: T) => T} */
+const makeEmplace = enableCache => (c, filepath, res) => {
+	if (enableCache) c.set(filepath, res);
+	return res;
+};
+
+/** @type {import('./index').lilconfig} */
+src$2.lilconfig = function lilconfig(name, options) {
+	const {
+		ignoreEmptySearchPlaces,
+		loaders,
+		packageProp,
+		searchPlaces,
+		stopDir,
+		transform,
+		cache,
+	} = getOptions(name, options ?? {}, false);
+	const searchCache = new Map();
+	const loadCache = new Map();
+	const emplace = makeEmplace(cache);
+
+	return {
+		async search(searchFrom = process.cwd()) {
+			/** @type {import('./index').LilconfigResult} */
+			const result = {
+				config: null,
+				filepath: '',
+			};
+
+			/** @type {Set} */
+			const visited = new Set();
+			let dir = searchFrom;
+			dirLoop: while (true) {
+				if (cache) {
+					const r = searchCache.get(dir);
+					if (r !== undefined) {
+						for (const p of visited) searchCache.set(p, r);
+						return r;
+					}
+					visited.add(dir);
+				}
+
+				for (const searchPlace of searchPlaces) {
+					const filepath = path$a.join(dir, searchPlace);
+					try {
+						await fs$a.promises.access(filepath);
+					} catch {
+						continue;
+					}
+					const content = String(await fsReadFileAsync(filepath));
+					const loaderKey = path$a.extname(searchPlace) || 'noExt';
+					const loader = loaders[loaderKey];
+
+					// handle package.json
+					if (searchPlace === 'package.json') {
+						const pkg = await loader(filepath, content);
+						const maybeConfig = getPackageProp(packageProp, pkg);
+						if (maybeConfig != null) {
+							result.config = maybeConfig;
+							result.filepath = filepath;
+							break dirLoop;
+						}
+
+						continue;
+					}
+
+					// handle other type of configs
+					const isEmpty = content.trim() === '';
+					if (isEmpty && ignoreEmptySearchPlaces) continue;
+
+					if (isEmpty) {
+						result.isEmpty = true;
+						result.config = undefined;
+					} else {
+						validateLoader(loader, loaderKey);
+						result.config = await loader(filepath, content);
+					}
+					result.filepath = filepath;
+					break dirLoop;
+				}
+				if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
+				dir = parentDir(dir);
+			}
+
+			const transformed =
+				// not found
+				result.filepath === '' && result.config === null
+					? transform(null)
+					: transform(result);
+
+			if (cache) {
+				for (const p of visited) searchCache.set(p, transformed);
+			}
+
+			return transformed;
+		},
+		async load(filepath) {
+			validateFilePath(filepath);
+			const absPath = path$a.resolve(process.cwd(), filepath);
+			if (cache && loadCache.has(absPath)) {
+				return loadCache.get(absPath);
+			}
+			const {base, ext} = path$a.parse(absPath);
+			const loaderKey = ext || 'noExt';
+			const loader = loaders[loaderKey];
+			validateLoader(loader, loaderKey);
+			const content = String(await fsReadFileAsync(absPath));
+
+			if (base === 'package.json') {
+				const pkg = await loader(absPath, content);
+				return emplace(
+					loadCache,
+					absPath,
+					transform({
+						config: getPackageProp(packageProp, pkg),
+						filepath: absPath,
+					}),
+				);
+			}
+			/** @type {import('./index').LilconfigResult} */
+			const result = {
+				config: null,
+				filepath: absPath,
+			};
+			// handle other type of configs
+			const isEmpty = content.trim() === '';
+			if (isEmpty && ignoreEmptySearchPlaces)
+				return emplace(
+					loadCache,
+					absPath,
+					transform({
+						config: undefined,
+						filepath: absPath,
+						isEmpty: true,
+					}),
+				);
+
+			// cosmiconfig returns undefined for empty files
+			result.config = isEmpty ? undefined : await loader(absPath, content);
+
+			return emplace(
+				loadCache,
+				absPath,
+				transform(isEmpty ? {...result, isEmpty, config: undefined} : result),
+			);
+		},
+		clearLoadCache() {
+			if (cache) loadCache.clear();
+		},
+		clearSearchCache() {
+			if (cache) searchCache.clear();
+		},
+		clearCaches() {
+			if (cache) {
+				loadCache.clear();
+				searchCache.clear();
+			}
+		},
+	};
+};
+
+/** @type {import('./index').lilconfigSync} */
+src$2.lilconfigSync = function lilconfigSync(name, options) {
+	const {
+		ignoreEmptySearchPlaces,
+		loaders,
+		packageProp,
+		searchPlaces,
+		stopDir,
+		transform,
+		cache,
+	} = getOptions(name, options ?? {}, true);
+	const searchCache = new Map();
+	const loadCache = new Map();
+	const emplace = makeEmplace(cache);
+
+	return {
+		search(searchFrom = process.cwd()) {
+			/** @type {import('./index').LilconfigResult} */
+			const result = {
+				config: null,
+				filepath: '',
+			};
+
+			/** @type {Set} */
+			const visited = new Set();
+			let dir = searchFrom;
+			dirLoop: while (true) {
+				if (cache) {
+					const r = searchCache.get(dir);
+					if (r !== undefined) {
+						for (const p of visited) searchCache.set(p, r);
+						return r;
+					}
+					visited.add(dir);
+				}
+
+				for (const searchPlace of searchPlaces) {
+					const filepath = path$a.join(dir, searchPlace);
+					try {
+						fs$a.accessSync(filepath);
+					} catch {
+						continue;
+					}
+					const loaderKey = path$a.extname(searchPlace) || 'noExt';
+					const loader = loaders[loaderKey];
+					const content = String(fs$a.readFileSync(filepath));
+
+					// handle package.json
+					if (searchPlace === 'package.json') {
+						const pkg = loader(filepath, content);
+						const maybeConfig = getPackageProp(packageProp, pkg);
+						if (maybeConfig != null) {
+							result.config = maybeConfig;
+							result.filepath = filepath;
+							break dirLoop;
+						}
+
+						continue;
+					}
+
+					// handle other type of configs
+					const isEmpty = content.trim() === '';
+					if (isEmpty && ignoreEmptySearchPlaces) continue;
+
+					if (isEmpty) {
+						result.isEmpty = true;
+						result.config = undefined;
+					} else {
+						validateLoader(loader, loaderKey);
+						result.config = loader(filepath, content);
+					}
+					result.filepath = filepath;
+					break dirLoop;
+				}
+				if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
+				dir = parentDir(dir);
+			}
+
+			const transformed =
+				// not found
+				result.filepath === '' && result.config === null
+					? transform(null)
+					: transform(result);
+
+			if (cache) {
+				for (const p of visited) searchCache.set(p, transformed);
+			}
+
+			return transformed;
+		},
+		load(filepath) {
+			validateFilePath(filepath);
+			const absPath = path$a.resolve(process.cwd(), filepath);
+			if (cache && loadCache.has(absPath)) {
+				return loadCache.get(absPath);
+			}
+			const {base, ext} = path$a.parse(absPath);
+			const loaderKey = ext || 'noExt';
+			const loader = loaders[loaderKey];
+			validateLoader(loader, loaderKey);
+
+			const content = String(fs$a.readFileSync(absPath));
+
+			if (base === 'package.json') {
+				const pkg = loader(absPath, content);
+				return transform({
+					config: getPackageProp(packageProp, pkg),
+					filepath: absPath,
+				});
+			}
+			const result = {
+				config: null,
+				filepath: absPath,
+			};
+			// handle other type of configs
+			const isEmpty = content.trim() === '';
+			if (isEmpty && ignoreEmptySearchPlaces)
+				return emplace(
+					loadCache,
+					absPath,
+					transform({
+						filepath: absPath,
+						config: undefined,
+						isEmpty: true,
+					}),
+				);
+
+			// cosmiconfig returns undefined for empty files
+			result.config = isEmpty ? undefined : loader(absPath, content);
+
+			return emplace(
+				loadCache,
+				absPath,
+				transform(isEmpty ? {...result, isEmpty, config: undefined} : result),
+			);
+		},
+		clearLoadCache() {
+			if (cache) loadCache.clear();
+		},
+		clearSearchCache() {
+			if (cache) searchCache.clear();
+		},
+		clearCaches() {
+			if (cache) {
+				loadCache.clear();
+				searchCache.clear();
+			}
+		},
+	};
+};
+
+const ALIAS = Symbol.for('yaml.alias');
+const DOC = Symbol.for('yaml.document');
+const MAP = Symbol.for('yaml.map');
+const PAIR = Symbol.for('yaml.pair');
+const SCALAR$1 = Symbol.for('yaml.scalar');
+const SEQ = Symbol.for('yaml.seq');
+const NODE_TYPE = Symbol.for('yaml.node.type');
+const isAlias = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === ALIAS;
+const isDocument = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === DOC;
+const isMap = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === MAP;
+const isPair = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === PAIR;
+const isScalar$1 = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SCALAR$1;
+const isSeq = (node) => !!node && typeof node === 'object' && node[NODE_TYPE] === SEQ;
+function isCollection$1(node) {
+    if (node && typeof node === 'object')
+        switch (node[NODE_TYPE]) {
+            case MAP:
+            case SEQ:
+                return true;
+        }
+    return false;
+}
+function isNode$1(node) {
+    if (node && typeof node === 'object')
+        switch (node[NODE_TYPE]) {
+            case ALIAS:
+            case MAP:
+            case SCALAR$1:
+            case SEQ:
+                return true;
+        }
+    return false;
+}
+const hasAnchor = (node) => (isScalar$1(node) || isCollection$1(node)) && !!node.anchor;
+
+const BREAK$1 = Symbol('break visit');
+const SKIP$1 = Symbol('skip children');
+const REMOVE$1 = Symbol('remove node');
+/**
+ * Apply a visitor to an AST node or document.
+ *
+ * Walks through the tree (depth-first) starting from `node`, calling a
+ * `visitor` function with three arguments:
+ *   - `key`: For sequence values and map `Pair`, the node's index in the
+ *     collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
+ *     `null` for the root node.
+ *   - `node`: The current node.
+ *   - `path`: The ancestry of the current node.
+ *
+ * The return value of the visitor may be used to control the traversal:
+ *   - `undefined` (default): Do nothing and continue
+ *   - `visit.SKIP`: Do not visit the children of this node, continue with next
+ *     sibling
+ *   - `visit.BREAK`: Terminate traversal completely
+ *   - `visit.REMOVE`: Remove the current node, then continue with the next one
+ *   - `Node`: Replace the current node, then continue by visiting it
+ *   - `number`: While iterating the items of a sequence or map, set the index
+ *     of the next step. This is useful especially if the index of the current
+ *     node has changed.
+ *
+ * If `visitor` is a single function, it will be called with all values
+ * encountered in the tree, including e.g. `null` values. Alternatively,
+ * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
+ * `Alias` and `Scalar` node. To define the same visitor function for more than
+ * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
+ * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
+ * specific defined one will be used for each node.
+ */
+function visit$1(node, visitor) {
+    const visitor_ = initVisitor(visitor);
+    if (isDocument(node)) {
+        const cd = visit_(null, node.contents, visitor_, Object.freeze([node]));
+        if (cd === REMOVE$1)
+            node.contents = null;
+    }
+    else
+        visit_(null, node, visitor_, Object.freeze([]));
+}
+// Without the `as symbol` casts, TS declares these in the `visit`
+// namespace using `var`, but then complains about that because
+// `unique symbol` must be `const`.
+/** Terminate visit traversal completely */
+visit$1.BREAK = BREAK$1;
+/** Do not visit the children of the current node */
+visit$1.SKIP = SKIP$1;
+/** Remove the current node */
+visit$1.REMOVE = REMOVE$1;
+function visit_(key, node, visitor, path) {
+    const ctrl = callVisitor(key, node, visitor, path);
+    if (isNode$1(ctrl) || isPair(ctrl)) {
+        replaceNode(key, path, ctrl);
+        return visit_(key, ctrl, visitor, path);
+    }
+    if (typeof ctrl !== 'symbol') {
+        if (isCollection$1(node)) {
+            path = Object.freeze(path.concat(node));
+            for (let i = 0; i < node.items.length; ++i) {
+                const ci = visit_(i, node.items[i], visitor, path);
+                if (typeof ci === 'number')
+                    i = ci - 1;
+                else if (ci === BREAK$1)
+                    return BREAK$1;
+                else if (ci === REMOVE$1) {
+                    node.items.splice(i, 1);
+                    i -= 1;
+                }
+            }
+        }
+        else if (isPair(node)) {
+            path = Object.freeze(path.concat(node));
+            const ck = visit_('key', node.key, visitor, path);
+            if (ck === BREAK$1)
+                return BREAK$1;
+            else if (ck === REMOVE$1)
+                node.key = null;
+            const cv = visit_('value', node.value, visitor, path);
+            if (cv === BREAK$1)
+                return BREAK$1;
+            else if (cv === REMOVE$1)
+                node.value = null;
+        }
+    }
+    return ctrl;
+}
+/**
+ * Apply an async visitor to an AST node or document.
+ *
+ * Walks through the tree (depth-first) starting from `node`, calling a
+ * `visitor` function with three arguments:
+ *   - `key`: For sequence values and map `Pair`, the node's index in the
+ *     collection. Within a `Pair`, `'key'` or `'value'`, correspondingly.
+ *     `null` for the root node.
+ *   - `node`: The current node.
+ *   - `path`: The ancestry of the current node.
+ *
+ * The return value of the visitor may be used to control the traversal:
+ *   - `Promise`: Must resolve to one of the following values
+ *   - `undefined` (default): Do nothing and continue
+ *   - `visit.SKIP`: Do not visit the children of this node, continue with next
+ *     sibling
+ *   - `visit.BREAK`: Terminate traversal completely
+ *   - `visit.REMOVE`: Remove the current node, then continue with the next one
+ *   - `Node`: Replace the current node, then continue by visiting it
+ *   - `number`: While iterating the items of a sequence or map, set the index
+ *     of the next step. This is useful especially if the index of the current
+ *     node has changed.
+ *
+ * If `visitor` is a single function, it will be called with all values
+ * encountered in the tree, including e.g. `null` values. Alternatively,
+ * separate visitor functions may be defined for each `Map`, `Pair`, `Seq`,
+ * `Alias` and `Scalar` node. To define the same visitor function for more than
+ * one node type, use the `Collection` (map and seq), `Value` (map, seq & scalar)
+ * and `Node` (alias, map, seq & scalar) targets. Of all these, only the most
+ * specific defined one will be used for each node.
+ */
+async function visitAsync(node, visitor) {
+    const visitor_ = initVisitor(visitor);
+    if (isDocument(node)) {
+        const cd = await visitAsync_(null, node.contents, visitor_, Object.freeze([node]));
+        if (cd === REMOVE$1)
+            node.contents = null;
+    }
+    else
+        await visitAsync_(null, node, visitor_, Object.freeze([]));
+}
+// Without the `as symbol` casts, TS declares these in the `visit`
+// namespace using `var`, but then complains about that because
+// `unique symbol` must be `const`.
+/** Terminate visit traversal completely */
+visitAsync.BREAK = BREAK$1;
+/** Do not visit the children of the current node */
+visitAsync.SKIP = SKIP$1;
+/** Remove the current node */
+visitAsync.REMOVE = REMOVE$1;
+async function visitAsync_(key, node, visitor, path) {
+    const ctrl = await callVisitor(key, node, visitor, path);
+    if (isNode$1(ctrl) || isPair(ctrl)) {
+        replaceNode(key, path, ctrl);
+        return visitAsync_(key, ctrl, visitor, path);
+    }
+    if (typeof ctrl !== 'symbol') {
+        if (isCollection$1(node)) {
+            path = Object.freeze(path.concat(node));
+            for (let i = 0; i < node.items.length; ++i) {
+                const ci = await visitAsync_(i, node.items[i], visitor, path);
+                if (typeof ci === 'number')
+                    i = ci - 1;
+                else if (ci === BREAK$1)
+                    return BREAK$1;
+                else if (ci === REMOVE$1) {
+                    node.items.splice(i, 1);
+                    i -= 1;
+                }
+            }
+        }
+        else if (isPair(node)) {
+            path = Object.freeze(path.concat(node));
+            const ck = await visitAsync_('key', node.key, visitor, path);
+            if (ck === BREAK$1)
+                return BREAK$1;
+            else if (ck === REMOVE$1)
+                node.key = null;
+            const cv = await visitAsync_('value', node.value, visitor, path);
+            if (cv === BREAK$1)
+                return BREAK$1;
+            else if (cv === REMOVE$1)
+                node.value = null;
+        }
+    }
+    return ctrl;
+}
+function initVisitor(visitor) {
+    if (typeof visitor === 'object' &&
+        (visitor.Collection || visitor.Node || visitor.Value)) {
+        return Object.assign({
+            Alias: visitor.Node,
+            Map: visitor.Node,
+            Scalar: visitor.Node,
+            Seq: visitor.Node
+        }, visitor.Value && {
+            Map: visitor.Value,
+            Scalar: visitor.Value,
+            Seq: visitor.Value
+        }, visitor.Collection && {
+            Map: visitor.Collection,
+            Seq: visitor.Collection
+        }, visitor);
+    }
+    return visitor;
+}
+function callVisitor(key, node, visitor, path) {
+    if (typeof visitor === 'function')
+        return visitor(key, node, path);
+    if (isMap(node))
+        return visitor.Map?.(key, node, path);
+    if (isSeq(node))
+        return visitor.Seq?.(key, node, path);
+    if (isPair(node))
+        return visitor.Pair?.(key, node, path);
+    if (isScalar$1(node))
+        return visitor.Scalar?.(key, node, path);
+    if (isAlias(node))
+        return visitor.Alias?.(key, node, path);
+    return undefined;
+}
+function replaceNode(key, path, node) {
+    const parent = path[path.length - 1];
+    if (isCollection$1(parent)) {
+        parent.items[key] = node;
+    }
+    else if (isPair(parent)) {
+        if (key === 'key')
+            parent.key = node;
+        else
+            parent.value = node;
+    }
+    else if (isDocument(parent)) {
+        parent.contents = node;
+    }
+    else {
+        const pt = isAlias(parent) ? 'alias' : 'scalar';
+        throw new Error(`Cannot replace node with ${pt} parent`);
+    }
+}
+
+const escapeChars = {
+    '!': '%21',
+    ',': '%2C',
+    '[': '%5B',
+    ']': '%5D',
+    '{': '%7B',
+    '}': '%7D'
+};
+const escapeTagName = (tn) => tn.replace(/[!,[\]{}]/g, ch => escapeChars[ch]);
+class Directives {
+    constructor(yaml, tags) {
+        /**
+         * The directives-end/doc-start marker `---`. If `null`, a marker may still be
+         * included in the document's stringified representation.
+         */
+        this.docStart = null;
+        /** The doc-end marker `...`.  */
+        this.docEnd = false;
+        this.yaml = Object.assign({}, Directives.defaultYaml, yaml);
+        this.tags = Object.assign({}, Directives.defaultTags, tags);
+    }
+    clone() {
+        const copy = new Directives(this.yaml, this.tags);
+        copy.docStart = this.docStart;
+        return copy;
+    }
+    /**
+     * During parsing, get a Directives instance for the current document and
+     * update the stream state according to the current version's spec.
+     */
+    atDocument() {
+        const res = new Directives(this.yaml, this.tags);
+        switch (this.yaml.version) {
+            case '1.1':
+                this.atNextDocument = true;
+                break;
+            case '1.2':
+                this.atNextDocument = false;
+                this.yaml = {
+                    explicit: Directives.defaultYaml.explicit,
+                    version: '1.2'
+                };
+                this.tags = Object.assign({}, Directives.defaultTags);
+                break;
+        }
+        return res;
+    }
+    /**
+     * @param onError - May be called even if the action was successful
+     * @returns `true` on success
+     */
+    add(line, onError) {
+        if (this.atNextDocument) {
+            this.yaml = { explicit: Directives.defaultYaml.explicit, version: '1.1' };
+            this.tags = Object.assign({}, Directives.defaultTags);
+            this.atNextDocument = false;
+        }
+        const parts = line.trim().split(/[ \t]+/);
+        const name = parts.shift();
+        switch (name) {
+            case '%TAG': {
+                if (parts.length !== 2) {
+                    onError(0, '%TAG directive should contain exactly two parts');
+                    if (parts.length < 2)
+                        return false;
+                }
+                const [handle, prefix] = parts;
+                this.tags[handle] = prefix;
+                return true;
+            }
+            case '%YAML': {
+                this.yaml.explicit = true;
+                if (parts.length !== 1) {
+                    onError(0, '%YAML directive should contain exactly one part');
+                    return false;
+                }
+                const [version] = parts;
+                if (version === '1.1' || version === '1.2') {
+                    this.yaml.version = version;
+                    return true;
+                }
+                else {
+                    const isValid = /^\d+\.\d+$/.test(version);
+                    onError(6, `Unsupported YAML version ${version}`, isValid);
+                    return false;
+                }
+            }
+            default:
+                onError(0, `Unknown directive ${name}`, true);
+                return false;
+        }
+    }
+    /**
+     * Resolves a tag, matching handles to those defined in %TAG directives.
+     *
+     * @returns Resolved tag, which may also be the non-specific tag `'!'` or a
+     *   `'!local'` tag, or `null` if unresolvable.
+     */
+    tagName(source, onError) {
+        if (source === '!')
+            return '!'; // non-specific tag
+        if (source[0] !== '!') {
+            onError(`Not a valid tag: ${source}`);
+            return null;
+        }
+        if (source[1] === '<') {
+            const verbatim = source.slice(2, -1);
+            if (verbatim === '!' || verbatim === '!!') {
+                onError(`Verbatim tags aren't resolved, so ${source} is invalid.`);
+                return null;
+            }
+            if (source[source.length - 1] !== '>')
+                onError('Verbatim tags must end with a >');
+            return verbatim;
+        }
+        const [, handle, suffix] = source.match(/^(.*!)([^!]*)$/s);
+        if (!suffix)
+            onError(`The ${source} tag has no suffix`);
+        const prefix = this.tags[handle];
+        if (prefix) {
+            try {
+                return prefix + decodeURIComponent(suffix);
+            }
+            catch (error) {
+                onError(String(error));
+                return null;
+            }
+        }
+        if (handle === '!')
+            return source; // local tag
+        onError(`Could not resolve tag: ${source}`);
+        return null;
+    }
+    /**
+     * Given a fully resolved tag, returns its printable string form,
+     * taking into account current tag prefixes and defaults.
+     */
+    tagString(tag) {
+        for (const [handle, prefix] of Object.entries(this.tags)) {
+            if (tag.startsWith(prefix))
+                return handle + escapeTagName(tag.substring(prefix.length));
+        }
+        return tag[0] === '!' ? tag : `!<${tag}>`;
+    }
+    toString(doc) {
+        const lines = this.yaml.explicit
+            ? [`%YAML ${this.yaml.version || '1.2'}`]
+            : [];
+        const tagEntries = Object.entries(this.tags);
+        let tagNames;
+        if (doc && tagEntries.length > 0 && isNode$1(doc.contents)) {
+            const tags = {};
+            visit$1(doc.contents, (_key, node) => {
+                if (isNode$1(node) && node.tag)
+                    tags[node.tag] = true;
+            });
+            tagNames = Object.keys(tags);
+        }
+        else
+            tagNames = [];
+        for (const [handle, prefix] of tagEntries) {
+            if (handle === '!!' && prefix === 'tag:yaml.org,2002:')
+                continue;
+            if (!doc || tagNames.some(tn => tn.startsWith(prefix)))
+                lines.push(`%TAG ${handle} ${prefix}`);
+        }
+        return lines.join('\n');
+    }
+}
+Directives.defaultYaml = { explicit: false, version: '1.2' };
+Directives.defaultTags = { '!!': 'tag:yaml.org,2002:' };
+
+/**
+ * Verify that the input string is a valid anchor.
+ *
+ * Will throw on errors.
+ */
+function anchorIsValid(anchor) {
+    if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
+        const sa = JSON.stringify(anchor);
+        const msg = `Anchor must not contain whitespace or control characters: ${sa}`;
+        throw new Error(msg);
+    }
+    return true;
+}
+function anchorNames(root) {
+    const anchors = new Set();
+    visit$1(root, {
+        Value(_key, node) {
+            if (node.anchor)
+                anchors.add(node.anchor);
+        }
+    });
+    return anchors;
+}
+/** Find a new anchor name with the given `prefix` and a one-indexed suffix. */
+function findNewAnchor(prefix, exclude) {
+    for (let i = 1; true; ++i) {
+        const name = `${prefix}${i}`;
+        if (!exclude.has(name))
+            return name;
+    }
+}
+function createNodeAnchors(doc, prefix) {
+    const aliasObjects = [];
+    const sourceObjects = new Map();
+    let prevAnchors = null;
+    return {
+        onAnchor: (source) => {
+            aliasObjects.push(source);
+            if (!prevAnchors)
+                prevAnchors = anchorNames(doc);
+            const anchor = findNewAnchor(prefix, prevAnchors);
+            prevAnchors.add(anchor);
+            return anchor;
+        },
+        /**
+         * With circular references, the source node is only resolved after all
+         * of its child nodes are. This is why anchors are set only after all of
+         * the nodes have been created.
+         */
+        setAnchors: () => {
+            for (const source of aliasObjects) {
+                const ref = sourceObjects.get(source);
+                if (typeof ref === 'object' &&
+                    ref.anchor &&
+                    (isScalar$1(ref.node) || isCollection$1(ref.node))) {
+                    ref.node.anchor = ref.anchor;
+                }
+                else {
+                    const error = new Error('Failed to resolve repeated object (this should not happen)');
+                    error.source = source;
+                    throw error;
+                }
+            }
+        },
+        sourceObjects
+    };
+}
+
+/**
+ * Applies the JSON.parse reviver algorithm as defined in the ECMA-262 spec,
+ * in section 24.5.1.1 "Runtime Semantics: InternalizeJSONProperty" of the
+ * 2021 edition: https://tc39.es/ecma262/#sec-json.parse
+ *
+ * Includes extensions for handling Map and Set objects.
+ */
+function applyReviver(reviver, obj, key, val) {
+    if (val && typeof val === 'object') {
+        if (Array.isArray(val)) {
+            for (let i = 0, len = val.length; i < len; ++i) {
+                const v0 = val[i];
+                const v1 = applyReviver(reviver, val, String(i), v0);
+                if (v1 === undefined)
+                    delete val[i];
+                else if (v1 !== v0)
+                    val[i] = v1;
+            }
+        }
+        else if (val instanceof Map) {
+            for (const k of Array.from(val.keys())) {
+                const v0 = val.get(k);
+                const v1 = applyReviver(reviver, val, k, v0);
+                if (v1 === undefined)
+                    val.delete(k);
+                else if (v1 !== v0)
+                    val.set(k, v1);
+            }
+        }
+        else if (val instanceof Set) {
+            for (const v0 of Array.from(val)) {
+                const v1 = applyReviver(reviver, val, v0, v0);
+                if (v1 === undefined)
+                    val.delete(v0);
+                else if (v1 !== v0) {
+                    val.delete(v0);
+                    val.add(v1);
+                }
+            }
+        }
+        else {
+            for (const [k, v0] of Object.entries(val)) {
+                const v1 = applyReviver(reviver, val, k, v0);
+                if (v1 === undefined)
+                    delete val[k];
+                else if (v1 !== v0)
+                    val[k] = v1;
+            }
+        }
+    }
+    return reviver.call(obj, key, val);
+}
+
+/**
+ * Recursively convert any node or its contents to native JavaScript
+ *
+ * @param value - The input value
+ * @param arg - If `value` defines a `toJSON()` method, use this
+ *   as its first argument
+ * @param ctx - Conversion context, originally set in Document#toJS(). If
+ *   `{ keep: true }` is not set, output should be suitable for JSON
+ *   stringification.
+ */
+function toJS(value, arg, ctx) {
+    // eslint-disable-next-line @typescript-eslint/no-unsafe-return
+    if (Array.isArray(value))
+        return value.map((v, i) => toJS(v, String(i), ctx));
+    if (value && typeof value.toJSON === 'function') {
+        // eslint-disable-next-line @typescript-eslint/no-unsafe-call
+        if (!ctx || !hasAnchor(value))
+            return value.toJSON(arg, ctx);
+        const data = { aliasCount: 0, count: 1, res: undefined };
+        ctx.anchors.set(value, data);
+        ctx.onCreate = res => {
+            data.res = res;
+            delete ctx.onCreate;
+        };
+        const res = value.toJSON(arg, ctx);
+        if (ctx.onCreate)
+            ctx.onCreate(res);
+        return res;
+    }
+    if (typeof value === 'bigint' && !ctx?.keep)
+        return Number(value);
+    return value;
+}
+
+class NodeBase {
+    constructor(type) {
+        Object.defineProperty(this, NODE_TYPE, { value: type });
+    }
+    /** Create a copy of this node.  */
+    clone() {
+        const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
+        if (this.range)
+            copy.range = this.range.slice();
+        return copy;
+    }
+    /** A plain JavaScript representation of this node. */
+    toJS(doc, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
+        if (!isDocument(doc))
+            throw new TypeError('A document argument is required');
+        const ctx = {
+            anchors: new Map(),
+            doc,
+            keep: true,
+            mapAsMap: mapAsMap === true,
+            mapKeyWarned: false,
+            maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
+        };
+        const res = toJS(this, '', ctx);
+        if (typeof onAnchor === 'function')
+            for (const { count, res } of ctx.anchors.values())
+                onAnchor(res, count);
+        return typeof reviver === 'function'
+            ? applyReviver(reviver, { '': res }, '', res)
+            : res;
+    }
+}
+
+class Alias extends NodeBase {
+    constructor(source) {
+        super(ALIAS);
+        this.source = source;
+        Object.defineProperty(this, 'tag', {
+            set() {
+                throw new Error('Alias nodes cannot have tags');
+            }
+        });
+    }
+    /**
+     * Resolve the value of this alias within `doc`, finding the last
+     * instance of the `source` anchor before this node.
+     */
+    resolve(doc) {
+        let found = undefined;
+        visit$1(doc, {
+            Node: (_key, node) => {
+                if (node === this)
+                    return visit$1.BREAK;
+                if (node.anchor === this.source)
+                    found = node;
+            }
+        });
+        return found;
+    }
+    toJSON(_arg, ctx) {
+        if (!ctx)
+            return { source: this.source };
+        const { anchors, doc, maxAliasCount } = ctx;
+        const source = this.resolve(doc);
+        if (!source) {
+            const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
+            throw new ReferenceError(msg);
+        }
+        let data = anchors.get(source);
+        if (!data) {
+            // Resolve anchors for Node.prototype.toJS()
+            toJS(source, null, ctx);
+            data = anchors.get(source);
+        }
+        /* istanbul ignore if */
+        if (!data || data.res === undefined) {
+            const msg = 'This should not happen: Alias anchor was not resolved?';
+            throw new ReferenceError(msg);
+        }
+        if (maxAliasCount >= 0) {
+            data.count += 1;
+            if (data.aliasCount === 0)
+                data.aliasCount = getAliasCount(doc, source, anchors);
+            if (data.count * data.aliasCount > maxAliasCount) {
+                const msg = 'Excessive alias count indicates a resource exhaustion attack';
+                throw new ReferenceError(msg);
+            }
+        }
+        return data.res;
+    }
+    toString(ctx, _onComment, _onChompKeep) {
+        const src = `*${this.source}`;
+        if (ctx) {
+            anchorIsValid(this.source);
+            if (ctx.options.verifyAliasOrder && !ctx.anchors.has(this.source)) {
+                const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
+                throw new Error(msg);
+            }
+            if (ctx.implicitKey)
+                return `${src} `;
+        }
+        return src;
+    }
+}
+function getAliasCount(doc, node, anchors) {
+    if (isAlias(node)) {
+        const source = node.resolve(doc);
+        const anchor = anchors && source && anchors.get(source);
+        return anchor ? anchor.count * anchor.aliasCount : 0;
+    }
+    else if (isCollection$1(node)) {
+        let count = 0;
+        for (const item of node.items) {
+            const c = getAliasCount(doc, item, anchors);
+            if (c > count)
+                count = c;
+        }
+        return count;
+    }
+    else if (isPair(node)) {
+        const kc = getAliasCount(doc, node.key, anchors);
+        const vc = getAliasCount(doc, node.value, anchors);
+        return Math.max(kc, vc);
+    }
+    return 1;
+}
+
+const isScalarValue = (value) => !value || (typeof value !== 'function' && typeof value !== 'object');
+class Scalar extends NodeBase {
+    constructor(value) {
+        super(SCALAR$1);
+        this.value = value;
+    }
+    toJSON(arg, ctx) {
+        return ctx?.keep ? this.value : toJS(this.value, arg, ctx);
+    }
+    toString() {
+        return String(this.value);
+    }
+}
+Scalar.BLOCK_FOLDED = 'BLOCK_FOLDED';
+Scalar.BLOCK_LITERAL = 'BLOCK_LITERAL';
+Scalar.PLAIN = 'PLAIN';
+Scalar.QUOTE_DOUBLE = 'QUOTE_DOUBLE';
+Scalar.QUOTE_SINGLE = 'QUOTE_SINGLE';
+
+const defaultTagPrefix = 'tag:yaml.org,2002:';
+function findTagObject(value, tagName, tags) {
+    if (tagName) {
+        const match = tags.filter(t => t.tag === tagName);
+        const tagObj = match.find(t => !t.format) ?? match[0];
+        if (!tagObj)
+            throw new Error(`Tag ${tagName} not found`);
+        return tagObj;
+    }
+    return tags.find(t => t.identify?.(value) && !t.format);
+}
+function createNode(value, tagName, ctx) {
+    if (isDocument(value))
+        value = value.contents;
+    if (isNode$1(value))
+        return value;
+    if (isPair(value)) {
+        const map = ctx.schema[MAP].createNode?.(ctx.schema, null, ctx);
+        map.items.push(value);
+        return map;
+    }
+    if (value instanceof String ||
+        value instanceof Number ||
+        value instanceof Boolean ||
+        (typeof BigInt !== 'undefined' && value instanceof BigInt) // not supported everywhere
+    ) {
+        // https://tc39.es/ecma262/#sec-serializejsonproperty
+        value = value.valueOf();
+    }
+    const { aliasDuplicateObjects, onAnchor, onTagObj, schema, sourceObjects } = ctx;
+    // Detect duplicate references to the same object & use Alias nodes for all
+    // after first. The `ref` wrapper allows for circular references to resolve.
+    let ref = undefined;
+    if (aliasDuplicateObjects && value && typeof value === 'object') {
+        ref = sourceObjects.get(value);
+        if (ref) {
+            if (!ref.anchor)
+                ref.anchor = onAnchor(value);
+            return new Alias(ref.anchor);
+        }
+        else {
+            ref = { anchor: null, node: null };
+            sourceObjects.set(value, ref);
+        }
+    }
+    if (tagName?.startsWith('!!'))
+        tagName = defaultTagPrefix + tagName.slice(2);
+    let tagObj = findTagObject(value, tagName, schema.tags);
+    if (!tagObj) {
+        if (value && typeof value.toJSON === 'function') {
+            // eslint-disable-next-line @typescript-eslint/no-unsafe-call
+            value = value.toJSON();
+        }
+        if (!value || typeof value !== 'object') {
+            const node = new Scalar(value);
+            if (ref)
+                ref.node = node;
+            return node;
+        }
+        tagObj =
+            value instanceof Map
+                ? schema[MAP]
+                : Symbol.iterator in Object(value)
+                    ? schema[SEQ]
+                    : schema[MAP];
+    }
+    if (onTagObj) {
+        onTagObj(tagObj);
+        delete ctx.onTagObj;
+    }
+    const node = tagObj?.createNode
+        ? tagObj.createNode(ctx.schema, value, ctx)
+        : typeof tagObj?.nodeClass?.from === 'function'
+            ? tagObj.nodeClass.from(ctx.schema, value, ctx)
+            : new Scalar(value);
+    if (tagName)
+        node.tag = tagName;
+    else if (!tagObj.default)
+        node.tag = tagObj.tag;
+    if (ref)
+        ref.node = node;
+    return node;
+}
+
+function collectionFromPath(schema, path, value) {
+    let v = value;
+    for (let i = path.length - 1; i >= 0; --i) {
+        const k = path[i];
+        if (typeof k === 'number' && Number.isInteger(k) && k >= 0) {
+            const a = [];
+            a[k] = v;
+            v = a;
+        }
+        else {
+            v = new Map([[k, v]]);
+        }
+    }
+    return createNode(v, undefined, {
+        aliasDuplicateObjects: false,
+        keepUndefined: false,
+        onAnchor: () => {
+            throw new Error('This should not happen, please report a bug.');
+        },
+        schema,
+        sourceObjects: new Map()
+    });
+}
+// Type guard is intentionally a little wrong so as to be more useful,
+// as it does not cover untypable empty non-string iterables (e.g. []).
+const isEmptyPath = (path) => path == null ||
+    (typeof path === 'object' && !!path[Symbol.iterator]().next().done);
+class Collection extends NodeBase {
+    constructor(type, schema) {
+        super(type);
+        Object.defineProperty(this, 'schema', {
+            value: schema,
+            configurable: true,
+            enumerable: false,
+            writable: true
+        });
+    }
+    /**
+     * Create a copy of this collection.
+     *
+     * @param schema - If defined, overwrites the original's schema
+     */
+    clone(schema) {
+        const copy = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
+        if (schema)
+            copy.schema = schema;
+        copy.items = copy.items.map(it => isNode$1(it) || isPair(it) ? it.clone(schema) : it);
+        if (this.range)
+            copy.range = this.range.slice();
+        return copy;
+    }
+    /**
+     * Adds a value to the collection. For `!!map` and `!!omap` the value must
+     * be a Pair instance or a `{ key, value }` object, which may not have a key
+     * that already exists in the map.
+     */
+    addIn(path, value) {
+        if (isEmptyPath(path))
+            this.add(value);
+        else {
+            const [key, ...rest] = path;
+            const node = this.get(key, true);
+            if (isCollection$1(node))
+                node.addIn(rest, value);
+            else if (node === undefined && this.schema)
+                this.set(key, collectionFromPath(this.schema, rest, value));
+            else
+                throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
+        }
+    }
+    /**
+     * Removes a value from the collection.
+     * @returns `true` if the item was found and removed.
+     */
+    deleteIn(path) {
+        const [key, ...rest] = path;
+        if (rest.length === 0)
+            return this.delete(key);
+        const node = this.get(key, true);
+        if (isCollection$1(node))
+            return node.deleteIn(rest);
+        else
+            throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
+    }
+    /**
+     * Returns item at `key`, or `undefined` if not found. By default unwraps
+     * scalar values from their surrounding node; to disable set `keepScalar` to
+     * `true` (collections are always returned intact).
+     */
+    getIn(path, keepScalar) {
+        const [key, ...rest] = path;
+        const node = this.get(key, true);
+        if (rest.length === 0)
+            return !keepScalar && isScalar$1(node) ? node.value : node;
+        else
+            return isCollection$1(node) ? node.getIn(rest, keepScalar) : undefined;
+    }
+    hasAllNullValues(allowScalar) {
+        return this.items.every(node => {
+            if (!isPair(node))
+                return false;
+            const n = node.value;
+            return (n == null ||
+                (allowScalar &&
+                    isScalar$1(n) &&
+                    n.value == null &&
+                    !n.commentBefore &&
+                    !n.comment &&
+                    !n.tag));
+        });
+    }
+    /**
+     * Checks if the collection includes a value with the key `key`.
+     */
+    hasIn(path) {
+        const [key, ...rest] = path;
+        if (rest.length === 0)
+            return this.has(key);
+        const node = this.get(key, true);
+        return isCollection$1(node) ? node.hasIn(rest) : false;
+    }
+    /**
+     * Sets a value in this collection. For `!!set`, `value` needs to be a
+     * boolean to add/remove the item from the set.
+     */
+    setIn(path, value) {
+        const [key, ...rest] = path;
+        if (rest.length === 0) {
+            this.set(key, value);
+        }
+        else {
+            const node = this.get(key, true);
+            if (isCollection$1(node))
+                node.setIn(rest, value);
+            else if (node === undefined && this.schema)
+                this.set(key, collectionFromPath(this.schema, rest, value));
+            else
+                throw new Error(`Expected YAML collection at ${key}. Remaining path: ${rest}`);
+        }
+    }
+}
+
+/**
+ * Stringifies a comment.
+ *
+ * Empty comment lines are left empty,
+ * lines consisting of a single space are replaced by `#`,
+ * and all other lines are prefixed with a `#`.
+ */
+const stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, '#');
+function indentComment(comment, indent) {
+    if (/^\n+$/.test(comment))
+        return comment.substring(1);
+    return indent ? comment.replace(/^(?! *$)/gm, indent) : comment;
+}
+const lineComment = (str, indent, comment) => str.endsWith('\n')
+    ? indentComment(comment, indent)
+    : comment.includes('\n')
+        ? '\n' + indentComment(comment, indent)
+        : (str.endsWith(' ') ? '' : ' ') + comment;
+
+const FOLD_FLOW = 'flow';
+const FOLD_BLOCK = 'block';
+const FOLD_QUOTED = 'quoted';
+/**
+ * Tries to keep input at up to `lineWidth` characters, splitting only on spaces
+ * not followed by newlines or spaces unless `mode` is `'quoted'`. Lines are
+ * terminated with `\n` and started with `indent`.
+ */
+function foldFlowLines(text, indent, mode = 'flow', { indentAtStart, lineWidth = 80, minContentWidth = 20, onFold, onOverflow } = {}) {
+    if (!lineWidth || lineWidth < 0)
+        return text;
+    if (lineWidth < minContentWidth)
+        minContentWidth = 0;
+    const endStep = Math.max(1 + minContentWidth, 1 + lineWidth - indent.length);
+    if (text.length <= endStep)
+        return text;
+    const folds = [];
+    const escapedFolds = {};
+    let end = lineWidth - indent.length;
+    if (typeof indentAtStart === 'number') {
+        if (indentAtStart > lineWidth - Math.max(2, minContentWidth))
+            folds.push(0);
+        else
+            end = lineWidth - indentAtStart;
+    }
+    let split = undefined;
+    let prev = undefined;
+    let overflow = false;
+    let i = -1;
+    let escStart = -1;
+    let escEnd = -1;
+    if (mode === FOLD_BLOCK) {
+        i = consumeMoreIndentedLines(text, i, indent.length);
+        if (i !== -1)
+            end = i + endStep;
+    }
+    for (let ch; (ch = text[(i += 1)]);) {
+        if (mode === FOLD_QUOTED && ch === '\\') {
+            escStart = i;
+            switch (text[i + 1]) {
+                case 'x':
+                    i += 3;
+                    break;
+                case 'u':
+                    i += 5;
+                    break;
+                case 'U':
+                    i += 9;
+                    break;
+                default:
+                    i += 1;
+            }
+            escEnd = i;
+        }
+        if (ch === '\n') {
+            if (mode === FOLD_BLOCK)
+                i = consumeMoreIndentedLines(text, i, indent.length);
+            end = i + indent.length + endStep;
+            split = undefined;
+        }
+        else {
+            if (ch === ' ' &&
+                prev &&
+                prev !== ' ' &&
+                prev !== '\n' &&
+                prev !== '\t') {
+                // space surrounded by non-space can be replaced with newline + indent
+                const next = text[i + 1];
+                if (next && next !== ' ' && next !== '\n' && next !== '\t')
+                    split = i;
+            }
+            if (i >= end) {
+                if (split) {
+                    folds.push(split);
+                    end = split + endStep;
+                    split = undefined;
+                }
+                else if (mode === FOLD_QUOTED) {
+                    // white-space collected at end may stretch past lineWidth
+                    while (prev === ' ' || prev === '\t') {
+                        prev = ch;
+                        ch = text[(i += 1)];
+                        overflow = true;
+                    }
+                    // Account for newline escape, but don't break preceding escape
+                    const j = i > escEnd + 1 ? i - 2 : escStart - 1;
+                    // Bail out if lineWidth & minContentWidth are shorter than an escape string
+                    if (escapedFolds[j])
+                        return text;
+                    folds.push(j);
+                    escapedFolds[j] = true;
+                    end = j + endStep;
+                    split = undefined;
+                }
+                else {
+                    overflow = true;
+                }
+            }
+        }
+        prev = ch;
+    }
+    if (overflow && onOverflow)
+        onOverflow();
+    if (folds.length === 0)
+        return text;
+    if (onFold)
+        onFold();
+    let res = text.slice(0, folds[0]);
+    for (let i = 0; i < folds.length; ++i) {
+        const fold = folds[i];
+        const end = folds[i + 1] || text.length;
+        if (fold === 0)
+            res = `\n${indent}${text.slice(0, end)}`;
+        else {
+            if (mode === FOLD_QUOTED && escapedFolds[fold])
+                res += `${text[fold]}\\`;
+            res += `\n${indent}${text.slice(fold + 1, end)}`;
+        }
+    }
+    return res;
+}
+/**
+ * Presumes `i + 1` is at the start of a line
+ * @returns index of last newline in more-indented block
+ */
+function consumeMoreIndentedLines(text, i, indent) {
+    let end = i;
+    let start = i + 1;
+    let ch = text[start];
+    while (ch === ' ' || ch === '\t') {
+        if (i < start + indent) {
+            ch = text[++i];
+        }
+        else {
+            do {
+                ch = text[++i];
+            } while (ch && ch !== '\n');
+            end = i;
+            start = i + 1;
+            ch = text[start];
+        }
+    }
+    return end;
+}
+
+const getFoldOptions = (ctx, isBlock) => ({
+    indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
+    lineWidth: ctx.options.lineWidth,
+    minContentWidth: ctx.options.minContentWidth
+});
+// Also checks for lines starting with %, as parsing the output as YAML 1.1 will
+// presume that's starting a new document.
+const containsDocumentMarker = (str) => /^(%|---|\.\.\.)/m.test(str);
+function lineLengthOverLimit(str, lineWidth, indentLength) {
+    if (!lineWidth || lineWidth < 0)
+        return false;
+    const limit = lineWidth - indentLength;
+    const strLen = str.length;
+    if (strLen <= limit)
+        return false;
+    for (let i = 0, start = 0; i < strLen; ++i) {
+        if (str[i] === '\n') {
+            if (i - start > limit)
+                return true;
+            start = i + 1;
+            if (strLen - start <= limit)
+                return false;
+        }
+    }
+    return true;
+}
+function doubleQuotedString(value, ctx) {
+    const json = JSON.stringify(value);
+    if (ctx.options.doubleQuotedAsJSON)
+        return json;
+    const { implicitKey } = ctx;
+    const minMultiLineLength = ctx.options.doubleQuotedMinMultiLineLength;
+    const indent = ctx.indent || (containsDocumentMarker(value) ? '  ' : '');
+    let str = '';
+    let start = 0;
+    for (let i = 0, ch = json[i]; ch; ch = json[++i]) {
+        if (ch === ' ' && json[i + 1] === '\\' && json[i + 2] === 'n') {
+            // space before newline needs to be escaped to not be folded
+            str += json.slice(start, i) + '\\ ';
+            i += 1;
+            start = i;
+            ch = '\\';
+        }
+        if (ch === '\\')
+            switch (json[i + 1]) {
+                case 'u':
+                    {
+                        str += json.slice(start, i);
+                        const code = json.substr(i + 2, 4);
+                        switch (code) {
+                            case '0000':
+                                str += '\\0';
+                                break;
+                            case '0007':
+                                str += '\\a';
+                                break;
+                            case '000b':
+                                str += '\\v';
+                                break;
+                            case '001b':
+                                str += '\\e';
+                                break;
+                            case '0085':
+                                str += '\\N';
+                                break;
+                            case '00a0':
+                                str += '\\_';
+                                break;
+                            case '2028':
+                                str += '\\L';
+                                break;
+                            case '2029':
+                                str += '\\P';
+                                break;
+                            default:
+                                if (code.substr(0, 2) === '00')
+                                    str += '\\x' + code.substr(2);
+                                else
+                                    str += json.substr(i, 6);
+                        }
+                        i += 5;
+                        start = i + 1;
+                    }
+                    break;
+                case 'n':
+                    if (implicitKey ||
+                        json[i + 2] === '"' ||
+                        json.length < minMultiLineLength) {
+                        i += 1;
+                    }
+                    else {
+                        // folding will eat first newline
+                        str += json.slice(start, i) + '\n\n';
+                        while (json[i + 2] === '\\' &&
+                            json[i + 3] === 'n' &&
+                            json[i + 4] !== '"') {
+                            str += '\n';
+                            i += 2;
+                        }
+                        str += indent;
+                        // space after newline needs to be escaped to not be folded
+                        if (json[i + 2] === ' ')
+                            str += '\\';
+                        i += 1;
+                        start = i + 1;
+                    }
+                    break;
+                default:
+                    i += 1;
+            }
+    }
+    str = start ? str + json.slice(start) : json;
+    return implicitKey
+        ? str
+        : foldFlowLines(str, indent, FOLD_QUOTED, getFoldOptions(ctx, false));
+}
+function singleQuotedString(value, ctx) {
+    if (ctx.options.singleQuote === false ||
+        (ctx.implicitKey && value.includes('\n')) ||
+        /[ \t]\n|\n[ \t]/.test(value) // single quoted string can't have leading or trailing whitespace around newline
+    )
+        return doubleQuotedString(value, ctx);
+    const indent = ctx.indent || (containsDocumentMarker(value) ? '  ' : '');
+    const res = "'" + value.replace(/'/g, "''").replace(/\n+/g, `$&\n${indent}`) + "'";
+    return ctx.implicitKey
+        ? res
+        : foldFlowLines(res, indent, FOLD_FLOW, getFoldOptions(ctx, false));
+}
+function quotedString(value, ctx) {
+    const { singleQuote } = ctx.options;
+    let qs;
+    if (singleQuote === false)
+        qs = doubleQuotedString;
+    else {
+        const hasDouble = value.includes('"');
+        const hasSingle = value.includes("'");
+        if (hasDouble && !hasSingle)
+            qs = singleQuotedString;
+        else if (hasSingle && !hasDouble)
+            qs = doubleQuotedString;
+        else
+            qs = singleQuote ? singleQuotedString : doubleQuotedString;
+    }
+    return qs(value, ctx);
+}
+// The negative lookbehind avoids a polynomial search,
+// but isn't supported yet on Safari: https://caniuse.com/js-regexp-lookbehind
+let blockEndNewlines;
+try {
+    blockEndNewlines = new RegExp('(^|(?\n';
+    // determine chomping from whitespace at value end
+    let chomp;
+    let endStart;
+    for (endStart = value.length; endStart > 0; --endStart) {
+        const ch = value[endStart - 1];
+        if (ch !== '\n' && ch !== '\t' && ch !== ' ')
+            break;
+    }
+    let end = value.substring(endStart);
+    const endNlPos = end.indexOf('\n');
+    if (endNlPos === -1) {
+        chomp = '-'; // strip
+    }
+    else if (value === end || endNlPos !== end.length - 1) {
+        chomp = '+'; // keep
+        if (onChompKeep)
+            onChompKeep();
+    }
+    else {
+        chomp = ''; // clip
+    }
+    if (end) {
+        value = value.slice(0, -end.length);
+        if (end[end.length - 1] === '\n')
+            end = end.slice(0, -1);
+        end = end.replace(blockEndNewlines, `$&${indent}`);
+    }
+    // determine indent indicator from whitespace at value start
+    let startWithSpace = false;
+    let startEnd;
+    let startNlPos = -1;
+    for (startEnd = 0; startEnd < value.length; ++startEnd) {
+        const ch = value[startEnd];
+        if (ch === ' ')
+            startWithSpace = true;
+        else if (ch === '\n')
+            startNlPos = startEnd;
+        else
+            break;
+    }
+    let start = value.substring(0, startNlPos < startEnd ? startNlPos + 1 : startEnd);
+    if (start) {
+        value = value.substring(start.length);
+        start = start.replace(/\n+/g, `$&${indent}`);
+    }
+    const indentSize = indent ? '2' : '1'; // root is at -1
+    let header = (literal ? '|' : '>') + (startWithSpace ? indentSize : '') + chomp;
+    if (comment) {
+        header += ' ' + commentString(comment.replace(/ ?[\r\n]+/g, ' '));
+        if (onComment)
+            onComment();
+    }
+    if (literal) {
+        value = value.replace(/\n+/g, `$&${indent}`);
+        return `${header}\n${indent}${start}${value}${end}`;
+    }
+    value = value
+        .replace(/\n+/g, '\n$&')
+        .replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, '$1$2') // more-indented lines aren't folded
+        //                ^ more-ind. ^ empty     ^ capture next empty lines only at end of indent
+        .replace(/\n+/g, `$&${indent}`);
+    const body = foldFlowLines(`${start}${value}${end}`, indent, FOLD_BLOCK, getFoldOptions(ctx, true));
+    return `${header}\n${indent}${body}`;
+}
+function plainString(item, ctx, onComment, onChompKeep) {
+    const { type, value } = item;
+    const { actualString, implicitKey, indent, indentStep, inFlow } = ctx;
+    if ((implicitKey && value.includes('\n')) ||
+        (inFlow && /[[\]{},]/.test(value))) {
+        return quotedString(value, ctx);
+    }
+    if (!value ||
+        /^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(value)) {
+        // not allowed:
+        // - empty string, '-' or '?'
+        // - start with an indicator character (except [?:-]) or /[?-] /
+        // - '\n ', ': ' or ' \n' anywhere
+        // - '#' not preceded by a non-space char
+        // - end with ' ' or ':'
+        return implicitKey || inFlow || !value.includes('\n')
+            ? quotedString(value, ctx)
+            : blockString(item, ctx, onComment, onChompKeep);
+    }
+    if (!implicitKey &&
+        !inFlow &&
+        type !== Scalar.PLAIN &&
+        value.includes('\n')) {
+        // Where allowed & type not set explicitly, prefer block style for multiline strings
+        return blockString(item, ctx, onComment, onChompKeep);
+    }
+    if (containsDocumentMarker(value)) {
+        if (indent === '') {
+            ctx.forceBlockIndent = true;
+            return blockString(item, ctx, onComment, onChompKeep);
+        }
+        else if (implicitKey && indent === indentStep) {
+            return quotedString(value, ctx);
+        }
+    }
+    const str = value.replace(/\n+/g, `$&\n${indent}`);
+    // Verify that output will be parsed as a string, as e.g. plain numbers and
+    // booleans get parsed with those types in v1.2 (e.g. '42', 'true' & '0.9e-3'),
+    // and others in v1.1.
+    if (actualString) {
+        const test = (tag) => tag.default && tag.tag !== 'tag:yaml.org,2002:str' && tag.test?.test(str);
+        const { compat, tags } = ctx.doc.schema;
+        if (tags.some(test) || compat?.some(test))
+            return quotedString(value, ctx);
+    }
+    return implicitKey
+        ? str
+        : foldFlowLines(str, indent, FOLD_FLOW, getFoldOptions(ctx, false));
+}
+function stringifyString(item, ctx, onComment, onChompKeep) {
+    const { implicitKey, inFlow } = ctx;
+    const ss = typeof item.value === 'string'
+        ? item
+        : Object.assign({}, item, { value: String(item.value) });
+    let { type } = item;
+    if (type !== Scalar.QUOTE_DOUBLE) {
+        // force double quotes on control characters & unpaired surrogates
+        if (/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(ss.value))
+            type = Scalar.QUOTE_DOUBLE;
+    }
+    const _stringify = (_type) => {
+        switch (_type) {
+            case Scalar.BLOCK_FOLDED:
+            case Scalar.BLOCK_LITERAL:
+                return implicitKey || inFlow
+                    ? quotedString(ss.value, ctx) // blocks are not valid inside flow containers
+                    : blockString(ss, ctx, onComment, onChompKeep);
+            case Scalar.QUOTE_DOUBLE:
+                return doubleQuotedString(ss.value, ctx);
+            case Scalar.QUOTE_SINGLE:
+                return singleQuotedString(ss.value, ctx);
+            case Scalar.PLAIN:
+                return plainString(ss, ctx, onComment, onChompKeep);
+            default:
+                return null;
+        }
+    };
+    let res = _stringify(type);
+    if (res === null) {
+        const { defaultKeyType, defaultStringType } = ctx.options;
+        const t = (implicitKey && defaultKeyType) || defaultStringType;
+        res = _stringify(t);
+        if (res === null)
+            throw new Error(`Unsupported default string type ${t}`);
+    }
+    return res;
+}
+
+function createStringifyContext(doc, options) {
+    const opt = Object.assign({
+        blockQuote: true,
+        commentString: stringifyComment,
+        defaultKeyType: null,
+        defaultStringType: 'PLAIN',
+        directives: null,
+        doubleQuotedAsJSON: false,
+        doubleQuotedMinMultiLineLength: 40,
+        falseStr: 'false',
+        flowCollectionPadding: true,
+        indentSeq: true,
+        lineWidth: 80,
+        minContentWidth: 20,
+        nullStr: 'null',
+        simpleKeys: false,
+        singleQuote: null,
+        trueStr: 'true',
+        verifyAliasOrder: true
+    }, doc.schema.toStringOptions, options);
+    let inFlow;
+    switch (opt.collectionStyle) {
+        case 'block':
+            inFlow = false;
+            break;
+        case 'flow':
+            inFlow = true;
+            break;
+        default:
+            inFlow = null;
+    }
+    return {
+        anchors: new Set(),
+        doc,
+        flowCollectionPadding: opt.flowCollectionPadding ? ' ' : '',
+        indent: '',
+        indentStep: typeof opt.indent === 'number' ? ' '.repeat(opt.indent) : '  ',
+        inFlow,
+        options: opt
+    };
+}
+function getTagObject(tags, item) {
+    if (item.tag) {
+        const match = tags.filter(t => t.tag === item.tag);
+        if (match.length > 0)
+            return match.find(t => t.format === item.format) ?? match[0];
+    }
+    let tagObj = undefined;
+    let obj;
+    if (isScalar$1(item)) {
+        obj = item.value;
+        const match = tags.filter(t => t.identify?.(obj));
+        tagObj =
+            match.find(t => t.format === item.format) ?? match.find(t => !t.format);
+    }
+    else {
+        obj = item;
+        tagObj = tags.find(t => t.nodeClass && obj instanceof t.nodeClass);
+    }
+    if (!tagObj) {
+        const name = obj?.constructor?.name ?? typeof obj;
+        throw new Error(`Tag not resolved for ${name} value`);
+    }
+    return tagObj;
+}
+// needs to be called before value stringifier to allow for circular anchor refs
+function stringifyProps(node, tagObj, { anchors, doc }) {
+    if (!doc.directives)
+        return '';
+    const props = [];
+    const anchor = (isScalar$1(node) || isCollection$1(node)) && node.anchor;
+    if (anchor && anchorIsValid(anchor)) {
+        anchors.add(anchor);
+        props.push(`&${anchor}`);
+    }
+    const tag = node.tag ? node.tag : tagObj.default ? null : tagObj.tag;
+    if (tag)
+        props.push(doc.directives.tagString(tag));
+    return props.join(' ');
+}
+function stringify$2(item, ctx, onComment, onChompKeep) {
+    if (isPair(item))
+        return item.toString(ctx, onComment, onChompKeep);
+    if (isAlias(item)) {
+        if (ctx.doc.directives)
+            return item.toString(ctx);
+        if (ctx.resolvedAliases?.has(item)) {
+            throw new TypeError(`Cannot stringify circular structure without alias nodes`);
+        }
+        else {
+            if (ctx.resolvedAliases)
+                ctx.resolvedAliases.add(item);
+            else
+                ctx.resolvedAliases = new Set([item]);
+            item = item.resolve(ctx.doc);
+        }
+    }
+    let tagObj = undefined;
+    const node = isNode$1(item)
+        ? item
+        : ctx.doc.createNode(item, { onTagObj: o => (tagObj = o) });
+    if (!tagObj)
+        tagObj = getTagObject(ctx.doc.schema.tags, node);
+    const props = stringifyProps(node, tagObj, ctx);
+    if (props.length > 0)
+        ctx.indentAtStart = (ctx.indentAtStart ?? 0) + props.length + 1;
+    const str = typeof tagObj.stringify === 'function'
+        ? tagObj.stringify(node, ctx, onComment, onChompKeep)
+        : isScalar$1(node)
+            ? stringifyString(node, ctx, onComment, onChompKeep)
+            : node.toString(ctx, onComment, onChompKeep);
+    if (!props)
+        return str;
+    return isScalar$1(node) || str[0] === '{' || str[0] === '['
+        ? `${props} ${str}`
+        : `${props}\n${ctx.indent}${str}`;
+}
+
+function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
+    const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
+    let keyComment = (isNode$1(key) && key.comment) || null;
+    if (simpleKeys) {
+        if (keyComment) {
+            throw new Error('With simple keys, key nodes cannot have comments');
+        }
+        if (isCollection$1(key) || (!isNode$1(key) && typeof key === 'object')) {
+            const msg = 'With simple keys, collection cannot be used as a key value';
+            throw new Error(msg);
+        }
+    }
+    let explicitKey = !simpleKeys &&
+        (!key ||
+            (keyComment && value == null && !ctx.inFlow) ||
+            isCollection$1(key) ||
+            (isScalar$1(key)
+                ? key.type === Scalar.BLOCK_FOLDED || key.type === Scalar.BLOCK_LITERAL
+                : typeof key === 'object'));
+    ctx = Object.assign({}, ctx, {
+        allNullValues: false,
+        implicitKey: !explicitKey && (simpleKeys || !allNullValues),
+        indent: indent + indentStep
+    });
+    let keyCommentDone = false;
+    let chompKeep = false;
+    let str = stringify$2(key, ctx, () => (keyCommentDone = true), () => (chompKeep = true));
+    if (!explicitKey && !ctx.inFlow && str.length > 1024) {
+        if (simpleKeys)
+            throw new Error('With simple keys, single line scalar must not span more than 1024 characters');
+        explicitKey = true;
+    }
+    if (ctx.inFlow) {
+        if (allNullValues || value == null) {
+            if (keyCommentDone && onComment)
+                onComment();
+            return str === '' ? '?' : explicitKey ? `? ${str}` : str;
+        }
+    }
+    else if ((allNullValues && !simpleKeys) || (value == null && explicitKey)) {
+        str = `? ${str}`;
+        if (keyComment && !keyCommentDone) {
+            str += lineComment(str, ctx.indent, commentString(keyComment));
+        }
+        else if (chompKeep && onChompKeep)
+            onChompKeep();
+        return str;
+    }
+    if (keyCommentDone)
+        keyComment = null;
+    if (explicitKey) {
+        if (keyComment)
+            str += lineComment(str, ctx.indent, commentString(keyComment));
+        str = `? ${str}\n${indent}:`;
+    }
+    else {
+        str = `${str}:`;
+        if (keyComment)
+            str += lineComment(str, ctx.indent, commentString(keyComment));
+    }
+    let vsb, vcb, valueComment;
+    if (isNode$1(value)) {
+        vsb = !!value.spaceBefore;
+        vcb = value.commentBefore;
+        valueComment = value.comment;
+    }
+    else {
+        vsb = false;
+        vcb = null;
+        valueComment = null;
+        if (value && typeof value === 'object')
+            value = doc.createNode(value);
+    }
+    ctx.implicitKey = false;
+    if (!explicitKey && !keyComment && isScalar$1(value))
+        ctx.indentAtStart = str.length + 1;
+    chompKeep = false;
+    if (!indentSeq &&
+        indentStep.length >= 2 &&
+        !ctx.inFlow &&
+        !explicitKey &&
+        isSeq(value) &&
+        !value.flow &&
+        !value.tag &&
+        !value.anchor) {
+        // If indentSeq === false, consider '- ' as part of indentation where possible
+        ctx.indent = ctx.indent.substring(2);
+    }
+    let valueCommentDone = false;
+    const valueStr = stringify$2(value, ctx, () => (valueCommentDone = true), () => (chompKeep = true));
+    let ws = ' ';
+    if (keyComment || vsb || vcb) {
+        ws = vsb ? '\n' : '';
+        if (vcb) {
+            const cs = commentString(vcb);
+            ws += `\n${indentComment(cs, ctx.indent)}`;
+        }
+        if (valueStr === '' && !ctx.inFlow) {
+            if (ws === '\n')
+                ws = '\n\n';
+        }
+        else {
+            ws += `\n${ctx.indent}`;
+        }
+    }
+    else if (!explicitKey && isCollection$1(value)) {
+        const vs0 = valueStr[0];
+        const nl0 = valueStr.indexOf('\n');
+        const hasNewline = nl0 !== -1;
+        const flow = ctx.inFlow ?? value.flow ?? value.items.length === 0;
+        if (hasNewline || !flow) {
+            let hasPropsLine = false;
+            if (hasNewline && (vs0 === '&' || vs0 === '!')) {
+                let sp0 = valueStr.indexOf(' ');
+                if (vs0 === '&' &&
+                    sp0 !== -1 &&
+                    sp0 < nl0 &&
+                    valueStr[sp0 + 1] === '!') {
+                    sp0 = valueStr.indexOf(' ', sp0 + 1);
+                }
+                if (sp0 === -1 || nl0 < sp0)
+                    hasPropsLine = true;
+            }
+            if (!hasPropsLine)
+                ws = `\n${ctx.indent}`;
+        }
+    }
+    else if (valueStr === '' || valueStr[0] === '\n') {
+        ws = '';
+    }
+    str += ws + valueStr;
+    if (ctx.inFlow) {
+        if (valueCommentDone && onComment)
+            onComment();
+    }
+    else if (valueComment && !valueCommentDone) {
+        str += lineComment(str, ctx.indent, commentString(valueComment));
+    }
+    else if (chompKeep && onChompKeep) {
+        onChompKeep();
+    }
+    return str;
+}
+
+function warn(logLevel, warning) {
+    if (logLevel === 'debug' || logLevel === 'warn') {
+        // https://github.com/typescript-eslint/typescript-eslint/issues/7478
+        // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
+        if (typeof process !== 'undefined' && process.emitWarning)
+            process.emitWarning(warning);
+        else
+            console.warn(warning);
+    }
+}
+
+const MERGE_KEY = '<<';
+function addPairToJSMap(ctx, map, { key, value }) {
+    if (ctx?.doc.schema.merge && isMergeKey(key)) {
+        value = isAlias(value) ? value.resolve(ctx.doc) : value;
+        if (isSeq(value))
+            for (const it of value.items)
+                mergeToJSMap(ctx, map, it);
+        else if (Array.isArray(value))
+            for (const it of value)
+                mergeToJSMap(ctx, map, it);
+        else
+            mergeToJSMap(ctx, map, value);
+    }
+    else {
+        const jsKey = toJS(key, '', ctx);
+        if (map instanceof Map) {
+            map.set(jsKey, toJS(value, jsKey, ctx));
+        }
+        else if (map instanceof Set) {
+            map.add(jsKey);
+        }
+        else {
+            const stringKey = stringifyKey(key, jsKey, ctx);
+            const jsValue = toJS(value, stringKey, ctx);
+            if (stringKey in map)
+                Object.defineProperty(map, stringKey, {
+                    value: jsValue,
+                    writable: true,
+                    enumerable: true,
+                    configurable: true
+                });
+            else
+                map[stringKey] = jsValue;
+        }
+    }
+    return map;
+}
+const isMergeKey = (key) => key === MERGE_KEY ||
+    (isScalar$1(key) &&
+        key.value === MERGE_KEY &&
+        (!key.type || key.type === Scalar.PLAIN));
+// If the value associated with a merge key is a single mapping node, each of
+// its key/value pairs is inserted into the current mapping, unless the key
+// already exists in it. If the value associated with the merge key is a
+// sequence, then this sequence is expected to contain mapping nodes and each
+// of these nodes is merged in turn according to its order in the sequence.
+// Keys in mapping nodes earlier in the sequence override keys specified in
+// later mapping nodes. -- http://yaml.org/type/merge.html
+function mergeToJSMap(ctx, map, value) {
+    const source = ctx && isAlias(value) ? value.resolve(ctx.doc) : value;
+    if (!isMap(source))
+        throw new Error('Merge sources must be maps or map aliases');
+    const srcMap = source.toJSON(null, ctx, Map);
+    for (const [key, value] of srcMap) {
+        if (map instanceof Map) {
+            if (!map.has(key))
+                map.set(key, value);
+        }
+        else if (map instanceof Set) {
+            map.add(key);
+        }
+        else if (!Object.prototype.hasOwnProperty.call(map, key)) {
+            Object.defineProperty(map, key, {
+                value,
+                writable: true,
+                enumerable: true,
+                configurable: true
+            });
+        }
+    }
+    return map;
+}
+function stringifyKey(key, jsKey, ctx) {
+    if (jsKey === null)
+        return '';
+    if (typeof jsKey !== 'object')
+        return String(jsKey);
+    if (isNode$1(key) && ctx?.doc) {
+        const strCtx = createStringifyContext(ctx.doc, {});
+        strCtx.anchors = new Set();
+        for (const node of ctx.anchors.keys())
+            strCtx.anchors.add(node.anchor);
+        strCtx.inFlow = true;
+        strCtx.inStringifyKey = true;
+        const strKey = key.toString(strCtx);
+        if (!ctx.mapKeyWarned) {
+            let jsonStr = JSON.stringify(strKey);
+            if (jsonStr.length > 40)
+                jsonStr = jsonStr.substring(0, 36) + '..."';
+            warn(ctx.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${jsonStr}. Set mapAsMap: true to use object keys.`);
+            ctx.mapKeyWarned = true;
+        }
+        return strKey;
+    }
+    return JSON.stringify(jsKey);
+}
+
+function createPair(key, value, ctx) {
+    const k = createNode(key, undefined, ctx);
+    const v = createNode(value, undefined, ctx);
+    return new Pair(k, v);
+}
+class Pair {
+    constructor(key, value = null) {
+        Object.defineProperty(this, NODE_TYPE, { value: PAIR });
+        this.key = key;
+        this.value = value;
+    }
+    clone(schema) {
+        let { key, value } = this;
+        if (isNode$1(key))
+            key = key.clone(schema);
+        if (isNode$1(value))
+            value = value.clone(schema);
+        return new Pair(key, value);
+    }
+    toJSON(_, ctx) {
+        const pair = ctx?.mapAsMap ? new Map() : {};
+        return addPairToJSMap(ctx, pair, this);
+    }
+    toString(ctx, onComment, onChompKeep) {
+        return ctx?.doc
+            ? stringifyPair(this, ctx, onComment, onChompKeep)
+            : JSON.stringify(this);
+    }
+}
+
+function stringifyCollection(collection, ctx, options) {
+    const flow = ctx.inFlow ?? collection.flow;
+    const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
+    return stringify(collection, ctx, options);
+}
+function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
+    const { indent, options: { commentString } } = ctx;
+    const itemCtx = Object.assign({}, ctx, { indent: itemIndent, type: null });
+    let chompKeep = false; // flag for the preceding node's status
+    const lines = [];
+    for (let i = 0; i < items.length; ++i) {
+        const item = items[i];
+        let comment = null;
+        if (isNode$1(item)) {
+            if (!chompKeep && item.spaceBefore)
+                lines.push('');
+            addCommentBefore(ctx, lines, item.commentBefore, chompKeep);
+            if (item.comment)
+                comment = item.comment;
+        }
+        else if (isPair(item)) {
+            const ik = isNode$1(item.key) ? item.key : null;
+            if (ik) {
+                if (!chompKeep && ik.spaceBefore)
+                    lines.push('');
+                addCommentBefore(ctx, lines, ik.commentBefore, chompKeep);
+            }
+        }
+        chompKeep = false;
+        let str = stringify$2(item, itemCtx, () => (comment = null), () => (chompKeep = true));
+        if (comment)
+            str += lineComment(str, itemIndent, commentString(comment));
+        if (chompKeep && comment)
+            chompKeep = false;
+        lines.push(blockItemPrefix + str);
+    }
+    let str;
+    if (lines.length === 0) {
+        str = flowChars.start + flowChars.end;
+    }
+    else {
+        str = lines[0];
+        for (let i = 1; i < lines.length; ++i) {
+            const line = lines[i];
+            str += line ? `\n${indent}${line}` : '\n';
+        }
+    }
+    if (comment) {
+        str += '\n' + indentComment(commentString(comment), indent);
+        if (onComment)
+            onComment();
+    }
+    else if (chompKeep && onChompKeep)
+        onChompKeep();
+    return str;
+}
+function stringifyFlowCollection({ items }, ctx, { flowChars, itemIndent }) {
+    const { indent, indentStep, flowCollectionPadding: fcPadding, options: { commentString } } = ctx;
+    itemIndent += indentStep;
+    const itemCtx = Object.assign({}, ctx, {
+        indent: itemIndent,
+        inFlow: true,
+        type: null
+    });
+    let reqNewline = false;
+    let linesAtValue = 0;
+    const lines = [];
+    for (let i = 0; i < items.length; ++i) {
+        const item = items[i];
+        let comment = null;
+        if (isNode$1(item)) {
+            if (item.spaceBefore)
+                lines.push('');
+            addCommentBefore(ctx, lines, item.commentBefore, false);
+            if (item.comment)
+                comment = item.comment;
+        }
+        else if (isPair(item)) {
+            const ik = isNode$1(item.key) ? item.key : null;
+            if (ik) {
+                if (ik.spaceBefore)
+                    lines.push('');
+                addCommentBefore(ctx, lines, ik.commentBefore, false);
+                if (ik.comment)
+                    reqNewline = true;
+            }
+            const iv = isNode$1(item.value) ? item.value : null;
+            if (iv) {
+                if (iv.comment)
+                    comment = iv.comment;
+                if (iv.commentBefore)
+                    reqNewline = true;
+            }
+            else if (item.value == null && ik?.comment) {
+                comment = ik.comment;
+            }
+        }
+        if (comment)
+            reqNewline = true;
+        let str = stringify$2(item, itemCtx, () => (comment = null));
+        if (i < items.length - 1)
+            str += ',';
+        if (comment)
+            str += lineComment(str, itemIndent, commentString(comment));
+        if (!reqNewline && (lines.length > linesAtValue || str.includes('\n')))
+            reqNewline = true;
+        lines.push(str);
+        linesAtValue = lines.length;
+    }
+    const { start, end } = flowChars;
+    if (lines.length === 0) {
+        return start + end;
+    }
+    else {
+        if (!reqNewline) {
+            const len = lines.reduce((sum, line) => sum + line.length + 2, 2);
+            reqNewline = ctx.options.lineWidth > 0 && len > ctx.options.lineWidth;
+        }
+        if (reqNewline) {
+            let str = start;
+            for (const line of lines)
+                str += line ? `\n${indentStep}${indent}${line}` : '\n';
+            return `${str}\n${indent}${end}`;
+        }
+        else {
+            return `${start}${fcPadding}${lines.join(' ')}${fcPadding}${end}`;
+        }
+    }
+}
+function addCommentBefore({ indent, options: { commentString } }, lines, comment, chompKeep) {
+    if (comment && chompKeep)
+        comment = comment.replace(/^\n+/, '');
+    if (comment) {
+        const ic = indentComment(commentString(comment), indent);
+        lines.push(ic.trimStart()); // Avoid double indent on first line
+    }
+}
+
+function findPair(items, key) {
+    const k = isScalar$1(key) ? key.value : key;
+    for (const it of items) {
+        if (isPair(it)) {
+            if (it.key === key || it.key === k)
+                return it;
+            if (isScalar$1(it.key) && it.key.value === k)
+                return it;
+        }
+    }
+    return undefined;
+}
+class YAMLMap extends Collection {
+    static get tagName() {
+        return 'tag:yaml.org,2002:map';
+    }
+    constructor(schema) {
+        super(MAP, schema);
+        this.items = [];
+    }
+    /**
+     * A generic collection parsing method that can be extended
+     * to other node classes that inherit from YAMLMap
+     */
+    static from(schema, obj, ctx) {
+        const { keepUndefined, replacer } = ctx;
+        const map = new this(schema);
+        const add = (key, value) => {
+            if (typeof replacer === 'function')
+                value = replacer.call(obj, key, value);
+            else if (Array.isArray(replacer) && !replacer.includes(key))
+                return;
+            if (value !== undefined || keepUndefined)
+                map.items.push(createPair(key, value, ctx));
+        };
+        if (obj instanceof Map) {
+            for (const [key, value] of obj)
+                add(key, value);
+        }
+        else if (obj && typeof obj === 'object') {
+            for (const key of Object.keys(obj))
+                add(key, obj[key]);
+        }
+        if (typeof schema.sortMapEntries === 'function') {
+            map.items.sort(schema.sortMapEntries);
+        }
+        return map;
+    }
+    /**
+     * Adds a value to the collection.
+     *
+     * @param overwrite - If not set `true`, using a key that is already in the
+     *   collection will throw. Otherwise, overwrites the previous value.
+     */
+    add(pair, overwrite) {
+        let _pair;
+        if (isPair(pair))
+            _pair = pair;
+        else if (!pair || typeof pair !== 'object' || !('key' in pair)) {
+            // In TypeScript, this never happens.
+            _pair = new Pair(pair, pair?.value);
+        }
+        else
+            _pair = new Pair(pair.key, pair.value);
+        const prev = findPair(this.items, _pair.key);
+        const sortEntries = this.schema?.sortMapEntries;
+        if (prev) {
+            if (!overwrite)
+                throw new Error(`Key ${_pair.key} already set`);
+            // For scalars, keep the old node & its comments and anchors
+            if (isScalar$1(prev.value) && isScalarValue(_pair.value))
+                prev.value.value = _pair.value;
+            else
+                prev.value = _pair.value;
+        }
+        else if (sortEntries) {
+            const i = this.items.findIndex(item => sortEntries(_pair, item) < 0);
+            if (i === -1)
+                this.items.push(_pair);
+            else
+                this.items.splice(i, 0, _pair);
+        }
+        else {
+            this.items.push(_pair);
+        }
+    }
+    delete(key) {
+        const it = findPair(this.items, key);
+        if (!it)
+            return false;
+        const del = this.items.splice(this.items.indexOf(it), 1);
+        return del.length > 0;
+    }
+    get(key, keepScalar) {
+        const it = findPair(this.items, key);
+        const node = it?.value;
+        return (!keepScalar && isScalar$1(node) ? node.value : node) ?? undefined;
+    }
+    has(key) {
+        return !!findPair(this.items, key);
+    }
+    set(key, value) {
+        this.add(new Pair(key, value), true);
+    }
+    /**
+     * @param ctx - Conversion context, originally set in Document#toJS()
+     * @param {Class} Type - If set, forces the returned collection type
+     * @returns Instance of Type, Map, or Object
+     */
+    toJSON(_, ctx, Type) {
+        const map = Type ? new Type() : ctx?.mapAsMap ? new Map() : {};
+        if (ctx?.onCreate)
+            ctx.onCreate(map);
+        for (const item of this.items)
+            addPairToJSMap(ctx, map, item);
+        return map;
+    }
+    toString(ctx, onComment, onChompKeep) {
+        if (!ctx)
+            return JSON.stringify(this);
+        for (const item of this.items) {
+            if (!isPair(item))
+                throw new Error(`Map items must all be pairs; found ${JSON.stringify(item)} instead`);
+        }
+        if (!ctx.allNullValues && this.hasAllNullValues(false))
+            ctx = Object.assign({}, ctx, { allNullValues: true });
+        return stringifyCollection(this, ctx, {
+            blockItemPrefix: '',
+            flowChars: { start: '{', end: '}' },
+            itemIndent: ctx.indent || '',
+            onChompKeep,
+            onComment
+        });
+    }
+}
+
+const map$1 = {
+    collection: 'map',
+    default: true,
+    nodeClass: YAMLMap,
+    tag: 'tag:yaml.org,2002:map',
+    resolve(map, onError) {
+        if (!isMap(map))
+            onError('Expected a mapping for this tag');
+        return map;
+    },
+    createNode: (schema, obj, ctx) => YAMLMap.from(schema, obj, ctx)
+};
+
+class YAMLSeq extends Collection {
+    static get tagName() {
+        return 'tag:yaml.org,2002:seq';
+    }
+    constructor(schema) {
+        super(SEQ, schema);
+        this.items = [];
+    }
+    add(value) {
+        this.items.push(value);
+    }
+    /**
+     * Removes a value from the collection.
+     *
+     * `key` must contain a representation of an integer for this to succeed.
+     * It may be wrapped in a `Scalar`.
+     *
+     * @returns `true` if the item was found and removed.
+     */
+    delete(key) {
+        const idx = asItemIndex(key);
+        if (typeof idx !== 'number')
+            return false;
+        const del = this.items.splice(idx, 1);
+        return del.length > 0;
+    }
+    get(key, keepScalar) {
+        const idx = asItemIndex(key);
+        if (typeof idx !== 'number')
+            return undefined;
+        const it = this.items[idx];
+        return !keepScalar && isScalar$1(it) ? it.value : it;
+    }
+    /**
+     * Checks if the collection includes a value with the key `key`.
+     *
+     * `key` must contain a representation of an integer for this to succeed.
+     * It may be wrapped in a `Scalar`.
+     */
+    has(key) {
+        const idx = asItemIndex(key);
+        return typeof idx === 'number' && idx < this.items.length;
+    }
+    /**
+     * Sets a value in this collection. For `!!set`, `value` needs to be a
+     * boolean to add/remove the item from the set.
+     *
+     * If `key` does not contain a representation of an integer, this will throw.
+     * It may be wrapped in a `Scalar`.
+     */
+    set(key, value) {
+        const idx = asItemIndex(key);
+        if (typeof idx !== 'number')
+            throw new Error(`Expected a valid index, not ${key}.`);
+        const prev = this.items[idx];
+        if (isScalar$1(prev) && isScalarValue(value))
+            prev.value = value;
+        else
+            this.items[idx] = value;
+    }
+    toJSON(_, ctx) {
+        const seq = [];
+        if (ctx?.onCreate)
+            ctx.onCreate(seq);
+        let i = 0;
+        for (const item of this.items)
+            seq.push(toJS(item, String(i++), ctx));
+        return seq;
+    }
+    toString(ctx, onComment, onChompKeep) {
+        if (!ctx)
+            return JSON.stringify(this);
+        return stringifyCollection(this, ctx, {
+            blockItemPrefix: '- ',
+            flowChars: { start: '[', end: ']' },
+            itemIndent: (ctx.indent || '') + '  ',
+            onChompKeep,
+            onComment
+        });
+    }
+    static from(schema, obj, ctx) {
+        const { replacer } = ctx;
+        const seq = new this(schema);
+        if (obj && Symbol.iterator in Object(obj)) {
+            let i = 0;
+            for (let it of obj) {
+                if (typeof replacer === 'function') {
+                    const key = obj instanceof Set ? it : String(i++);
+                    it = replacer.call(obj, key, it);
+                }
+                seq.items.push(createNode(it, undefined, ctx));
+            }
+        }
+        return seq;
+    }
+}
+function asItemIndex(key) {
+    let idx = isScalar$1(key) ? key.value : key;
+    if (idx && typeof idx === 'string')
+        idx = Number(idx);
+    return typeof idx === 'number' && Number.isInteger(idx) && idx >= 0
+        ? idx
+        : null;
+}
+
+const seq = {
+    collection: 'seq',
+    default: true,
+    nodeClass: YAMLSeq,
+    tag: 'tag:yaml.org,2002:seq',
+    resolve(seq, onError) {
+        if (!isSeq(seq))
+            onError('Expected a sequence for this tag');
+        return seq;
+    },
+    createNode: (schema, obj, ctx) => YAMLSeq.from(schema, obj, ctx)
+};
+
+const string = {
+    identify: value => typeof value === 'string',
+    default: true,
+    tag: 'tag:yaml.org,2002:str',
+    resolve: str => str,
+    stringify(item, ctx, onComment, onChompKeep) {
+        ctx = Object.assign({ actualString: true }, ctx);
+        return stringifyString(item, ctx, onComment, onChompKeep);
+    }
+};
+
+const nullTag = {
+    identify: value => value == null,
+    createNode: () => new Scalar(null),
+    default: true,
+    tag: 'tag:yaml.org,2002:null',
+    test: /^(?:~|[Nn]ull|NULL)?$/,
+    resolve: () => new Scalar(null),
+    stringify: ({ source }, ctx) => typeof source === 'string' && nullTag.test.test(source)
+        ? source
+        : ctx.options.nullStr
+};
+
+const boolTag = {
+    identify: value => typeof value === 'boolean',
+    default: true,
+    tag: 'tag:yaml.org,2002:bool',
+    test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
+    resolve: str => new Scalar(str[0] === 't' || str[0] === 'T'),
+    stringify({ source, value }, ctx) {
+        if (source && boolTag.test.test(source)) {
+            const sv = source[0] === 't' || source[0] === 'T';
+            if (value === sv)
+                return source;
+        }
+        return value ? ctx.options.trueStr : ctx.options.falseStr;
+    }
+};
+
+function stringifyNumber({ format, minFractionDigits, tag, value }) {
+    if (typeof value === 'bigint')
+        return String(value);
+    const num = typeof value === 'number' ? value : Number(value);
+    if (!isFinite(num))
+        return isNaN(num) ? '.nan' : num < 0 ? '-.inf' : '.inf';
+    let n = JSON.stringify(value);
+    if (!format &&
+        minFractionDigits &&
+        (!tag || tag === 'tag:yaml.org,2002:float') &&
+        /^\d/.test(n)) {
+        let i = n.indexOf('.');
+        if (i < 0) {
+            i = n.length;
+            n += '.';
+        }
+        let d = minFractionDigits - (n.length - i - 1);
+        while (d-- > 0)
+            n += '0';
+    }
+    return n;
+}
+
+const floatNaN$1 = {
+    identify: value => typeof value === 'number',
+    default: true,
+    tag: 'tag:yaml.org,2002:float',
+    test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
+    resolve: str => str.slice(-3).toLowerCase() === 'nan'
+        ? NaN
+        : str[0] === '-'
+            ? Number.NEGATIVE_INFINITY
+            : Number.POSITIVE_INFINITY,
+    stringify: stringifyNumber
+};
+const floatExp$1 = {
+    identify: value => typeof value === 'number',
+    default: true,
+    tag: 'tag:yaml.org,2002:float',
+    format: 'EXP',
+    test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
+    resolve: str => parseFloat(str),
+    stringify(node) {
+        const num = Number(node.value);
+        return isFinite(num) ? num.toExponential() : stringifyNumber(node);
+    }
+};
+const float$1 = {
+    identify: value => typeof value === 'number',
+    default: true,
+    tag: 'tag:yaml.org,2002:float',
+    test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
+    resolve(str) {
+        const node = new Scalar(parseFloat(str));
+        const dot = str.indexOf('.');
+        if (dot !== -1 && str[str.length - 1] === '0')
+            node.minFractionDigits = str.length - dot - 1;
+        return node;
+    },
+    stringify: stringifyNumber
+};
+
+const intIdentify$2 = (value) => typeof value === 'bigint' || Number.isInteger(value);
+const intResolve$1 = (str, offset, radix, { intAsBigInt }) => (intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix));
+function intStringify$1(node, radix, prefix) {
+    const { value } = node;
+    if (intIdentify$2(value) && value >= 0)
+        return prefix + value.toString(radix);
+    return stringifyNumber(node);
+}
+const intOct$1 = {
+    identify: value => intIdentify$2(value) && value >= 0,
+    default: true,
+    tag: 'tag:yaml.org,2002:int',
+    format: 'OCT',
+    test: /^0o[0-7]+$/,
+    resolve: (str, _onError, opt) => intResolve$1(str, 2, 8, opt),
+    stringify: node => intStringify$1(node, 8, '0o')
+};
+const int$1 = {
+    identify: intIdentify$2,
+    default: true,
+    tag: 'tag:yaml.org,2002:int',
+    test: /^[-+]?[0-9]+$/,
+    resolve: (str, _onError, opt) => intResolve$1(str, 0, 10, opt),
+    stringify: stringifyNumber
+};
+const intHex$1 = {
+    identify: value => intIdentify$2(value) && value >= 0,
+    default: true,
+    tag: 'tag:yaml.org,2002:int',
+    format: 'HEX',
+    test: /^0x[0-9a-fA-F]+$/,
+    resolve: (str, _onError, opt) => intResolve$1(str, 2, 16, opt),
+    stringify: node => intStringify$1(node, 16, '0x')
+};
+
+const schema$2 = [
+    map$1,
+    seq,
+    string,
+    nullTag,
+    boolTag,
+    intOct$1,
+    int$1,
+    intHex$1,
+    floatNaN$1,
+    floatExp$1,
+    float$1
+];
+
+function intIdentify$1(value) {
+    return typeof value === 'bigint' || Number.isInteger(value);
+}
+const stringifyJSON = ({ value }) => JSON.stringify(value);
+const jsonScalars = [
+    {
+        identify: value => typeof value === 'string',
+        default: true,
+        tag: 'tag:yaml.org,2002:str',
+        resolve: str => str,
+        stringify: stringifyJSON
+    },
+    {
+        identify: value => value == null,
+        createNode: () => new Scalar(null),
+        default: true,
+        tag: 'tag:yaml.org,2002:null',
+        test: /^null$/,
+        resolve: () => null,
+        stringify: stringifyJSON
+    },
+    {
+        identify: value => typeof value === 'boolean',
+        default: true,
+        tag: 'tag:yaml.org,2002:bool',
+        test: /^true|false$/,
+        resolve: str => str === 'true',
+        stringify: stringifyJSON
+    },
+    {
+        identify: intIdentify$1,
+        default: true,
+        tag: 'tag:yaml.org,2002:int',
+        test: /^-?(?:0|[1-9][0-9]*)$/,
+        resolve: (str, _onError, { intAsBigInt }) => intAsBigInt ? BigInt(str) : parseInt(str, 10),
+        stringify: ({ value }) => intIdentify$1(value) ? value.toString() : JSON.stringify(value)
+    },
+    {
+        identify: value => typeof value === 'number',
+        default: true,
+        tag: 'tag:yaml.org,2002:float',
+        test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
+        resolve: str => parseFloat(str),
+        stringify: stringifyJSON
+    }
+];
+const jsonError = {
+    default: true,
+    tag: '',
+    test: /^/,
+    resolve(str, onError) {
+        onError(`Unresolved plain scalar ${JSON.stringify(str)}`);
+        return str;
+    }
+};
+const schema$1 = [map$1, seq].concat(jsonScalars, jsonError);
+
+const binary = {
+    identify: value => value instanceof Uint8Array, // Buffer inherits from Uint8Array
+    default: false,
+    tag: 'tag:yaml.org,2002:binary',
+    /**
+     * Returns a Buffer in node and an Uint8Array in browsers
+     *
+     * To use the resulting buffer as an image, you'll want to do something like:
+     *
+     *   const blob = new Blob([buffer], { type: 'image/jpeg' })
+     *   document.querySelector('#photo').src = URL.createObjectURL(blob)
+     */
+    resolve(src, onError) {
+        if (typeof Buffer === 'function') {
+            return Buffer.from(src, 'base64');
+        }
+        else if (typeof atob === 'function') {
+            // On IE 11, atob() can't handle newlines
+            const str = atob(src.replace(/[\n\r]/g, ''));
+            const buffer = new Uint8Array(str.length);
+            for (let i = 0; i < str.length; ++i)
+                buffer[i] = str.charCodeAt(i);
+            return buffer;
+        }
+        else {
+            onError('This environment does not support reading binary tags; either Buffer or atob is required');
+            return src;
+        }
+    },
+    stringify({ comment, type, value }, ctx, onComment, onChompKeep) {
+        const buf = value; // checked earlier by binary.identify()
+        let str;
+        if (typeof Buffer === 'function') {
+            str =
+                buf instanceof Buffer
+                    ? buf.toString('base64')
+                    : Buffer.from(buf.buffer).toString('base64');
+        }
+        else if (typeof btoa === 'function') {
+            let s = '';
+            for (let i = 0; i < buf.length; ++i)
+                s += String.fromCharCode(buf[i]);
+            str = btoa(s);
+        }
+        else {
+            throw new Error('This environment does not support writing binary tags; either Buffer or btoa is required');
+        }
+        if (!type)
+            type = Scalar.BLOCK_LITERAL;
+        if (type !== Scalar.QUOTE_DOUBLE) {
+            const lineWidth = Math.max(ctx.options.lineWidth - ctx.indent.length, ctx.options.minContentWidth);
+            const n = Math.ceil(str.length / lineWidth);
+            const lines = new Array(n);
+            for (let i = 0, o = 0; i < n; ++i, o += lineWidth) {
+                lines[i] = str.substr(o, lineWidth);
+            }
+            str = lines.join(type === Scalar.BLOCK_LITERAL ? '\n' : ' ');
+        }
+        return stringifyString({ comment, type, value: str }, ctx, onComment, onChompKeep);
+    }
+};
+
+function resolvePairs(seq, onError) {
+    if (isSeq(seq)) {
+        for (let i = 0; i < seq.items.length; ++i) {
+            let item = seq.items[i];
+            if (isPair(item))
+                continue;
+            else if (isMap(item)) {
+                if (item.items.length > 1)
+                    onError('Each pair must have its own sequence indicator');
+                const pair = item.items[0] || new Pair(new Scalar(null));
+                if (item.commentBefore)
+                    pair.key.commentBefore = pair.key.commentBefore
+                        ? `${item.commentBefore}\n${pair.key.commentBefore}`
+                        : item.commentBefore;
+                if (item.comment) {
+                    const cn = pair.value ?? pair.key;
+                    cn.comment = cn.comment
+                        ? `${item.comment}\n${cn.comment}`
+                        : item.comment;
+                }
+                item = pair;
+            }
+            seq.items[i] = isPair(item) ? item : new Pair(item);
+        }
+    }
+    else
+        onError('Expected a sequence for this tag');
+    return seq;
+}
+function createPairs(schema, iterable, ctx) {
+    const { replacer } = ctx;
+    const pairs = new YAMLSeq(schema);
+    pairs.tag = 'tag:yaml.org,2002:pairs';
+    let i = 0;
+    if (iterable && Symbol.iterator in Object(iterable))
+        for (let it of iterable) {
+            if (typeof replacer === 'function')
+                it = replacer.call(iterable, String(i++), it);
+            let key, value;
+            if (Array.isArray(it)) {
+                if (it.length === 2) {
+                    key = it[0];
+                    value = it[1];
+                }
+                else
+                    throw new TypeError(`Expected [key, value] tuple: ${it}`);
+            }
+            else if (it && it instanceof Object) {
+                const keys = Object.keys(it);
+                if (keys.length === 1) {
+                    key = keys[0];
+                    value = it[key];
+                }
+                else {
+                    throw new TypeError(`Expected tuple with one key, not ${keys.length} keys`);
+                }
+            }
+            else {
+                key = it;
+            }
+            pairs.items.push(createPair(key, value, ctx));
+        }
+    return pairs;
+}
+const pairs = {
+    collection: 'seq',
+    default: false,
+    tag: 'tag:yaml.org,2002:pairs',
+    resolve: resolvePairs,
+    createNode: createPairs
+};
+
+class YAMLOMap extends YAMLSeq {
+    constructor() {
+        super();
+        this.add = YAMLMap.prototype.add.bind(this);
+        this.delete = YAMLMap.prototype.delete.bind(this);
+        this.get = YAMLMap.prototype.get.bind(this);
+        this.has = YAMLMap.prototype.has.bind(this);
+        this.set = YAMLMap.prototype.set.bind(this);
+        this.tag = YAMLOMap.tag;
+    }
+    /**
+     * If `ctx` is given, the return type is actually `Map`,
+     * but TypeScript won't allow widening the signature of a child method.
+     */
+    toJSON(_, ctx) {
+        if (!ctx)
+            return super.toJSON(_);
+        const map = new Map();
+        if (ctx?.onCreate)
+            ctx.onCreate(map);
+        for (const pair of this.items) {
+            let key, value;
+            if (isPair(pair)) {
+                key = toJS(pair.key, '', ctx);
+                value = toJS(pair.value, key, ctx);
+            }
+            else {
+                key = toJS(pair, '', ctx);
+            }
+            if (map.has(key))
+                throw new Error('Ordered maps must not include duplicate keys');
+            map.set(key, value);
+        }
+        return map;
+    }
+    static from(schema, iterable, ctx) {
+        const pairs = createPairs(schema, iterable, ctx);
+        const omap = new this();
+        omap.items = pairs.items;
+        return omap;
+    }
+}
+YAMLOMap.tag = 'tag:yaml.org,2002:omap';
+const omap = {
+    collection: 'seq',
+    identify: value => value instanceof Map,
+    nodeClass: YAMLOMap,
+    default: false,
+    tag: 'tag:yaml.org,2002:omap',
+    resolve(seq, onError) {
+        const pairs = resolvePairs(seq, onError);
+        const seenKeys = [];
+        for (const { key } of pairs.items) {
+            if (isScalar$1(key)) {
+                if (seenKeys.includes(key.value)) {
+                    onError(`Ordered maps must not include duplicate keys: ${key.value}`);
+                }
+                else {
+                    seenKeys.push(key.value);
+                }
+            }
+        }
+        return Object.assign(new YAMLOMap(), pairs);
+    },
+    createNode: (schema, iterable, ctx) => YAMLOMap.from(schema, iterable, ctx)
+};
+
+function boolStringify({ value, source }, ctx) {
+    const boolObj = value ? trueTag : falseTag;
+    if (source && boolObj.test.test(source))
+        return source;
+    return value ? ctx.options.trueStr : ctx.options.falseStr;
+}
+const trueTag = {
+    identify: value => value === true,
+    default: true,
+    tag: 'tag:yaml.org,2002:bool',
+    test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
+    resolve: () => new Scalar(true),
+    stringify: boolStringify
+};
+const falseTag = {
+    identify: value => value === false,
+    default: true,
+    tag: 'tag:yaml.org,2002:bool',
+    test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
+    resolve: () => new Scalar(false),
+    stringify: boolStringify
+};
+
+const floatNaN = {
+    identify: value => typeof value === 'number',
+    default: true,
+    tag: 'tag:yaml.org,2002:float',
+    test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
+    resolve: (str) => str.slice(-3).toLowerCase() === 'nan'
+        ? NaN
+        : str[0] === '-'
+            ? Number.NEGATIVE_INFINITY
+            : Number.POSITIVE_INFINITY,
+    stringify: stringifyNumber
+};
+const floatExp = {
+    identify: value => typeof value === 'number',
+    default: true,
+    tag: 'tag:yaml.org,2002:float',
+    format: 'EXP',
+    test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
+    resolve: (str) => parseFloat(str.replace(/_/g, '')),
+    stringify(node) {
+        const num = Number(node.value);
+        return isFinite(num) ? num.toExponential() : stringifyNumber(node);
+    }
+};
+const float = {
+    identify: value => typeof value === 'number',
+    default: true,
+    tag: 'tag:yaml.org,2002:float',
+    test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
+    resolve(str) {
+        const node = new Scalar(parseFloat(str.replace(/_/g, '')));
+        const dot = str.indexOf('.');
+        if (dot !== -1) {
+            const f = str.substring(dot + 1).replace(/_/g, '');
+            if (f[f.length - 1] === '0')
+                node.minFractionDigits = f.length;
+        }
+        return node;
+    },
+    stringify: stringifyNumber
+};
+
+const intIdentify = (value) => typeof value === 'bigint' || Number.isInteger(value);
+function intResolve(str, offset, radix, { intAsBigInt }) {
+    const sign = str[0];
+    if (sign === '-' || sign === '+')
+        offset += 1;
+    str = str.substring(offset).replace(/_/g, '');
+    if (intAsBigInt) {
+        switch (radix) {
+            case 2:
+                str = `0b${str}`;
+                break;
+            case 8:
+                str = `0o${str}`;
+                break;
+            case 16:
+                str = `0x${str}`;
+                break;
+        }
+        const n = BigInt(str);
+        return sign === '-' ? BigInt(-1) * n : n;
+    }
+    const n = parseInt(str, radix);
+    return sign === '-' ? -1 * n : n;
+}
+function intStringify(node, radix, prefix) {
+    const { value } = node;
+    if (intIdentify(value)) {
+        const str = value.toString(radix);
+        return value < 0 ? '-' + prefix + str.substr(1) : prefix + str;
+    }
+    return stringifyNumber(node);
+}
+const intBin = {
+    identify: intIdentify,
+    default: true,
+    tag: 'tag:yaml.org,2002:int',
+    format: 'BIN',
+    test: /^[-+]?0b[0-1_]+$/,
+    resolve: (str, _onError, opt) => intResolve(str, 2, 2, opt),
+    stringify: node => intStringify(node, 2, '0b')
+};
+const intOct = {
+    identify: intIdentify,
+    default: true,
+    tag: 'tag:yaml.org,2002:int',
+    format: 'OCT',
+    test: /^[-+]?0[0-7_]+$/,
+    resolve: (str, _onError, opt) => intResolve(str, 1, 8, opt),
+    stringify: node => intStringify(node, 8, '0')
+};
+const int = {
+    identify: intIdentify,
+    default: true,
+    tag: 'tag:yaml.org,2002:int',
+    test: /^[-+]?[0-9][0-9_]*$/,
+    resolve: (str, _onError, opt) => intResolve(str, 0, 10, opt),
+    stringify: stringifyNumber
+};
+const intHex = {
+    identify: intIdentify,
+    default: true,
+    tag: 'tag:yaml.org,2002:int',
+    format: 'HEX',
+    test: /^[-+]?0x[0-9a-fA-F_]+$/,
+    resolve: (str, _onError, opt) => intResolve(str, 2, 16, opt),
+    stringify: node => intStringify(node, 16, '0x')
+};
+
+class YAMLSet extends YAMLMap {
+    constructor(schema) {
+        super(schema);
+        this.tag = YAMLSet.tag;
+    }
+    add(key) {
+        let pair;
+        if (isPair(key))
+            pair = key;
+        else if (key &&
+            typeof key === 'object' &&
+            'key' in key &&
+            'value' in key &&
+            key.value === null)
+            pair = new Pair(key.key, null);
+        else
+            pair = new Pair(key, null);
+        const prev = findPair(this.items, pair.key);
+        if (!prev)
+            this.items.push(pair);
+    }
+    /**
+     * If `keepPair` is `true`, returns the Pair matching `key`.
+     * Otherwise, returns the value of that Pair's key.
+     */
+    get(key, keepPair) {
+        const pair = findPair(this.items, key);
+        return !keepPair && isPair(pair)
+            ? isScalar$1(pair.key)
+                ? pair.key.value
+                : pair.key
+            : pair;
+    }
+    set(key, value) {
+        if (typeof value !== 'boolean')
+            throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof value}`);
+        const prev = findPair(this.items, key);
+        if (prev && !value) {
+            this.items.splice(this.items.indexOf(prev), 1);
+        }
+        else if (!prev && value) {
+            this.items.push(new Pair(key));
+        }
+    }
+    toJSON(_, ctx) {
+        return super.toJSON(_, ctx, Set);
+    }
+    toString(ctx, onComment, onChompKeep) {
+        if (!ctx)
+            return JSON.stringify(this);
+        if (this.hasAllNullValues(true))
+            return super.toString(Object.assign({}, ctx, { allNullValues: true }), onComment, onChompKeep);
+        else
+            throw new Error('Set items must all have null values');
+    }
+    static from(schema, iterable, ctx) {
+        const { replacer } = ctx;
+        const set = new this(schema);
+        if (iterable && Symbol.iterator in Object(iterable))
+            for (let value of iterable) {
+                if (typeof replacer === 'function')
+                    value = replacer.call(iterable, value, value);
+                set.items.push(createPair(value, null, ctx));
+            }
+        return set;
+    }
+}
+YAMLSet.tag = 'tag:yaml.org,2002:set';
+const set = {
+    collection: 'map',
+    identify: value => value instanceof Set,
+    nodeClass: YAMLSet,
+    default: false,
+    tag: 'tag:yaml.org,2002:set',
+    createNode: (schema, iterable, ctx) => YAMLSet.from(schema, iterable, ctx),
+    resolve(map, onError) {
+        if (isMap(map)) {
+            if (map.hasAllNullValues(true))
+                return Object.assign(new YAMLSet(), map);
+            else
+                onError('Set items must all have null values');
+        }
+        else
+            onError('Expected a mapping for this tag');
+        return map;
+    }
+};
+
+/** Internal types handle bigint as number, because TS can't figure it out. */
+function parseSexagesimal(str, asBigInt) {
+    const sign = str[0];
+    const parts = sign === '-' || sign === '+' ? str.substring(1) : str;
+    const num = (n) => asBigInt ? BigInt(n) : Number(n);
+    const res = parts
+        .replace(/_/g, '')
+        .split(':')
+        .reduce((res, p) => res * num(60) + num(p), num(0));
+    return (sign === '-' ? num(-1) * res : res);
+}
+/**
+ * hhhh:mm:ss.sss
+ *
+ * Internal types handle bigint as number, because TS can't figure it out.
+ */
+function stringifySexagesimal(node) {
+    let { value } = node;
+    let num = (n) => n;
+    if (typeof value === 'bigint')
+        num = n => BigInt(n);
+    else if (isNaN(value) || !isFinite(value))
+        return stringifyNumber(node);
+    let sign = '';
+    if (value < 0) {
+        sign = '-';
+        value *= num(-1);
+    }
+    const _60 = num(60);
+    const parts = [value % _60]; // seconds, including ms
+    if (value < 60) {
+        parts.unshift(0); // at least one : is required
+    }
+    else {
+        value = (value - parts[0]) / _60;
+        parts.unshift(value % _60); // minutes
+        if (value >= 60) {
+            value = (value - parts[0]) / _60;
+            parts.unshift(value); // hours
+        }
+    }
+    return (sign +
+        parts
+            .map(n => String(n).padStart(2, '0'))
+            .join(':')
+            .replace(/000000\d*$/, '') // % 60 may introduce error
+    );
+}
+const intTime = {
+    identify: value => typeof value === 'bigint' || Number.isInteger(value),
+    default: true,
+    tag: 'tag:yaml.org,2002:int',
+    format: 'TIME',
+    test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
+    resolve: (str, _onError, { intAsBigInt }) => parseSexagesimal(str, intAsBigInt),
+    stringify: stringifySexagesimal
+};
+const floatTime = {
+    identify: value => typeof value === 'number',
+    default: true,
+    tag: 'tag:yaml.org,2002:float',
+    format: 'TIME',
+    test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
+    resolve: str => parseSexagesimal(str, false),
+    stringify: stringifySexagesimal
+};
+const timestamp = {
+    identify: value => value instanceof Date,
+    default: true,
+    tag: 'tag:yaml.org,2002:timestamp',
+    // If the time zone is omitted, the timestamp is assumed to be specified in UTC. The time part
+    // may be omitted altogether, resulting in a date format. In such a case, the time part is
+    // assumed to be 00:00:00Z (start of day, UTC).
+    test: RegExp('^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})' + // YYYY-Mm-Dd
+        '(?:' + // time is optional
+        '(?:t|T|[ \\t]+)' + // t | T | whitespace
+        '([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)' + // Hh:Mm:Ss(.ss)?
+        '(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?' + // Z | +5 | -03:30
+        ')?$'),
+    resolve(str) {
+        const match = str.match(timestamp.test);
+        if (!match)
+            throw new Error('!!timestamp expects a date, starting with yyyy-mm-dd');
+        const [, year, month, day, hour, minute, second] = match.map(Number);
+        const millisec = match[7] ? Number((match[7] + '00').substr(1, 3)) : 0;
+        let date = Date.UTC(year, month - 1, day, hour || 0, minute || 0, second || 0, millisec);
+        const tz = match[8];
+        if (tz && tz !== 'Z') {
+            let d = parseSexagesimal(tz, false);
+            if (Math.abs(d) < 30)
+                d *= 60;
+            date -= 60000 * d;
+        }
+        return new Date(date);
+    },
+    stringify: ({ value }) => value.toISOString().replace(/((T00:00)?:00)?\.000Z$/, '')
+};
+
+const schema = [
+    map$1,
+    seq,
+    string,
+    nullTag,
+    trueTag,
+    falseTag,
+    intBin,
+    intOct,
+    int,
+    intHex,
+    floatNaN,
+    floatExp,
+    float,
+    binary,
+    omap,
+    pairs,
+    set,
+    intTime,
+    floatTime,
+    timestamp
+];
+
+const schemas = new Map([
+    ['core', schema$2],
+    ['failsafe', [map$1, seq, string]],
+    ['json', schema$1],
+    ['yaml11', schema],
+    ['yaml-1.1', schema]
+]);
+const tagsByName = {
+    binary,
+    bool: boolTag,
+    float: float$1,
+    floatExp: floatExp$1,
+    floatNaN: floatNaN$1,
+    floatTime,
+    int: int$1,
+    intHex: intHex$1,
+    intOct: intOct$1,
+    intTime,
+    map: map$1,
+    null: nullTag,
+    omap,
+    pairs,
+    seq,
+    set,
+    timestamp
+};
+const coreKnownTags = {
+    'tag:yaml.org,2002:binary': binary,
+    'tag:yaml.org,2002:omap': omap,
+    'tag:yaml.org,2002:pairs': pairs,
+    'tag:yaml.org,2002:set': set,
+    'tag:yaml.org,2002:timestamp': timestamp
+};
+function getTags(customTags, schemaName) {
+    let tags = schemas.get(schemaName);
+    if (!tags) {
+        if (Array.isArray(customTags))
+            tags = [];
+        else {
+            const keys = Array.from(schemas.keys())
+                .filter(key => key !== 'yaml11')
+                .map(key => JSON.stringify(key))
+                .join(', ');
+            throw new Error(`Unknown schema "${schemaName}"; use one of ${keys} or define customTags array`);
+        }
+    }
+    if (Array.isArray(customTags)) {
+        for (const tag of customTags)
+            tags = tags.concat(tag);
+    }
+    else if (typeof customTags === 'function') {
+        tags = customTags(tags.slice());
+    }
+    return tags.map(tag => {
+        if (typeof tag !== 'string')
+            return tag;
+        const tagObj = tagsByName[tag];
+        if (tagObj)
+            return tagObj;
+        const keys = Object.keys(tagsByName)
+            .map(key => JSON.stringify(key))
+            .join(', ');
+        throw new Error(`Unknown custom tag "${tag}"; use one of ${keys}`);
+    });
+}
+
+const sortMapEntriesByKey = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
+class Schema {
+    constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }) {
+        this.compat = Array.isArray(compat)
+            ? getTags(compat, 'compat')
+            : compat
+                ? getTags(null, compat)
+                : null;
+        this.merge = !!merge;
+        this.name = (typeof schema === 'string' && schema) || 'core';
+        this.knownTags = resolveKnownTags ? coreKnownTags : {};
+        this.tags = getTags(customTags, this.name);
+        this.toStringOptions = toStringDefaults ?? null;
+        Object.defineProperty(this, MAP, { value: map$1 });
+        Object.defineProperty(this, SCALAR$1, { value: string });
+        Object.defineProperty(this, SEQ, { value: seq });
+        // Used by createMap()
+        this.sortMapEntries =
+            typeof sortMapEntries === 'function'
+                ? sortMapEntries
+                : sortMapEntries === true
+                    ? sortMapEntriesByKey
+                    : null;
+    }
+    clone() {
+        const copy = Object.create(Schema.prototype, Object.getOwnPropertyDescriptors(this));
+        copy.tags = this.tags.slice();
+        return copy;
+    }
+}
+
+function stringifyDocument(doc, options) {
+    const lines = [];
+    let hasDirectives = options.directives === true;
+    if (options.directives !== false && doc.directives) {
+        const dir = doc.directives.toString(doc);
+        if (dir) {
+            lines.push(dir);
+            hasDirectives = true;
+        }
+        else if (doc.directives.docStart)
+            hasDirectives = true;
+    }
+    if (hasDirectives)
+        lines.push('---');
+    const ctx = createStringifyContext(doc, options);
+    const { commentString } = ctx.options;
+    if (doc.commentBefore) {
+        if (lines.length !== 1)
+            lines.unshift('');
+        const cs = commentString(doc.commentBefore);
+        lines.unshift(indentComment(cs, ''));
+    }
+    let chompKeep = false;
+    let contentComment = null;
+    if (doc.contents) {
+        if (isNode$1(doc.contents)) {
+            if (doc.contents.spaceBefore && hasDirectives)
+                lines.push('');
+            if (doc.contents.commentBefore) {
+                const cs = commentString(doc.contents.commentBefore);
+                lines.push(indentComment(cs, ''));
+            }
+            // top-level block scalars need to be indented if followed by a comment
+            ctx.forceBlockIndent = !!doc.comment;
+            contentComment = doc.contents.comment;
+        }
+        const onChompKeep = contentComment ? undefined : () => (chompKeep = true);
+        let body = stringify$2(doc.contents, ctx, () => (contentComment = null), onChompKeep);
+        if (contentComment)
+            body += lineComment(body, '', commentString(contentComment));
+        if ((body[0] === '|' || body[0] === '>') &&
+            lines[lines.length - 1] === '---') {
+            // Top-level block scalars with a preceding doc marker ought to use the
+            // same line for their header.
+            lines[lines.length - 1] = `--- ${body}`;
+        }
+        else
+            lines.push(body);
+    }
+    else {
+        lines.push(stringify$2(doc.contents, ctx));
+    }
+    if (doc.directives?.docEnd) {
+        if (doc.comment) {
+            const cs = commentString(doc.comment);
+            if (cs.includes('\n')) {
+                lines.push('...');
+                lines.push(indentComment(cs, ''));
+            }
+            else {
+                lines.push(`... ${cs}`);
+            }
+        }
+        else {
+            lines.push('...');
+        }
+    }
+    else {
+        let dc = doc.comment;
+        if (dc && chompKeep)
+            dc = dc.replace(/^\n+/, '');
+        if (dc) {
+            if ((!chompKeep || contentComment) && lines[lines.length - 1] !== '')
+                lines.push('');
+            lines.push(indentComment(commentString(dc), ''));
+        }
+    }
+    return lines.join('\n') + '\n';
+}
+
+class Document {
+    constructor(value, replacer, options) {
+        /** A comment before this Document */
+        this.commentBefore = null;
+        /** A comment immediately after this Document */
+        this.comment = null;
+        /** Errors encountered during parsing. */
+        this.errors = [];
+        /** Warnings encountered during parsing. */
+        this.warnings = [];
+        Object.defineProperty(this, NODE_TYPE, { value: DOC });
+        let _replacer = null;
+        if (typeof replacer === 'function' || Array.isArray(replacer)) {
+            _replacer = replacer;
+        }
+        else if (options === undefined && replacer) {
+            options = replacer;
+            replacer = undefined;
+        }
+        const opt = Object.assign({
+            intAsBigInt: false,
+            keepSourceTokens: false,
+            logLevel: 'warn',
+            prettyErrors: true,
+            strict: true,
+            uniqueKeys: true,
+            version: '1.2'
+        }, options);
+        this.options = opt;
+        let { version } = opt;
+        if (options?._directives) {
+            this.directives = options._directives.atDocument();
+            if (this.directives.yaml.explicit)
+                version = this.directives.yaml.version;
+        }
+        else
+            this.directives = new Directives({ version });
+        this.setSchema(version, options);
+        // @ts-expect-error We can't really know that this matches Contents.
+        this.contents =
+            value === undefined ? null : this.createNode(value, _replacer, options);
+    }
+    /**
+     * Create a deep copy of this Document and its contents.
+     *
+     * Custom Node values that inherit from `Object` still refer to their original instances.
+     */
+    clone() {
+        const copy = Object.create(Document.prototype, {
+            [NODE_TYPE]: { value: DOC }
+        });
+        copy.commentBefore = this.commentBefore;
+        copy.comment = this.comment;
+        copy.errors = this.errors.slice();
+        copy.warnings = this.warnings.slice();
+        copy.options = Object.assign({}, this.options);
+        if (this.directives)
+            copy.directives = this.directives.clone();
+        copy.schema = this.schema.clone();
+        // @ts-expect-error We can't really know that this matches Contents.
+        copy.contents = isNode$1(this.contents)
+            ? this.contents.clone(copy.schema)
+            : this.contents;
+        if (this.range)
+            copy.range = this.range.slice();
+        return copy;
+    }
+    /** Adds a value to the document. */
+    add(value) {
+        if (assertCollection(this.contents))
+            this.contents.add(value);
+    }
+    /** Adds a value to the document. */
+    addIn(path, value) {
+        if (assertCollection(this.contents))
+            this.contents.addIn(path, value);
+    }
+    /**
+     * Create a new `Alias` node, ensuring that the target `node` has the required anchor.
+     *
+     * If `node` already has an anchor, `name` is ignored.
+     * Otherwise, the `node.anchor` value will be set to `name`,
+     * or if an anchor with that name is already present in the document,
+     * `name` will be used as a prefix for a new unique anchor.
+     * If `name` is undefined, the generated anchor will use 'a' as a prefix.
+     */
+    createAlias(node, name) {
+        if (!node.anchor) {
+            const prev = anchorNames(this);
+            node.anchor =
+                // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
+                !name || prev.has(name) ? findNewAnchor(name || 'a', prev) : name;
+        }
+        return new Alias(node.anchor);
+    }
+    createNode(value, replacer, options) {
+        let _replacer = undefined;
+        if (typeof replacer === 'function') {
+            value = replacer.call({ '': value }, '', value);
+            _replacer = replacer;
+        }
+        else if (Array.isArray(replacer)) {
+            const keyToStr = (v) => typeof v === 'number' || v instanceof String || v instanceof Number;
+            const asStr = replacer.filter(keyToStr).map(String);
+            if (asStr.length > 0)
+                replacer = replacer.concat(asStr);
+            _replacer = replacer;
+        }
+        else if (options === undefined && replacer) {
+            options = replacer;
+            replacer = undefined;
+        }
+        const { aliasDuplicateObjects, anchorPrefix, flow, keepUndefined, onTagObj, tag } = options ?? {};
+        const { onAnchor, setAnchors, sourceObjects } = createNodeAnchors(this, 
+        // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
+        anchorPrefix || 'a');
+        const ctx = {
+            aliasDuplicateObjects: aliasDuplicateObjects ?? true,
+            keepUndefined: keepUndefined ?? false,
+            onAnchor,
+            onTagObj,
+            replacer: _replacer,
+            schema: this.schema,
+            sourceObjects
+        };
+        const node = createNode(value, tag, ctx);
+        if (flow && isCollection$1(node))
+            node.flow = true;
+        setAnchors();
+        return node;
+    }
+    /**
+     * Convert a key and a value into a `Pair` using the current schema,
+     * recursively wrapping all values as `Scalar` or `Collection` nodes.
+     */
+    createPair(key, value, options = {}) {
+        const k = this.createNode(key, null, options);
+        const v = this.createNode(value, null, options);
+        return new Pair(k, v);
+    }
+    /**
+     * Removes a value from the document.
+     * @returns `true` if the item was found and removed.
+     */
+    delete(key) {
+        return assertCollection(this.contents) ? this.contents.delete(key) : false;
+    }
+    /**
+     * Removes a value from the document.
+     * @returns `true` if the item was found and removed.
+     */
+    deleteIn(path) {
+        if (isEmptyPath(path)) {
+            if (this.contents == null)
+                return false;
+            // @ts-expect-error Presumed impossible if Strict extends false
+            this.contents = null;
+            return true;
+        }
+        return assertCollection(this.contents)
+            ? this.contents.deleteIn(path)
+            : false;
+    }
+    /**
+     * Returns item at `key`, or `undefined` if not found. By default unwraps
+     * scalar values from their surrounding node; to disable set `keepScalar` to
+     * `true` (collections are always returned intact).
+     */
+    get(key, keepScalar) {
+        return isCollection$1(this.contents)
+            ? this.contents.get(key, keepScalar)
+            : undefined;
+    }
+    /**
+     * Returns item at `path`, or `undefined` if not found. By default unwraps
+     * scalar values from their surrounding node; to disable set `keepScalar` to
+     * `true` (collections are always returned intact).
+     */
+    getIn(path, keepScalar) {
+        if (isEmptyPath(path))
+            return !keepScalar && isScalar$1(this.contents)
+                ? this.contents.value
+                : this.contents;
+        return isCollection$1(this.contents)
+            ? this.contents.getIn(path, keepScalar)
+            : undefined;
+    }
+    /**
+     * Checks if the document includes a value with the key `key`.
+     */
+    has(key) {
+        return isCollection$1(this.contents) ? this.contents.has(key) : false;
+    }
+    /**
+     * Checks if the document includes a value at `path`.
+     */
+    hasIn(path) {
+        if (isEmptyPath(path))
+            return this.contents !== undefined;
+        return isCollection$1(this.contents) ? this.contents.hasIn(path) : false;
+    }
+    /**
+     * Sets a value in this document. For `!!set`, `value` needs to be a
+     * boolean to add/remove the item from the set.
+     */
+    set(key, value) {
+        if (this.contents == null) {
+            // @ts-expect-error We can't really know that this matches Contents.
+            this.contents = collectionFromPath(this.schema, [key], value);
+        }
+        else if (assertCollection(this.contents)) {
+            this.contents.set(key, value);
+        }
+    }
+    /**
+     * Sets a value in this document. For `!!set`, `value` needs to be a
+     * boolean to add/remove the item from the set.
+     */
+    setIn(path, value) {
+        if (isEmptyPath(path)) {
+            // @ts-expect-error We can't really know that this matches Contents.
+            this.contents = value;
+        }
+        else if (this.contents == null) {
+            // @ts-expect-error We can't really know that this matches Contents.
+            this.contents = collectionFromPath(this.schema, Array.from(path), value);
+        }
+        else if (assertCollection(this.contents)) {
+            this.contents.setIn(path, value);
+        }
+    }
+    /**
+     * Change the YAML version and schema used by the document.
+     * A `null` version disables support for directives, explicit tags, anchors, and aliases.
+     * It also requires the `schema` option to be given as a `Schema` instance value.
+     *
+     * Overrides all previously set schema options.
+     */
+    setSchema(version, options = {}) {
+        if (typeof version === 'number')
+            version = String(version);
+        let opt;
+        switch (version) {
+            case '1.1':
+                if (this.directives)
+                    this.directives.yaml.version = '1.1';
+                else
+                    this.directives = new Directives({ version: '1.1' });
+                opt = { merge: true, resolveKnownTags: false, schema: 'yaml-1.1' };
+                break;
+            case '1.2':
+            case 'next':
+                if (this.directives)
+                    this.directives.yaml.version = version;
+                else
+                    this.directives = new Directives({ version });
+                opt = { merge: false, resolveKnownTags: true, schema: 'core' };
+                break;
+            case null:
+                if (this.directives)
+                    delete this.directives;
+                opt = null;
+                break;
+            default: {
+                const sv = JSON.stringify(version);
+                throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${sv}`);
+            }
+        }
+        // Not using `instanceof Schema` to allow for duck typing
+        if (options.schema instanceof Object)
+            this.schema = options.schema;
+        else if (opt)
+            this.schema = new Schema(Object.assign(opt, options));
+        else
+            throw new Error(`With a null YAML version, the { schema: Schema } option is required`);
+    }
+    // json & jsonArg are only used from toJSON()
+    toJS({ json, jsonArg, mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
+        const ctx = {
+            anchors: new Map(),
+            doc: this,
+            keep: !json,
+            mapAsMap: mapAsMap === true,
+            mapKeyWarned: false,
+            maxAliasCount: typeof maxAliasCount === 'number' ? maxAliasCount : 100
+        };
+        const res = toJS(this.contents, jsonArg ?? '', ctx);
+        if (typeof onAnchor === 'function')
+            for (const { count, res } of ctx.anchors.values())
+                onAnchor(res, count);
+        return typeof reviver === 'function'
+            ? applyReviver(reviver, { '': res }, '', res)
+            : res;
+    }
+    /**
+     * A JSON representation of the document `contents`.
+     *
+     * @param jsonArg Used by `JSON.stringify` to indicate the array index or
+     *   property name.
+     */
+    toJSON(jsonArg, onAnchor) {
+        return this.toJS({ json: true, jsonArg, mapAsMap: false, onAnchor });
+    }
+    /** A YAML representation of the document. */
+    toString(options = {}) {
+        if (this.errors.length > 0)
+            throw new Error('Document with errors cannot be stringified');
+        if ('indent' in options &&
+            (!Number.isInteger(options.indent) || Number(options.indent) <= 0)) {
+            const s = JSON.stringify(options.indent);
+            throw new Error(`"indent" option must be a positive integer, not ${s}`);
+        }
+        return stringifyDocument(this, options);
+    }
+}
+function assertCollection(contents) {
+    if (isCollection$1(contents))
+        return true;
+    throw new Error('Expected a YAML collection as document contents');
+}
+
+class YAMLError extends Error {
+    constructor(name, pos, code, message) {
+        super();
+        this.name = name;
+        this.code = code;
+        this.message = message;
+        this.pos = pos;
+    }
+}
+class YAMLParseError extends YAMLError {
+    constructor(pos, code, message) {
+        super('YAMLParseError', pos, code, message);
+    }
+}
+class YAMLWarning extends YAMLError {
+    constructor(pos, code, message) {
+        super('YAMLWarning', pos, code, message);
+    }
+}
+const prettifyError = (src, lc) => (error) => {
+    if (error.pos[0] === -1)
+        return;
+    error.linePos = error.pos.map(pos => lc.linePos(pos));
+    const { line, col } = error.linePos[0];
+    error.message += ` at line ${line}, column ${col}`;
+    let ci = col - 1;
+    let lineStr = src
+        .substring(lc.lineStarts[line - 1], lc.lineStarts[line])
+        .replace(/[\n\r]+$/, '');
+    // Trim to max 80 chars, keeping col position near the middle
+    if (ci >= 60 && lineStr.length > 80) {
+        const trimStart = Math.min(ci - 39, lineStr.length - 79);
+        lineStr = '…' + lineStr.substring(trimStart);
+        ci -= trimStart - 1;
+    }
+    if (lineStr.length > 80)
+        lineStr = lineStr.substring(0, 79) + '…';
+    // Include previous line in context if pointing at line start
+    if (line > 1 && /^ *$/.test(lineStr.substring(0, ci))) {
+        // Regexp won't match if start is trimmed
+        let prev = src.substring(lc.lineStarts[line - 2], lc.lineStarts[line - 1]);
+        if (prev.length > 80)
+            prev = prev.substring(0, 79) + '…\n';
+        lineStr = prev + lineStr;
+    }
+    if (/[^ ]/.test(lineStr)) {
+        let count = 1;
+        const end = error.linePos[1];
+        if (end && end.line === line && end.col > col) {
+            count = Math.max(1, Math.min(end.col - col, 80 - ci));
+        }
+        const pointer = ' '.repeat(ci) + '^'.repeat(count);
+        error.message += `:\n\n${lineStr}\n${pointer}\n`;
+    }
+};
+
+function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
+    let spaceBefore = false;
+    let atNewline = startOnNewline;
+    let hasSpace = startOnNewline;
+    let comment = '';
+    let commentSep = '';
+    let hasNewline = false;
+    let reqSpace = false;
+    let tab = null;
+    let anchor = null;
+    let tag = null;
+    let newlineAfterProp = null;
+    let comma = null;
+    let found = null;
+    let start = null;
+    for (const token of tokens) {
+        if (reqSpace) {
+            if (token.type !== 'space' &&
+                token.type !== 'newline' &&
+                token.type !== 'comma')
+                onError(token.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
+            reqSpace = false;
+        }
+        if (tab) {
+            if (atNewline && token.type !== 'comment' && token.type !== 'newline') {
+                onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
+            }
+            tab = null;
+        }
+        switch (token.type) {
+            case 'space':
+                // At the doc level, tabs at line start may be parsed
+                // as leading white space rather than indentation.
+                // In a flow collection, only the parser handles indent.
+                if (!flow &&
+                    (indicator !== 'doc-start' || next?.type !== 'flow-collection') &&
+                    token.source.includes('\t')) {
+                    tab = token;
+                }
+                hasSpace = true;
+                break;
+            case 'comment': {
+                if (!hasSpace)
+                    onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
+                const cb = token.source.substring(1) || ' ';
+                if (!comment)
+                    comment = cb;
+                else
+                    comment += commentSep + cb;
+                commentSep = '';
+                atNewline = false;
+                break;
+            }
+            case 'newline':
+                if (atNewline) {
+                    if (comment)
+                        comment += token.source;
+                    else
+                        spaceBefore = true;
+                }
+                else
+                    commentSep += token.source;
+                atNewline = true;
+                hasNewline = true;
+                if (anchor || tag)
+                    newlineAfterProp = token;
+                hasSpace = true;
+                break;
+            case 'anchor':
+                if (anchor)
+                    onError(token, 'MULTIPLE_ANCHORS', 'A node can have at most one anchor');
+                if (token.source.endsWith(':'))
+                    onError(token.offset + token.source.length - 1, 'BAD_ALIAS', 'Anchor ending in : is ambiguous', true);
+                anchor = token;
+                if (start === null)
+                    start = token.offset;
+                atNewline = false;
+                hasSpace = false;
+                reqSpace = true;
+                break;
+            case 'tag': {
+                if (tag)
+                    onError(token, 'MULTIPLE_TAGS', 'A node can have at most one tag');
+                tag = token;
+                if (start === null)
+                    start = token.offset;
+                atNewline = false;
+                hasSpace = false;
+                reqSpace = true;
+                break;
+            }
+            case indicator:
+                // Could here handle preceding comments differently
+                if (anchor || tag)
+                    onError(token, 'BAD_PROP_ORDER', `Anchors and tags must be after the ${token.source} indicator`);
+                if (found)
+                    onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.source} in ${flow ?? 'collection'}`);
+                found = token;
+                atNewline =
+                    indicator === 'seq-item-ind' || indicator === 'explicit-key-ind';
+                hasSpace = false;
+                break;
+            case 'comma':
+                if (flow) {
+                    if (comma)
+                        onError(token, 'UNEXPECTED_TOKEN', `Unexpected , in ${flow}`);
+                    comma = token;
+                    atNewline = false;
+                    hasSpace = false;
+                    break;
+                }
+            // else fallthrough
+            default:
+                onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${token.type} token`);
+                atNewline = false;
+                hasSpace = false;
+        }
+    }
+    const last = tokens[tokens.length - 1];
+    const end = last ? last.offset + last.source.length : offset;
+    if (reqSpace &&
+        next &&
+        next.type !== 'space' &&
+        next.type !== 'newline' &&
+        next.type !== 'comma' &&
+        (next.type !== 'scalar' || next.source !== '')) {
+        onError(next.offset, 'MISSING_CHAR', 'Tags and anchors must be separated from the next token by white space');
+    }
+    if (tab &&
+        ((atNewline && tab.indent <= parentIndent) ||
+            next?.type === 'block-map' ||
+            next?.type === 'block-seq'))
+        onError(tab, 'TAB_AS_INDENT', 'Tabs are not allowed as indentation');
+    return {
+        comma,
+        found,
+        spaceBefore,
+        comment,
+        hasNewline,
+        anchor,
+        tag,
+        newlineAfterProp,
+        end,
+        start: start ?? end
+    };
+}
+
+function containsNewline(key) {
+    if (!key)
+        return null;
+    switch (key.type) {
+        case 'alias':
+        case 'scalar':
+        case 'double-quoted-scalar':
+        case 'single-quoted-scalar':
+            if (key.source.includes('\n'))
+                return true;
+            if (key.end)
+                for (const st of key.end)
+                    if (st.type === 'newline')
+                        return true;
+            return false;
+        case 'flow-collection':
+            for (const it of key.items) {
+                for (const st of it.start)
+                    if (st.type === 'newline')
+                        return true;
+                if (it.sep)
+                    for (const st of it.sep)
+                        if (st.type === 'newline')
+                            return true;
+                if (containsNewline(it.key) || containsNewline(it.value))
+                    return true;
+            }
+            return false;
+        default:
+            return true;
+    }
+}
+
+function flowIndentCheck(indent, fc, onError) {
+    if (fc?.type === 'flow-collection') {
+        const end = fc.end[0];
+        if (end.indent === indent &&
+            (end.source === ']' || end.source === '}') &&
+            containsNewline(fc)) {
+            const msg = 'Flow end indicator should be more indented than parent';
+            onError(end, 'BAD_INDENT', msg, true);
+        }
+    }
+}
+
+function mapIncludes(ctx, items, search) {
+    const { uniqueKeys } = ctx.options;
+    if (uniqueKeys === false)
+        return false;
+    const isEqual = typeof uniqueKeys === 'function'
+        ? uniqueKeys
+        : (a, b) => a === b ||
+            (isScalar$1(a) &&
+                isScalar$1(b) &&
+                a.value === b.value &&
+                !(a.value === '<<' && ctx.schema.merge));
+    return items.some(pair => isEqual(pair.key, search));
+}
+
+const startColMsg = 'All mapping items must start at the same column';
+function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
+    const NodeClass = tag?.nodeClass ?? YAMLMap;
+    const map = new NodeClass(ctx.schema);
+    if (ctx.atRoot)
+        ctx.atRoot = false;
+    let offset = bm.offset;
+    let commentEnd = null;
+    for (const collItem of bm.items) {
+        const { start, key, sep, value } = collItem;
+        // key properties
+        const keyProps = resolveProps(start, {
+            indicator: 'explicit-key-ind',
+            next: key ?? sep?.[0],
+            offset,
+            onError,
+            parentIndent: bm.indent,
+            startOnNewline: true
+        });
+        const implicitKey = !keyProps.found;
+        if (implicitKey) {
+            if (key) {
+                if (key.type === 'block-seq')
+                    onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'A block sequence may not be used as an implicit map key');
+                else if ('indent' in key && key.indent !== bm.indent)
+                    onError(offset, 'BAD_INDENT', startColMsg);
+            }
+            if (!keyProps.anchor && !keyProps.tag && !sep) {
+                commentEnd = keyProps.end;
+                if (keyProps.comment) {
+                    if (map.comment)
+                        map.comment += '\n' + keyProps.comment;
+                    else
+                        map.comment = keyProps.comment;
+                }
+                continue;
+            }
+            if (keyProps.newlineAfterProp || containsNewline(key)) {
+                onError(key ?? start[start.length - 1], 'MULTILINE_IMPLICIT_KEY', 'Implicit keys need to be on a single line');
+            }
+        }
+        else if (keyProps.found?.indent !== bm.indent) {
+            onError(offset, 'BAD_INDENT', startColMsg);
+        }
+        // key value
+        const keyStart = keyProps.end;
+        const keyNode = key
+            ? composeNode(ctx, key, keyProps, onError)
+            : composeEmptyNode(ctx, keyStart, start, null, keyProps, onError);
+        if (ctx.schema.compat)
+            flowIndentCheck(bm.indent, key, onError);
+        if (mapIncludes(ctx, map.items, keyNode))
+            onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
+        // value properties
+        const valueProps = resolveProps(sep ?? [], {
+            indicator: 'map-value-ind',
+            next: value,
+            offset: keyNode.range[2],
+            onError,
+            parentIndent: bm.indent,
+            startOnNewline: !key || key.type === 'block-scalar'
+        });
+        offset = valueProps.end;
+        if (valueProps.found) {
+            if (implicitKey) {
+                if (value?.type === 'block-map' && !valueProps.hasNewline)
+                    onError(offset, 'BLOCK_AS_IMPLICIT_KEY', 'Nested mappings are not allowed in compact mappings');
+                if (ctx.options.strict &&
+                    keyProps.start < valueProps.found.offset - 1024)
+                    onError(keyNode.range, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit block mapping key');
+            }
+            // value value
+            const valueNode = value
+                ? composeNode(ctx, value, valueProps, onError)
+                : composeEmptyNode(ctx, offset, sep, null, valueProps, onError);
+            if (ctx.schema.compat)
+                flowIndentCheck(bm.indent, value, onError);
+            offset = valueNode.range[2];
+            const pair = new Pair(keyNode, valueNode);
+            if (ctx.options.keepSourceTokens)
+                pair.srcToken = collItem;
+            map.items.push(pair);
+        }
+        else {
+            // key with no value
+            if (implicitKey)
+                onError(keyNode.range, 'MISSING_CHAR', 'Implicit map keys need to be followed by map values');
+            if (valueProps.comment) {
+                if (keyNode.comment)
+                    keyNode.comment += '\n' + valueProps.comment;
+                else
+                    keyNode.comment = valueProps.comment;
+            }
+            const pair = new Pair(keyNode);
+            if (ctx.options.keepSourceTokens)
+                pair.srcToken = collItem;
+            map.items.push(pair);
+        }
+    }
+    if (commentEnd && commentEnd < offset)
+        onError(commentEnd, 'IMPOSSIBLE', 'Map comment with trailing content');
+    map.range = [bm.offset, offset, commentEnd ?? offset];
+    return map;
+}
+
+function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {
+    const NodeClass = tag?.nodeClass ?? YAMLSeq;
+    const seq = new NodeClass(ctx.schema);
+    if (ctx.atRoot)
+        ctx.atRoot = false;
+    let offset = bs.offset;
+    let commentEnd = null;
+    for (const { start, value } of bs.items) {
+        const props = resolveProps(start, {
+            indicator: 'seq-item-ind',
+            next: value,
+            offset,
+            onError,
+            parentIndent: bs.indent,
+            startOnNewline: true
+        });
+        if (!props.found) {
+            if (props.anchor || props.tag || value) {
+                if (value && value.type === 'block-seq')
+                    onError(props.end, 'BAD_INDENT', 'All sequence items must start at the same column');
+                else
+                    onError(offset, 'MISSING_CHAR', 'Sequence item without - indicator');
+            }
+            else {
+                commentEnd = props.end;
+                if (props.comment)
+                    seq.comment = props.comment;
+                continue;
+            }
+        }
+        const node = value
+            ? composeNode(ctx, value, props, onError)
+            : composeEmptyNode(ctx, props.end, start, null, props, onError);
+        if (ctx.schema.compat)
+            flowIndentCheck(bs.indent, value, onError);
+        offset = node.range[2];
+        seq.items.push(node);
+    }
+    seq.range = [bs.offset, offset, commentEnd ?? offset];
+    return seq;
+}
+
+function resolveEnd(end, offset, reqSpace, onError) {
+    let comment = '';
+    if (end) {
+        let hasSpace = false;
+        let sep = '';
+        for (const token of end) {
+            const { source, type } = token;
+            switch (type) {
+                case 'space':
+                    hasSpace = true;
+                    break;
+                case 'comment': {
+                    if (reqSpace && !hasSpace)
+                        onError(token, 'MISSING_CHAR', 'Comments must be separated from other tokens by white space characters');
+                    const cb = source.substring(1) || ' ';
+                    if (!comment)
+                        comment = cb;
+                    else
+                        comment += sep + cb;
+                    sep = '';
+                    break;
+                }
+                case 'newline':
+                    if (comment)
+                        sep += source;
+                    hasSpace = true;
+                    break;
+                default:
+                    onError(token, 'UNEXPECTED_TOKEN', `Unexpected ${type} at node end`);
+            }
+            offset += source.length;
+        }
+    }
+    return { comment, offset };
+}
+
+const blockMsg = 'Block collections are not allowed within flow collections';
+const isBlock$1 = (token) => token && (token.type === 'block-map' || token.type === 'block-seq');
+function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
+    const isMap = fc.start.source === '{';
+    const fcName = isMap ? 'flow map' : 'flow sequence';
+    const NodeClass = (tag?.nodeClass ?? (isMap ? YAMLMap : YAMLSeq));
+    const coll = new NodeClass(ctx.schema);
+    coll.flow = true;
+    const atRoot = ctx.atRoot;
+    if (atRoot)
+        ctx.atRoot = false;
+    let offset = fc.offset + fc.start.source.length;
+    for (let i = 0; i < fc.items.length; ++i) {
+        const collItem = fc.items[i];
+        const { start, key, sep, value } = collItem;
+        const props = resolveProps(start, {
+            flow: fcName,
+            indicator: 'explicit-key-ind',
+            next: key ?? sep?.[0],
+            offset,
+            onError,
+            parentIndent: fc.indent,
+            startOnNewline: false
+        });
+        if (!props.found) {
+            if (!props.anchor && !props.tag && !sep && !value) {
+                if (i === 0 && props.comma)
+                    onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);
+                else if (i < fc.items.length - 1)
+                    onError(props.start, 'UNEXPECTED_TOKEN', `Unexpected empty item in ${fcName}`);
+                if (props.comment) {
+                    if (coll.comment)
+                        coll.comment += '\n' + props.comment;
+                    else
+                        coll.comment = props.comment;
+                }
+                offset = props.end;
+                continue;
+            }
+            if (!isMap && ctx.options.strict && containsNewline(key))
+                onError(key, // checked by containsNewline()
+                'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');
+        }
+        if (i === 0) {
+            if (props.comma)
+                onError(props.comma, 'UNEXPECTED_TOKEN', `Unexpected , in ${fcName}`);
+        }
+        else {
+            if (!props.comma)
+                onError(props.start, 'MISSING_CHAR', `Missing , between ${fcName} items`);
+            if (props.comment) {
+                let prevItemComment = '';
+                loop: for (const st of start) {
+                    switch (st.type) {
+                        case 'comma':
+                        case 'space':
+                            break;
+                        case 'comment':
+                            prevItemComment = st.source.substring(1);
+                            break loop;
+                        default:
+                            break loop;
+                    }
+                }
+                if (prevItemComment) {
+                    let prev = coll.items[coll.items.length - 1];
+                    if (isPair(prev))
+                        prev = prev.value ?? prev.key;
+                    if (prev.comment)
+                        prev.comment += '\n' + prevItemComment;
+                    else
+                        prev.comment = prevItemComment;
+                    props.comment = props.comment.substring(prevItemComment.length + 1);
+                }
+            }
+        }
+        if (!isMap && !sep && !props.found) {
+            // item is a value in a seq
+            // → key & sep are empty, start does not include ? or :
+            const valueNode = value
+                ? composeNode(ctx, value, props, onError)
+                : composeEmptyNode(ctx, props.end, sep, null, props, onError);
+            coll.items.push(valueNode);
+            offset = valueNode.range[2];
+            if (isBlock$1(value))
+                onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
+        }
+        else {
+            // item is a key+value pair
+            // key value
+            const keyStart = props.end;
+            const keyNode = key
+                ? composeNode(ctx, key, props, onError)
+                : composeEmptyNode(ctx, keyStart, start, null, props, onError);
+            if (isBlock$1(key))
+                onError(keyNode.range, 'BLOCK_IN_FLOW', blockMsg);
+            // value properties
+            const valueProps = resolveProps(sep ?? [], {
+                flow: fcName,
+                indicator: 'map-value-ind',
+                next: value,
+                offset: keyNode.range[2],
+                onError,
+                parentIndent: fc.indent,
+                startOnNewline: false
+            });
+            if (valueProps.found) {
+                if (!isMap && !props.found && ctx.options.strict) {
+                    if (sep)
+                        for (const st of sep) {
+                            if (st === valueProps.found)
+                                break;
+                            if (st.type === 'newline') {
+                                onError(st, 'MULTILINE_IMPLICIT_KEY', 'Implicit keys of flow sequence pairs need to be on a single line');
+                                break;
+                            }
+                        }
+                    if (props.start < valueProps.found.offset - 1024)
+                        onError(valueProps.found, 'KEY_OVER_1024_CHARS', 'The : indicator must be at most 1024 chars after the start of an implicit flow sequence key');
+                }
+            }
+            else if (value) {
+                if ('source' in value && value.source && value.source[0] === ':')
+                    onError(value, 'MISSING_CHAR', `Missing space after : in ${fcName}`);
+                else
+                    onError(valueProps.start, 'MISSING_CHAR', `Missing , or : between ${fcName} items`);
+            }
+            // value value
+            const valueNode = value
+                ? composeNode(ctx, value, valueProps, onError)
+                : valueProps.found
+                    ? composeEmptyNode(ctx, valueProps.end, sep, null, valueProps, onError)
+                    : null;
+            if (valueNode) {
+                if (isBlock$1(value))
+                    onError(valueNode.range, 'BLOCK_IN_FLOW', blockMsg);
+            }
+            else if (valueProps.comment) {
+                if (keyNode.comment)
+                    keyNode.comment += '\n' + valueProps.comment;
+                else
+                    keyNode.comment = valueProps.comment;
+            }
+            const pair = new Pair(keyNode, valueNode);
+            if (ctx.options.keepSourceTokens)
+                pair.srcToken = collItem;
+            if (isMap) {
+                const map = coll;
+                if (mapIncludes(ctx, map.items, keyNode))
+                    onError(keyStart, 'DUPLICATE_KEY', 'Map keys must be unique');
+                map.items.push(pair);
+            }
+            else {
+                const map = new YAMLMap(ctx.schema);
+                map.flow = true;
+                map.items.push(pair);
+                coll.items.push(map);
+            }
+            offset = valueNode ? valueNode.range[2] : valueProps.end;
+        }
+    }
+    const expectedEnd = isMap ? '}' : ']';
+    const [ce, ...ee] = fc.end;
+    let cePos = offset;
+    if (ce && ce.source === expectedEnd)
+        cePos = ce.offset + ce.source.length;
+    else {
+        const name = fcName[0].toUpperCase() + fcName.substring(1);
+        const msg = atRoot
+            ? `${name} must end with a ${expectedEnd}`
+            : `${name} in block collection must be sufficiently indented and end with a ${expectedEnd}`;
+        onError(offset, atRoot ? 'MISSING_CHAR' : 'BAD_INDENT', msg);
+        if (ce && ce.source.length !== 1)
+            ee.unshift(ce);
+    }
+    if (ee.length > 0) {
+        const end = resolveEnd(ee, cePos, ctx.options.strict, onError);
+        if (end.comment) {
+            if (coll.comment)
+                coll.comment += '\n' + end.comment;
+            else
+                coll.comment = end.comment;
+        }
+        coll.range = [fc.offset, cePos, end.offset];
+    }
+    else {
+        coll.range = [fc.offset, cePos, cePos];
+    }
+    return coll;
+}
+
+function resolveCollection(CN, ctx, token, onError, tagName, tag) {
+    const coll = token.type === 'block-map'
+        ? resolveBlockMap(CN, ctx, token, onError, tag)
+        : token.type === 'block-seq'
+            ? resolveBlockSeq(CN, ctx, token, onError, tag)
+            : resolveFlowCollection(CN, ctx, token, onError, tag);
+    const Coll = coll.constructor;
+    // If we got a tagName matching the class, or the tag name is '!',
+    // then use the tagName from the node class used to create it.
+    if (tagName === '!' || tagName === Coll.tagName) {
+        coll.tag = Coll.tagName;
+        return coll;
+    }
+    if (tagName)
+        coll.tag = tagName;
+    return coll;
+}
+function composeCollection(CN, ctx, token, props, onError) {
+    const tagToken = props.tag;
+    const tagName = !tagToken
+        ? null
+        : ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg));
+    if (token.type === 'block-seq') {
+        const { anchor, newlineAfterProp: nl } = props;
+        const lastProp = anchor && tagToken
+            ? anchor.offset > tagToken.offset
+                ? anchor
+                : tagToken
+            : (anchor ?? tagToken);
+        if (lastProp && (!nl || nl.offset < lastProp.offset)) {
+            const message = 'Missing newline after block sequence props';
+            onError(lastProp, 'MISSING_CHAR', message);
+        }
+    }
+    const expType = token.type === 'block-map'
+        ? 'map'
+        : token.type === 'block-seq'
+            ? 'seq'
+            : token.start.source === '{'
+                ? 'map'
+                : 'seq';
+    // shortcut: check if it's a generic YAMLMap or YAMLSeq
+    // before jumping into the custom tag logic.
+    if (!tagToken ||
+        !tagName ||
+        tagName === '!' ||
+        (tagName === YAMLMap.tagName && expType === 'map') ||
+        (tagName === YAMLSeq.tagName && expType === 'seq')) {
+        return resolveCollection(CN, ctx, token, onError, tagName);
+    }
+    let tag = ctx.schema.tags.find(t => t.tag === tagName && t.collection === expType);
+    if (!tag) {
+        const kt = ctx.schema.knownTags[tagName];
+        if (kt && kt.collection === expType) {
+            ctx.schema.tags.push(Object.assign({}, kt, { default: false }));
+            tag = kt;
+        }
+        else {
+            if (kt?.collection) {
+                onError(tagToken, 'BAD_COLLECTION_TYPE', `${kt.tag} used for ${expType} collection, but expects ${kt.collection}`, true);
+            }
+            else {
+                onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, true);
+            }
+            return resolveCollection(CN, ctx, token, onError, tagName);
+        }
+    }
+    const coll = resolveCollection(CN, ctx, token, onError, tagName, tag);
+    const res = tag.resolve?.(coll, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg), ctx.options) ?? coll;
+    const node = isNode$1(res)
+        ? res
+        : new Scalar(res);
+    node.range = coll.range;
+    node.tag = tagName;
+    if (tag?.format)
+        node.format = tag.format;
+    return node;
+}
+
+function resolveBlockScalar(ctx, scalar, onError) {
+    const start = scalar.offset;
+    const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
+    if (!header)
+        return { value: '', type: null, comment: '', range: [start, start, start] };
+    const type = header.mode === '>' ? Scalar.BLOCK_FOLDED : Scalar.BLOCK_LITERAL;
+    const lines = scalar.source ? splitLines(scalar.source) : [];
+    // determine the end of content & start of chomping
+    let chompStart = lines.length;
+    for (let i = lines.length - 1; i >= 0; --i) {
+        const content = lines[i][1];
+        if (content === '' || content === '\r')
+            chompStart = i;
+        else
+            break;
+    }
+    // shortcut for empty contents
+    if (chompStart === 0) {
+        const value = header.chomp === '+' && lines.length > 0
+            ? '\n'.repeat(Math.max(1, lines.length - 1))
+            : '';
+        let end = start + header.length;
+        if (scalar.source)
+            end += scalar.source.length;
+        return { value, type, comment: header.comment, range: [start, end, end] };
+    }
+    // find the indentation level to trim from start
+    let trimIndent = scalar.indent + header.indent;
+    let offset = scalar.offset + header.length;
+    let contentStart = 0;
+    for (let i = 0; i < chompStart; ++i) {
+        const [indent, content] = lines[i];
+        if (content === '' || content === '\r') {
+            if (header.indent === 0 && indent.length > trimIndent)
+                trimIndent = indent.length;
+        }
+        else {
+            if (indent.length < trimIndent) {
+                const message = 'Block scalars with more-indented leading empty lines must use an explicit indentation indicator';
+                onError(offset + indent.length, 'MISSING_CHAR', message);
+            }
+            if (header.indent === 0)
+                trimIndent = indent.length;
+            contentStart = i;
+            if (trimIndent === 0 && !ctx.atRoot) {
+                const message = 'Block scalar values in collections must be indented';
+                onError(offset, 'BAD_INDENT', message);
+            }
+            break;
+        }
+        offset += indent.length + content.length + 1;
+    }
+    // include trailing more-indented empty lines in content
+    for (let i = lines.length - 1; i >= chompStart; --i) {
+        if (lines[i][0].length > trimIndent)
+            chompStart = i + 1;
+    }
+    let value = '';
+    let sep = '';
+    let prevMoreIndented = false;
+    // leading whitespace is kept intact
+    for (let i = 0; i < contentStart; ++i)
+        value += lines[i][0].slice(trimIndent) + '\n';
+    for (let i = contentStart; i < chompStart; ++i) {
+        let [indent, content] = lines[i];
+        offset += indent.length + content.length + 1;
+        const crlf = content[content.length - 1] === '\r';
+        if (crlf)
+            content = content.slice(0, -1);
+        /* istanbul ignore if already caught in lexer */
+        if (content && indent.length < trimIndent) {
+            const src = header.indent
+                ? 'explicit indentation indicator'
+                : 'first line';
+            const message = `Block scalar lines must not be less indented than their ${src}`;
+            onError(offset - content.length - (crlf ? 2 : 1), 'BAD_INDENT', message);
+            indent = '';
+        }
+        if (type === Scalar.BLOCK_LITERAL) {
+            value += sep + indent.slice(trimIndent) + content;
+            sep = '\n';
+        }
+        else if (indent.length > trimIndent || content[0] === '\t') {
+            // more-indented content within a folded block
+            if (sep === ' ')
+                sep = '\n';
+            else if (!prevMoreIndented && sep === '\n')
+                sep = '\n\n';
+            value += sep + indent.slice(trimIndent) + content;
+            sep = '\n';
+            prevMoreIndented = true;
+        }
+        else if (content === '') {
+            // empty line
+            if (sep === '\n')
+                value += '\n';
+            else
+                sep = '\n';
+        }
+        else {
+            value += sep + content;
+            sep = ' ';
+            prevMoreIndented = false;
+        }
+    }
+    switch (header.chomp) {
+        case '-':
+            break;
+        case '+':
+            for (let i = chompStart; i < lines.length; ++i)
+                value += '\n' + lines[i][0].slice(trimIndent);
+            if (value[value.length - 1] !== '\n')
+                value += '\n';
+            break;
+        default:
+            value += '\n';
+    }
+    const end = start + header.length + scalar.source.length;
+    return { value, type, comment: header.comment, range: [start, end, end] };
+}
+function parseBlockScalarHeader({ offset, props }, strict, onError) {
+    /* istanbul ignore if should not happen */
+    if (props[0].type !== 'block-scalar-header') {
+        onError(props[0], 'IMPOSSIBLE', 'Block scalar header not found');
+        return null;
+    }
+    const { source } = props[0];
+    const mode = source[0];
+    let indent = 0;
+    let chomp = '';
+    let error = -1;
+    for (let i = 1; i < source.length; ++i) {
+        const ch = source[i];
+        if (!chomp && (ch === '-' || ch === '+'))
+            chomp = ch;
+        else {
+            const n = Number(ch);
+            if (!indent && n)
+                indent = n;
+            else if (error === -1)
+                error = offset + i;
+        }
+    }
+    if (error !== -1)
+        onError(error, 'UNEXPECTED_TOKEN', `Block scalar header includes extra characters: ${source}`);
+    let hasSpace = false;
+    let comment = '';
+    let length = source.length;
+    for (let i = 1; i < props.length; ++i) {
+        const token = props[i];
+        switch (token.type) {
+            case 'space':
+                hasSpace = true;
+            // fallthrough
+            case 'newline':
+                length += token.source.length;
+                break;
+            case 'comment':
+                if (strict && !hasSpace) {
+                    const message = 'Comments must be separated from other tokens by white space characters';
+                    onError(token, 'MISSING_CHAR', message);
+                }
+                length += token.source.length;
+                comment = token.source.substring(1);
+                break;
+            case 'error':
+                onError(token, 'UNEXPECTED_TOKEN', token.message);
+                length += token.source.length;
+                break;
+            /* istanbul ignore next should not happen */
+            default: {
+                const message = `Unexpected token in block scalar header: ${token.type}`;
+                onError(token, 'UNEXPECTED_TOKEN', message);
+                const ts = token.source;
+                if (ts && typeof ts === 'string')
+                    length += ts.length;
+            }
+        }
+    }
+    return { mode, indent, chomp, comment, length };
+}
+/** @returns Array of lines split up as `[indent, content]` */
+function splitLines(source) {
+    const split = source.split(/\n( *)/);
+    const first = split[0];
+    const m = first.match(/^( *)/);
+    const line0 = m?.[1]
+        ? [m[1], first.slice(m[1].length)]
+        : ['', first];
+    const lines = [line0];
+    for (let i = 1; i < split.length; i += 2)
+        lines.push([split[i], split[i + 1]]);
+    return lines;
+}
+
+function resolveFlowScalar(scalar, strict, onError) {
+    const { offset, type, source, end } = scalar;
+    let _type;
+    let value;
+    const _onError = (rel, code, msg) => onError(offset + rel, code, msg);
+    switch (type) {
+        case 'scalar':
+            _type = Scalar.PLAIN;
+            value = plainValue(source, _onError);
+            break;
+        case 'single-quoted-scalar':
+            _type = Scalar.QUOTE_SINGLE;
+            value = singleQuotedValue(source, _onError);
+            break;
+        case 'double-quoted-scalar':
+            _type = Scalar.QUOTE_DOUBLE;
+            value = doubleQuotedValue(source, _onError);
+            break;
+        /* istanbul ignore next should not happen */
+        default:
+            onError(scalar, 'UNEXPECTED_TOKEN', `Expected a flow scalar value, but found: ${type}`);
+            return {
+                value: '',
+                type: null,
+                comment: '',
+                range: [offset, offset + source.length, offset + source.length]
+            };
+    }
+    const valueEnd = offset + source.length;
+    const re = resolveEnd(end, valueEnd, strict, onError);
+    return {
+        value,
+        type: _type,
+        comment: re.comment,
+        range: [offset, valueEnd, re.offset]
+    };
+}
+function plainValue(source, onError) {
+    let badChar = '';
+    switch (source[0]) {
+        /* istanbul ignore next should not happen */
+        case '\t':
+            badChar = 'a tab character';
+            break;
+        case ',':
+            badChar = 'flow indicator character ,';
+            break;
+        case '%':
+            badChar = 'directive indicator character %';
+            break;
+        case '|':
+        case '>': {
+            badChar = `block scalar indicator ${source[0]}`;
+            break;
+        }
+        case '@':
+        case '`': {
+            badChar = `reserved character ${source[0]}`;
+            break;
+        }
+    }
+    if (badChar)
+        onError(0, 'BAD_SCALAR_START', `Plain value cannot start with ${badChar}`);
+    return foldLines(source);
+}
+function singleQuotedValue(source, onError) {
+    if (source[source.length - 1] !== "'" || source.length === 1)
+        onError(source.length, 'MISSING_CHAR', "Missing closing 'quote");
+    return foldLines(source.slice(1, -1)).replace(/''/g, "'");
+}
+function foldLines(source) {
+    /**
+     * The negative lookbehind here and in the `re` RegExp is to
+     * prevent causing a polynomial search time in certain cases.
+     *
+     * The try-catch is for Safari, which doesn't support this yet:
+     * https://caniuse.com/js-regexp-lookbehind
+     */
+    let first, line;
+    try {
+        first = new RegExp('(.*?)(? wsStart ? source.slice(wsStart, i + 1) : ch;
+        }
+        else {
+            res += ch;
+        }
+    }
+    if (source[source.length - 1] !== '"' || source.length === 1)
+        onError(source.length, 'MISSING_CHAR', 'Missing closing "quote');
+    return res;
+}
+/**
+ * Fold a single newline into a space, multiple newlines to N - 1 newlines.
+ * Presumes `source[offset] === '\n'`
+ */
+function foldNewline(source, offset) {
+    let fold = '';
+    let ch = source[offset + 1];
+    while (ch === ' ' || ch === '\t' || ch === '\n' || ch === '\r') {
+        if (ch === '\r' && source[offset + 2] !== '\n')
+            break;
+        if (ch === '\n')
+            fold += '\n';
+        offset += 1;
+        ch = source[offset + 1];
+    }
+    if (!fold)
+        fold = ' ';
+    return { fold, offset };
+}
+const escapeCodes = {
+    '0': '\0', // null character
+    a: '\x07', // bell character
+    b: '\b', // backspace
+    e: '\x1b', // escape character
+    f: '\f', // form feed
+    n: '\n', // line feed
+    r: '\r', // carriage return
+    t: '\t', // horizontal tab
+    v: '\v', // vertical tab
+    N: '\u0085', // Unicode next line
+    _: '\u00a0', // Unicode non-breaking space
+    L: '\u2028', // Unicode line separator
+    P: '\u2029', // Unicode paragraph separator
+    ' ': ' ',
+    '"': '"',
+    '/': '/',
+    '\\': '\\',
+    '\t': '\t'
+};
+function parseCharCode(source, offset, length, onError) {
+    const cc = source.substr(offset, length);
+    const ok = cc.length === length && /^[0-9a-fA-F]+$/.test(cc);
+    const code = ok ? parseInt(cc, 16) : NaN;
+    if (isNaN(code)) {
+        const raw = source.substr(offset - 2, length + 2);
+        onError(offset - 2, 'BAD_DQ_ESCAPE', `Invalid escape sequence ${raw}`);
+        return raw;
+    }
+    return String.fromCodePoint(code);
+}
+
+function composeScalar(ctx, token, tagToken, onError) {
+    const { value, type, comment, range } = token.type === 'block-scalar'
+        ? resolveBlockScalar(ctx, token, onError)
+        : resolveFlowScalar(token, ctx.options.strict, onError);
+    const tagName = tagToken
+        ? ctx.directives.tagName(tagToken.source, msg => onError(tagToken, 'TAG_RESOLVE_FAILED', msg))
+        : null;
+    const tag = tagToken && tagName
+        ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError)
+        : token.type === 'scalar'
+            ? findScalarTagByTest(ctx, value, token, onError)
+            : ctx.schema[SCALAR$1];
+    let scalar;
+    try {
+        const res = tag.resolve(value, msg => onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg), ctx.options);
+        scalar = isScalar$1(res) ? res : new Scalar(res);
+    }
+    catch (error) {
+        const msg = error instanceof Error ? error.message : String(error);
+        onError(tagToken ?? token, 'TAG_RESOLVE_FAILED', msg);
+        scalar = new Scalar(value);
+    }
+    scalar.range = range;
+    scalar.source = value;
+    if (type)
+        scalar.type = type;
+    if (tagName)
+        scalar.tag = tagName;
+    if (tag.format)
+        scalar.format = tag.format;
+    if (comment)
+        scalar.comment = comment;
+    return scalar;
+}
+function findScalarTagByName(schema, value, tagName, tagToken, onError) {
+    if (tagName === '!')
+        return schema[SCALAR$1]; // non-specific tag
+    const matchWithTest = [];
+    for (const tag of schema.tags) {
+        if (!tag.collection && tag.tag === tagName) {
+            if (tag.default && tag.test)
+                matchWithTest.push(tag);
+            else
+                return tag;
+        }
+    }
+    for (const tag of matchWithTest)
+        if (tag.test?.test(value))
+            return tag;
+    const kt = schema.knownTags[tagName];
+    if (kt && !kt.collection) {
+        // Ensure that the known tag is available for stringifying,
+        // but does not get used by default.
+        schema.tags.push(Object.assign({}, kt, { default: false, test: undefined }));
+        return kt;
+    }
+    onError(tagToken, 'TAG_RESOLVE_FAILED', `Unresolved tag: ${tagName}`, tagName !== 'tag:yaml.org,2002:str');
+    return schema[SCALAR$1];
+}
+function findScalarTagByTest({ directives, schema }, value, token, onError) {
+    const tag = schema.tags.find(tag => tag.default && tag.test?.test(value)) || schema[SCALAR$1];
+    if (schema.compat) {
+        const compat = schema.compat.find(tag => tag.default && tag.test?.test(value)) ??
+            schema[SCALAR$1];
+        if (tag.tag !== compat.tag) {
+            const ts = directives.tagString(tag.tag);
+            const cs = directives.tagString(compat.tag);
+            const msg = `Value may be parsed as either ${ts} or ${cs}`;
+            onError(token, 'TAG_RESOLVE_FAILED', msg, true);
+        }
+    }
+    return tag;
+}
+
+function emptyScalarPosition(offset, before, pos) {
+    if (before) {
+        if (pos === null)
+            pos = before.length;
+        for (let i = pos - 1; i >= 0; --i) {
+            let st = before[i];
+            switch (st.type) {
+                case 'space':
+                case 'comment':
+                case 'newline':
+                    offset -= st.source.length;
+                    continue;
+            }
+            // Technically, an empty scalar is immediately after the last non-empty
+            // node, but it's more useful to place it after any whitespace.
+            st = before[++i];
+            while (st?.type === 'space') {
+                offset += st.source.length;
+                st = before[++i];
+            }
+            break;
+        }
+    }
+    return offset;
+}
+
+const CN = { composeNode, composeEmptyNode };
+function composeNode(ctx, token, props, onError) {
+    const { spaceBefore, comment, anchor, tag } = props;
+    let node;
+    let isSrcToken = true;
+    switch (token.type) {
+        case 'alias':
+            node = composeAlias(ctx, token, onError);
+            if (anchor || tag)
+                onError(token, 'ALIAS_PROPS', 'An alias node must not specify any properties');
+            break;
+        case 'scalar':
+        case 'single-quoted-scalar':
+        case 'double-quoted-scalar':
+        case 'block-scalar':
+            node = composeScalar(ctx, token, tag, onError);
+            if (anchor)
+                node.anchor = anchor.source.substring(1);
+            break;
+        case 'block-map':
+        case 'block-seq':
+        case 'flow-collection':
+            node = composeCollection(CN, ctx, token, props, onError);
+            if (anchor)
+                node.anchor = anchor.source.substring(1);
+            break;
+        default: {
+            const message = token.type === 'error'
+                ? token.message
+                : `Unsupported token (type: ${token.type})`;
+            onError(token, 'UNEXPECTED_TOKEN', message);
+            node = composeEmptyNode(ctx, token.offset, undefined, null, props, onError);
+            isSrcToken = false;
+        }
+    }
+    if (anchor && node.anchor === '')
+        onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
+    if (spaceBefore)
+        node.spaceBefore = true;
+    if (comment) {
+        if (token.type === 'scalar' && token.source === '')
+            node.comment = comment;
+        else
+            node.commentBefore = comment;
+    }
+    // @ts-expect-error Type checking misses meaning of isSrcToken
+    if (ctx.options.keepSourceTokens && isSrcToken)
+        node.srcToken = token;
+    return node;
+}
+function composeEmptyNode(ctx, offset, before, pos, { spaceBefore, comment, anchor, tag, end }, onError) {
+    const token = {
+        type: 'scalar',
+        offset: emptyScalarPosition(offset, before, pos),
+        indent: -1,
+        source: ''
+    };
+    const node = composeScalar(ctx, token, tag, onError);
+    if (anchor) {
+        node.anchor = anchor.source.substring(1);
+        if (node.anchor === '')
+            onError(anchor, 'BAD_ALIAS', 'Anchor cannot be an empty string');
+    }
+    if (spaceBefore)
+        node.spaceBefore = true;
+    if (comment) {
+        node.comment = comment;
+        node.range[2] = end;
+    }
+    return node;
+}
+function composeAlias({ options }, { offset, source, end }, onError) {
+    const alias = new Alias(source.substring(1));
+    if (alias.source === '')
+        onError(offset, 'BAD_ALIAS', 'Alias cannot be an empty string');
+    if (alias.source.endsWith(':'))
+        onError(offset + source.length - 1, 'BAD_ALIAS', 'Alias ending in : is ambiguous', true);
+    const valueEnd = offset + source.length;
+    const re = resolveEnd(end, valueEnd, options.strict, onError);
+    alias.range = [offset, valueEnd, re.offset];
+    if (re.comment)
+        alias.comment = re.comment;
+    return alias;
+}
+
+function composeDoc(options, directives, { offset, start, value, end }, onError) {
+    const opts = Object.assign({ _directives: directives }, options);
+    const doc = new Document(undefined, opts);
+    const ctx = {
+        atRoot: true,
+        directives: doc.directives,
+        options: doc.options,
+        schema: doc.schema
+    };
+    const props = resolveProps(start, {
+        indicator: 'doc-start',
+        next: value ?? end?.[0],
+        offset,
+        onError,
+        parentIndent: 0,
+        startOnNewline: true
+    });
+    if (props.found) {
+        doc.directives.docStart = true;
+        if (value &&
+            (value.type === 'block-map' || value.type === 'block-seq') &&
+            !props.hasNewline)
+            onError(props.end, 'MISSING_CHAR', 'Block collection cannot start on same line with directives-end marker');
+    }
+    // @ts-expect-error If Contents is set, let's trust the user
+    doc.contents = value
+        ? composeNode(ctx, value, props, onError)
+        : composeEmptyNode(ctx, props.end, start, null, props, onError);
+    const contentEnd = doc.contents.range[2];
+    const re = resolveEnd(end, contentEnd, false, onError);
+    if (re.comment)
+        doc.comment = re.comment;
+    doc.range = [offset, contentEnd, re.offset];
+    return doc;
+}
+
+function getErrorPos(src) {
+    if (typeof src === 'number')
+        return [src, src + 1];
+    if (Array.isArray(src))
+        return src.length === 2 ? src : [src[0], src[1]];
+    const { offset, source } = src;
+    return [offset, offset + (typeof source === 'string' ? source.length : 1)];
+}
+function parsePrelude(prelude) {
+    let comment = '';
+    let atComment = false;
+    let afterEmptyLine = false;
+    for (let i = 0; i < prelude.length; ++i) {
+        const source = prelude[i];
+        switch (source[0]) {
+            case '#':
+                comment +=
+                    (comment === '' ? '' : afterEmptyLine ? '\n\n' : '\n') +
+                        (source.substring(1) || ' ');
+                atComment = true;
+                afterEmptyLine = false;
+                break;
+            case '%':
+                if (prelude[i + 1]?.[0] !== '#')
+                    i += 1;
+                atComment = false;
+                break;
+            default:
+                // This may be wrong after doc-end, but in that case it doesn't matter
+                if (!atComment)
+                    afterEmptyLine = true;
+                atComment = false;
+        }
+    }
+    return { comment, afterEmptyLine };
+}
+/**
+ * Compose a stream of CST nodes into a stream of YAML Documents.
+ *
+ * ```ts
+ * import { Composer, Parser } from 'yaml'
+ *
+ * const src: string = ...
+ * const tokens = new Parser().parse(src)
+ * const docs = new Composer().compose(tokens)
+ * ```
+ */
+class Composer {
+    constructor(options = {}) {
+        this.doc = null;
+        this.atDirectives = false;
+        this.prelude = [];
+        this.errors = [];
+        this.warnings = [];
+        this.onError = (source, code, message, warning) => {
+            const pos = getErrorPos(source);
+            if (warning)
+                this.warnings.push(new YAMLWarning(pos, code, message));
+            else
+                this.errors.push(new YAMLParseError(pos, code, message));
+        };
+        // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
+        this.directives = new Directives({ version: options.version || '1.2' });
+        this.options = options;
+    }
+    decorate(doc, afterDoc) {
+        const { comment, afterEmptyLine } = parsePrelude(this.prelude);
+        //console.log({ dc: doc.comment, prelude, comment })
+        if (comment) {
+            const dc = doc.contents;
+            if (afterDoc) {
+                doc.comment = doc.comment ? `${doc.comment}\n${comment}` : comment;
+            }
+            else if (afterEmptyLine || doc.directives.docStart || !dc) {
+                doc.commentBefore = comment;
+            }
+            else if (isCollection$1(dc) && !dc.flow && dc.items.length > 0) {
+                let it = dc.items[0];
+                if (isPair(it))
+                    it = it.key;
+                const cb = it.commentBefore;
+                it.commentBefore = cb ? `${comment}\n${cb}` : comment;
+            }
+            else {
+                const cb = dc.commentBefore;
+                dc.commentBefore = cb ? `${comment}\n${cb}` : comment;
+            }
+        }
+        if (afterDoc) {
+            Array.prototype.push.apply(doc.errors, this.errors);
+            Array.prototype.push.apply(doc.warnings, this.warnings);
+        }
+        else {
+            doc.errors = this.errors;
+            doc.warnings = this.warnings;
+        }
+        this.prelude = [];
+        this.errors = [];
+        this.warnings = [];
+    }
+    /**
+     * Current stream status information.
+     *
+     * Mostly useful at the end of input for an empty stream.
+     */
+    streamInfo() {
+        return {
+            comment: parsePrelude(this.prelude).comment,
+            directives: this.directives,
+            errors: this.errors,
+            warnings: this.warnings
+        };
+    }
+    /**
+     * Compose tokens into documents.
+     *
+     * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
+     * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
+     */
+    *compose(tokens, forceDoc = false, endOffset = -1) {
+        for (const token of tokens)
+            yield* this.next(token);
+        yield* this.end(forceDoc, endOffset);
+    }
+    /** Advance the composer by one CST token. */
+    *next(token) {
+        switch (token.type) {
+            case 'directive':
+                this.directives.add(token.source, (offset, message, warning) => {
+                    const pos = getErrorPos(token);
+                    pos[0] += offset;
+                    this.onError(pos, 'BAD_DIRECTIVE', message, warning);
+                });
+                this.prelude.push(token.source);
+                this.atDirectives = true;
+                break;
+            case 'document': {
+                const doc = composeDoc(this.options, this.directives, token, this.onError);
+                if (this.atDirectives && !doc.directives.docStart)
+                    this.onError(token, 'MISSING_CHAR', 'Missing directives-end/doc-start indicator line');
+                this.decorate(doc, false);
+                if (this.doc)
+                    yield this.doc;
+                this.doc = doc;
+                this.atDirectives = false;
+                break;
+            }
+            case 'byte-order-mark':
+            case 'space':
+                break;
+            case 'comment':
+            case 'newline':
+                this.prelude.push(token.source);
+                break;
+            case 'error': {
+                const msg = token.source
+                    ? `${token.message}: ${JSON.stringify(token.source)}`
+                    : token.message;
+                const error = new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg);
+                if (this.atDirectives || !this.doc)
+                    this.errors.push(error);
+                else
+                    this.doc.errors.push(error);
+                break;
+            }
+            case 'doc-end': {
+                if (!this.doc) {
+                    const msg = 'Unexpected doc-end without preceding document';
+                    this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', msg));
+                    break;
+                }
+                this.doc.directives.docEnd = true;
+                const end = resolveEnd(token.end, token.offset + token.source.length, this.doc.options.strict, this.onError);
+                this.decorate(this.doc, true);
+                if (end.comment) {
+                    const dc = this.doc.comment;
+                    this.doc.comment = dc ? `${dc}\n${end.comment}` : end.comment;
+                }
+                this.doc.range[2] = end.offset;
+                break;
+            }
+            default:
+                this.errors.push(new YAMLParseError(getErrorPos(token), 'UNEXPECTED_TOKEN', `Unsupported token ${token.type}`));
+        }
+    }
+    /**
+     * Call at end of input to yield any remaining document.
+     *
+     * @param forceDoc - If the stream contains no document, still emit a final document including any comments and directives that would be applied to a subsequent document.
+     * @param endOffset - Should be set if `forceDoc` is also set, to set the document range end and to indicate errors correctly.
+     */
+    *end(forceDoc = false, endOffset = -1) {
+        if (this.doc) {
+            this.decorate(this.doc, true);
+            yield this.doc;
+            this.doc = null;
+        }
+        else if (forceDoc) {
+            const opts = Object.assign({ _directives: this.directives }, this.options);
+            const doc = new Document(undefined, opts);
+            if (this.atDirectives)
+                this.onError(endOffset, 'MISSING_CHAR', 'Missing directives-end indicator line');
+            doc.range = [0, endOffset, endOffset];
+            this.decorate(doc, false);
+            yield doc;
+        }
+    }
+}
+
+function resolveAsScalar(token, strict = true, onError) {
+    if (token) {
+        const _onError = (pos, code, message) => {
+            const offset = typeof pos === 'number' ? pos : Array.isArray(pos) ? pos[0] : pos.offset;
+            if (onError)
+                onError(offset, code, message);
+            else
+                throw new YAMLParseError([offset, offset + 1], code, message);
+        };
+        switch (token.type) {
+            case 'scalar':
+            case 'single-quoted-scalar':
+            case 'double-quoted-scalar':
+                return resolveFlowScalar(token, strict, _onError);
+            case 'block-scalar':
+                return resolveBlockScalar({ options: { strict } }, token, _onError);
+        }
+    }
+    return null;
+}
+/**
+ * Create a new scalar token with `value`
+ *
+ * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
+ * as this function does not support any schema operations and won't check for such conflicts.
+ *
+ * @param value The string representation of the value, which will have its content properly indented.
+ * @param context.end Comments and whitespace after the end of the value, or after the block scalar header. If undefined, a newline will be added.
+ * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
+ * @param context.indent The indent level of the token.
+ * @param context.inFlow Is this scalar within a flow collection? This may affect the resolved type of the token's value.
+ * @param context.offset The offset position of the token.
+ * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
+ */
+function createScalarToken(value, context) {
+    const { implicitKey = false, indent, inFlow = false, offset = -1, type = 'PLAIN' } = context;
+    const source = stringifyString({ type, value }, {
+        implicitKey,
+        indent: indent > 0 ? ' '.repeat(indent) : '',
+        inFlow,
+        options: { blockQuote: true, lineWidth: -1 }
+    });
+    const end = context.end ?? [
+        { type: 'newline', offset: -1, indent, source: '\n' }
+    ];
+    switch (source[0]) {
+        case '|':
+        case '>': {
+            const he = source.indexOf('\n');
+            const head = source.substring(0, he);
+            const body = source.substring(he + 1) + '\n';
+            const props = [
+                { type: 'block-scalar-header', offset, indent, source: head }
+            ];
+            if (!addEndtoBlockProps(props, end))
+                props.push({ type: 'newline', offset: -1, indent, source: '\n' });
+            return { type: 'block-scalar', offset, indent, props, source: body };
+        }
+        case '"':
+            return { type: 'double-quoted-scalar', offset, indent, source, end };
+        case "'":
+            return { type: 'single-quoted-scalar', offset, indent, source, end };
+        default:
+            return { type: 'scalar', offset, indent, source, end };
+    }
+}
+/**
+ * Set the value of `token` to the given string `value`, overwriting any previous contents and type that it may have.
+ *
+ * Best efforts are made to retain any comments previously associated with the `token`,
+ * though all contents within a collection's `items` will be overwritten.
+ *
+ * Values that represent an actual string but may be parsed as a different type should use a `type` other than `'PLAIN'`,
+ * as this function does not support any schema operations and won't check for such conflicts.
+ *
+ * @param token Any token. If it does not include an `indent` value, the value will be stringified as if it were an implicit key.
+ * @param value The string representation of the value, which will have its content properly indented.
+ * @param context.afterKey In most cases, values after a key should have an additional level of indentation.
+ * @param context.implicitKey Being within an implicit key may affect the resolved type of the token's value.
+ * @param context.inFlow Being within a flow collection may affect the resolved type of the token's value.
+ * @param context.type The preferred type of the scalar token. If undefined, the previous type of the `token` will be used, defaulting to `'PLAIN'`.
+ */
+function setScalarValue(token, value, context = {}) {
+    let { afterKey = false, implicitKey = false, inFlow = false, type } = context;
+    let indent = 'indent' in token ? token.indent : null;
+    if (afterKey && typeof indent === 'number')
+        indent += 2;
+    if (!type)
+        switch (token.type) {
+            case 'single-quoted-scalar':
+                type = 'QUOTE_SINGLE';
+                break;
+            case 'double-quoted-scalar':
+                type = 'QUOTE_DOUBLE';
+                break;
+            case 'block-scalar': {
+                const header = token.props[0];
+                if (header.type !== 'block-scalar-header')
+                    throw new Error('Invalid block scalar header');
+                type = header.source[0] === '>' ? 'BLOCK_FOLDED' : 'BLOCK_LITERAL';
+                break;
+            }
+            default:
+                type = 'PLAIN';
+        }
+    const source = stringifyString({ type, value }, {
+        implicitKey: implicitKey || indent === null,
+        indent: indent !== null && indent > 0 ? ' '.repeat(indent) : '',
+        inFlow,
+        options: { blockQuote: true, lineWidth: -1 }
+    });
+    switch (source[0]) {
+        case '|':
+        case '>':
+            setBlockScalarValue(token, source);
+            break;
+        case '"':
+            setFlowScalarValue(token, source, 'double-quoted-scalar');
+            break;
+        case "'":
+            setFlowScalarValue(token, source, 'single-quoted-scalar');
+            break;
+        default:
+            setFlowScalarValue(token, source, 'scalar');
+    }
+}
+function setBlockScalarValue(token, source) {
+    const he = source.indexOf('\n');
+    const head = source.substring(0, he);
+    const body = source.substring(he + 1) + '\n';
+    if (token.type === 'block-scalar') {
+        const header = token.props[0];
+        if (header.type !== 'block-scalar-header')
+            throw new Error('Invalid block scalar header');
+        header.source = head;
+        token.source = body;
+    }
+    else {
+        const { offset } = token;
+        const indent = 'indent' in token ? token.indent : -1;
+        const props = [
+            { type: 'block-scalar-header', offset, indent, source: head }
+        ];
+        if (!addEndtoBlockProps(props, 'end' in token ? token.end : undefined))
+            props.push({ type: 'newline', offset: -1, indent, source: '\n' });
+        for (const key of Object.keys(token))
+            if (key !== 'type' && key !== 'offset')
+                delete token[key];
+        Object.assign(token, { type: 'block-scalar', indent, props, source: body });
+    }
+}
+/** @returns `true` if last token is a newline */
+function addEndtoBlockProps(props, end) {
+    if (end)
+        for (const st of end)
+            switch (st.type) {
+                case 'space':
+                case 'comment':
+                    props.push(st);
+                    break;
+                case 'newline':
+                    props.push(st);
+                    return true;
+            }
+    return false;
+}
+function setFlowScalarValue(token, source, type) {
+    switch (token.type) {
+        case 'scalar':
+        case 'double-quoted-scalar':
+        case 'single-quoted-scalar':
+            token.type = type;
+            token.source = source;
+            break;
+        case 'block-scalar': {
+            const end = token.props.slice(1);
+            let oa = source.length;
+            if (token.props[0].type === 'block-scalar-header')
+                oa -= token.props[0].source.length;
+            for (const tok of end)
+                tok.offset += oa;
+            delete token.props;
+            Object.assign(token, { type, source, end });
+            break;
+        }
+        case 'block-map':
+        case 'block-seq': {
+            const offset = token.offset + source.length;
+            const nl = { type: 'newline', offset, indent: token.indent, source: '\n' };
+            delete token.items;
+            Object.assign(token, { type, source, end: [nl] });
+            break;
+        }
+        default: {
+            const indent = 'indent' in token ? token.indent : -1;
+            const end = 'end' in token && Array.isArray(token.end)
+                ? token.end.filter(st => st.type === 'space' ||
+                    st.type === 'comment' ||
+                    st.type === 'newline')
+                : [];
+            for (const key of Object.keys(token))
+                if (key !== 'type' && key !== 'offset')
+                    delete token[key];
+            Object.assign(token, { type, indent, source, end });
+        }
+    }
+}
+
+/**
+ * Stringify a CST document, token, or collection item
+ *
+ * Fair warning: This applies no validation whatsoever, and
+ * simply concatenates the sources in their logical order.
+ */
+const stringify$1 = (cst) => 'type' in cst ? stringifyToken(cst) : stringifyItem(cst);
+function stringifyToken(token) {
+    switch (token.type) {
+        case 'block-scalar': {
+            let res = '';
+            for (const tok of token.props)
+                res += stringifyToken(tok);
+            return res + token.source;
+        }
+        case 'block-map':
+        case 'block-seq': {
+            let res = '';
+            for (const item of token.items)
+                res += stringifyItem(item);
+            return res;
+        }
+        case 'flow-collection': {
+            let res = token.start.source;
+            for (const item of token.items)
+                res += stringifyItem(item);
+            for (const st of token.end)
+                res += st.source;
+            return res;
+        }
+        case 'document': {
+            let res = stringifyItem(token);
+            if (token.end)
+                for (const st of token.end)
+                    res += st.source;
+            return res;
+        }
+        default: {
+            let res = token.source;
+            if ('end' in token && token.end)
+                for (const st of token.end)
+                    res += st.source;
+            return res;
+        }
+    }
+}
+function stringifyItem({ start, key, sep, value }) {
+    let res = '';
+    for (const st of start)
+        res += st.source;
+    if (key)
+        res += stringifyToken(key);
+    if (sep)
+        for (const st of sep)
+            res += st.source;
+    if (value)
+        res += stringifyToken(value);
+    return res;
+}
+
+const BREAK = Symbol('break visit');
+const SKIP = Symbol('skip children');
+const REMOVE = Symbol('remove item');
+/**
+ * Apply a visitor to a CST document or item.
+ *
+ * Walks through the tree (depth-first) starting from the root, calling a
+ * `visitor` function with two arguments when entering each item:
+ *   - `item`: The current item, which included the following members:
+ *     - `start: SourceToken[]` – Source tokens before the key or value,
+ *       possibly including its anchor or tag.
+ *     - `key?: Token | null` – Set for pair values. May then be `null`, if
+ *       the key before the `:` separator is empty.
+ *     - `sep?: SourceToken[]` – Source tokens between the key and the value,
+ *       which should include the `:` map value indicator if `value` is set.
+ *     - `value?: Token` – The value of a sequence item, or of a map pair.
+ *   - `path`: The steps from the root to the current node, as an array of
+ *     `['key' | 'value', number]` tuples.
+ *
+ * The return value of the visitor may be used to control the traversal:
+ *   - `undefined` (default): Do nothing and continue
+ *   - `visit.SKIP`: Do not visit the children of this token, continue with
+ *      next sibling
+ *   - `visit.BREAK`: Terminate traversal completely
+ *   - `visit.REMOVE`: Remove the current item, then continue with the next one
+ *   - `number`: Set the index of the next step. This is useful especially if
+ *     the index of the current token has changed.
+ *   - `function`: Define the next visitor for this item. After the original
+ *     visitor is called on item entry, next visitors are called after handling
+ *     a non-empty `key` and when exiting the item.
+ */
+function visit(cst, visitor) {
+    if ('type' in cst && cst.type === 'document')
+        cst = { start: cst.start, value: cst.value };
+    _visit(Object.freeze([]), cst, visitor);
+}
+// Without the `as symbol` casts, TS declares these in the `visit`
+// namespace using `var`, but then complains about that because
+// `unique symbol` must be `const`.
+/** Terminate visit traversal completely */
+visit.BREAK = BREAK;
+/** Do not visit the children of the current item */
+visit.SKIP = SKIP;
+/** Remove the current item */
+visit.REMOVE = REMOVE;
+/** Find the item at `path` from `cst` as the root */
+visit.itemAtPath = (cst, path) => {
+    let item = cst;
+    for (const [field, index] of path) {
+        const tok = item?.[field];
+        if (tok && 'items' in tok) {
+            item = tok.items[index];
+        }
+        else
+            return undefined;
+    }
+    return item;
+};
+/**
+ * Get the immediate parent collection of the item at `path` from `cst` as the root.
+ *
+ * Throws an error if the collection is not found, which should never happen if the item itself exists.
+ */
+visit.parentCollection = (cst, path) => {
+    const parent = visit.itemAtPath(cst, path.slice(0, -1));
+    const field = path[path.length - 1][0];
+    const coll = parent?.[field];
+    if (coll && 'items' in coll)
+        return coll;
+    throw new Error('Parent collection not found');
+};
+function _visit(path, item, visitor) {
+    let ctrl = visitor(item, path);
+    if (typeof ctrl === 'symbol')
+        return ctrl;
+    for (const field of ['key', 'value']) {
+        const token = item[field];
+        if (token && 'items' in token) {
+            for (let i = 0; i < token.items.length; ++i) {
+                const ci = _visit(Object.freeze(path.concat([[field, i]])), token.items[i], visitor);
+                if (typeof ci === 'number')
+                    i = ci - 1;
+                else if (ci === BREAK)
+                    return BREAK;
+                else if (ci === REMOVE) {
+                    token.items.splice(i, 1);
+                    i -= 1;
+                }
+            }
+            if (typeof ctrl === 'function' && field === 'key')
+                ctrl = ctrl(item, path);
+        }
+    }
+    return typeof ctrl === 'function' ? ctrl(item, path) : ctrl;
+}
+
+/** The byte order mark */
+const BOM = '\u{FEFF}';
+/** Start of doc-mode */
+const DOCUMENT = '\x02'; // C0: Start of Text
+/** Unexpected end of flow-mode */
+const FLOW_END = '\x18'; // C0: Cancel
+/** Next token is a scalar value */
+const SCALAR = '\x1f'; // C0: Unit Separator
+/** @returns `true` if `token` is a flow or block collection */
+const isCollection = (token) => !!token && 'items' in token;
+/** @returns `true` if `token` is a flow or block scalar; not an alias */
+const isScalar = (token) => !!token &&
+    (token.type === 'scalar' ||
+        token.type === 'single-quoted-scalar' ||
+        token.type === 'double-quoted-scalar' ||
+        token.type === 'block-scalar');
+/* istanbul ignore next */
+/** Get a printable representation of a lexer token */
+function prettyToken(token) {
+    switch (token) {
+        case BOM:
+            return '';
+        case DOCUMENT:
+            return '';
+        case FLOW_END:
+            return '';
+        case SCALAR:
+            return '';
+        default:
+            return JSON.stringify(token);
+    }
+}
+/** Identify the type of a lexer token. May return `null` for unknown tokens. */
+function tokenType(source) {
+    switch (source) {
+        case BOM:
+            return 'byte-order-mark';
+        case DOCUMENT:
+            return 'doc-mode';
+        case FLOW_END:
+            return 'flow-error-end';
+        case SCALAR:
+            return 'scalar';
+        case '---':
+            return 'doc-start';
+        case '...':
+            return 'doc-end';
+        case '':
+        case '\n':
+        case '\r\n':
+            return 'newline';
+        case '-':
+            return 'seq-item-ind';
+        case '?':
+            return 'explicit-key-ind';
+        case ':':
+            return 'map-value-ind';
+        case '{':
+            return 'flow-map-start';
+        case '}':
+            return 'flow-map-end';
+        case '[':
+            return 'flow-seq-start';
+        case ']':
+            return 'flow-seq-end';
+        case ',':
+            return 'comma';
+    }
+    switch (source[0]) {
+        case ' ':
+        case '\t':
+            return 'space';
+        case '#':
+            return 'comment';
+        case '%':
+            return 'directive-line';
+        case '*':
+            return 'alias';
+        case '&':
+            return 'anchor';
+        case '!':
+            return 'tag';
+        case "'":
+            return 'single-quoted-scalar';
+        case '"':
+            return 'double-quoted-scalar';
+        case '|':
+        case '>':
+            return 'block-scalar-header';
+    }
+    return null;
+}
+
+var cst = {
+	__proto__: null,
+	BOM: BOM,
+	DOCUMENT: DOCUMENT,
+	FLOW_END: FLOW_END,
+	SCALAR: SCALAR,
+	createScalarToken: createScalarToken,
+	isCollection: isCollection,
+	isScalar: isScalar,
+	prettyToken: prettyToken,
+	resolveAsScalar: resolveAsScalar,
+	setScalarValue: setScalarValue,
+	stringify: stringify$1,
+	tokenType: tokenType,
+	visit: visit
+};
+
+/*
+START -> stream
+
+stream
+  directive -> line-end -> stream
+  indent + line-end -> stream
+  [else] -> line-start
+
+line-end
+  comment -> line-end
+  newline -> .
+  input-end -> END
+
+line-start
+  doc-start -> doc
+  doc-end -> stream
+  [else] -> indent -> block-start
+
+block-start
+  seq-item-start -> block-start
+  explicit-key-start -> block-start
+  map-value-start -> block-start
+  [else] -> doc
+
+doc
+  line-end -> line-start
+  spaces -> doc
+  anchor -> doc
+  tag -> doc
+  flow-start -> flow -> doc
+  flow-end -> error -> doc
+  seq-item-start -> error -> doc
+  explicit-key-start -> error -> doc
+  map-value-start -> doc
+  alias -> doc
+  quote-start -> quoted-scalar -> doc
+  block-scalar-header -> line-end -> block-scalar(min) -> line-start
+  [else] -> plain-scalar(false, min) -> doc
+
+flow
+  line-end -> flow
+  spaces -> flow
+  anchor -> flow
+  tag -> flow
+  flow-start -> flow -> flow
+  flow-end -> .
+  seq-item-start -> error -> flow
+  explicit-key-start -> flow
+  map-value-start -> flow
+  alias -> flow
+  quote-start -> quoted-scalar -> flow
+  comma -> flow
+  [else] -> plain-scalar(true, 0) -> flow
+
+quoted-scalar
+  quote-end -> .
+  [else] -> quoted-scalar
+
+block-scalar(min)
+  newline + peek(indent < min) -> .
+  [else] -> block-scalar(min)
+
+plain-scalar(is-flow, min)
+  scalar-end(is-flow) -> .
+  peek(newline + (indent < min)) -> .
+  [else] -> plain-scalar(min)
+*/
+function isEmpty(ch) {
+    switch (ch) {
+        case undefined:
+        case ' ':
+        case '\n':
+        case '\r':
+        case '\t':
+            return true;
+        default:
+            return false;
+    }
+}
+const hexDigits = new Set('0123456789ABCDEFabcdef');
+const tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
+const flowIndicatorChars = new Set(',[]{}');
+const invalidAnchorChars = new Set(' ,[]{}\n\r\t');
+const isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
+/**
+ * Splits an input string into lexical tokens, i.e. smaller strings that are
+ * easily identifiable by `tokens.tokenType()`.
+ *
+ * Lexing starts always in a "stream" context. Incomplete input may be buffered
+ * until a complete token can be emitted.
+ *
+ * In addition to slices of the original input, the following control characters
+ * may also be emitted:
+ *
+ * - `\x02` (Start of Text): A document starts with the next token
+ * - `\x18` (Cancel): Unexpected end of flow-mode (indicates an error)
+ * - `\x1f` (Unit Separator): Next token is a scalar value
+ * - `\u{FEFF}` (Byte order mark): Emitted separately outside documents
+ */
+class Lexer {
+    constructor() {
+        /**
+         * Flag indicating whether the end of the current buffer marks the end of
+         * all input
+         */
+        this.atEnd = false;
+        /**
+         * Explicit indent set in block scalar header, as an offset from the current
+         * minimum indent, so e.g. set to 1 from a header `|2+`. Set to -1 if not
+         * explicitly set.
+         */
+        this.blockScalarIndent = -1;
+        /**
+         * Block scalars that include a + (keep) chomping indicator in their header
+         * include trailing empty lines, which are otherwise excluded from the
+         * scalar's contents.
+         */
+        this.blockScalarKeep = false;
+        /** Current input */
+        this.buffer = '';
+        /**
+         * Flag noting whether the map value indicator : can immediately follow this
+         * node within a flow context.
+         */
+        this.flowKey = false;
+        /** Count of surrounding flow collection levels. */
+        this.flowLevel = 0;
+        /**
+         * Minimum level of indentation required for next lines to be parsed as a
+         * part of the current scalar value.
+         */
+        this.indentNext = 0;
+        /** Indentation level of the current line. */
+        this.indentValue = 0;
+        /** Position of the next \n character. */
+        this.lineEndPos = null;
+        /** Stores the state of the lexer if reaching the end of incpomplete input */
+        this.next = null;
+        /** A pointer to `buffer`; the current position of the lexer. */
+        this.pos = 0;
+    }
+    /**
+     * Generate YAML tokens from the `source` string. If `incomplete`,
+     * a part of the last line may be left as a buffer for the next call.
+     *
+     * @returns A generator of lexical tokens
+     */
+    *lex(source, incomplete = false) {
+        if (source) {
+            if (typeof source !== 'string')
+                throw TypeError('source is not a string');
+            this.buffer = this.buffer ? this.buffer + source : source;
+            this.lineEndPos = null;
+        }
+        this.atEnd = !incomplete;
+        let next = this.next ?? 'stream';
+        while (next && (incomplete || this.hasChars(1)))
+            next = yield* this.parseNext(next);
+    }
+    atLineEnd() {
+        let i = this.pos;
+        let ch = this.buffer[i];
+        while (ch === ' ' || ch === '\t')
+            ch = this.buffer[++i];
+        if (!ch || ch === '#' || ch === '\n')
+            return true;
+        if (ch === '\r')
+            return this.buffer[i + 1] === '\n';
+        return false;
+    }
+    charAt(n) {
+        return this.buffer[this.pos + n];
+    }
+    continueScalar(offset) {
+        let ch = this.buffer[offset];
+        if (this.indentNext > 0) {
+            let indent = 0;
+            while (ch === ' ')
+                ch = this.buffer[++indent + offset];
+            if (ch === '\r') {
+                const next = this.buffer[indent + offset + 1];
+                if (next === '\n' || (!next && !this.atEnd))
+                    return offset + indent + 1;
+            }
+            return ch === '\n' || indent >= this.indentNext || (!ch && !this.atEnd)
+                ? offset + indent
+                : -1;
+        }
+        if (ch === '-' || ch === '.') {
+            const dt = this.buffer.substr(offset, 3);
+            if ((dt === '---' || dt === '...') && isEmpty(this.buffer[offset + 3]))
+                return -1;
+        }
+        return offset;
+    }
+    getLine() {
+        let end = this.lineEndPos;
+        if (typeof end !== 'number' || (end !== -1 && end < this.pos)) {
+            end = this.buffer.indexOf('\n', this.pos);
+            this.lineEndPos = end;
+        }
+        if (end === -1)
+            return this.atEnd ? this.buffer.substring(this.pos) : null;
+        if (this.buffer[end - 1] === '\r')
+            end -= 1;
+        return this.buffer.substring(this.pos, end);
+    }
+    hasChars(n) {
+        return this.pos + n <= this.buffer.length;
+    }
+    setNext(state) {
+        this.buffer = this.buffer.substring(this.pos);
+        this.pos = 0;
+        this.lineEndPos = null;
+        this.next = state;
+        return null;
+    }
+    peek(n) {
+        return this.buffer.substr(this.pos, n);
+    }
+    *parseNext(next) {
+        switch (next) {
+            case 'stream':
+                return yield* this.parseStream();
+            case 'line-start':
+                return yield* this.parseLineStart();
+            case 'block-start':
+                return yield* this.parseBlockStart();
+            case 'doc':
+                return yield* this.parseDocument();
+            case 'flow':
+                return yield* this.parseFlowCollection();
+            case 'quoted-scalar':
+                return yield* this.parseQuotedScalar();
+            case 'block-scalar':
+                return yield* this.parseBlockScalar();
+            case 'plain-scalar':
+                return yield* this.parsePlainScalar();
+        }
+    }
+    *parseStream() {
+        let line = this.getLine();
+        if (line === null)
+            return this.setNext('stream');
+        if (line[0] === BOM) {
+            yield* this.pushCount(1);
+            line = line.substring(1);
+        }
+        if (line[0] === '%') {
+            let dirEnd = line.length;
+            let cs = line.indexOf('#');
+            while (cs !== -1) {
+                const ch = line[cs - 1];
+                if (ch === ' ' || ch === '\t') {
+                    dirEnd = cs - 1;
+                    break;
+                }
+                else {
+                    cs = line.indexOf('#', cs + 1);
+                }
+            }
+            while (true) {
+                const ch = line[dirEnd - 1];
+                if (ch === ' ' || ch === '\t')
+                    dirEnd -= 1;
+                else
+                    break;
+            }
+            const n = (yield* this.pushCount(dirEnd)) + (yield* this.pushSpaces(true));
+            yield* this.pushCount(line.length - n); // possible comment
+            this.pushNewline();
+            return 'stream';
+        }
+        if (this.atLineEnd()) {
+            const sp = yield* this.pushSpaces(true);
+            yield* this.pushCount(line.length - sp);
+            yield* this.pushNewline();
+            return 'stream';
+        }
+        yield DOCUMENT;
+        return yield* this.parseLineStart();
+    }
+    *parseLineStart() {
+        const ch = this.charAt(0);
+        if (!ch && !this.atEnd)
+            return this.setNext('line-start');
+        if (ch === '-' || ch === '.') {
+            if (!this.atEnd && !this.hasChars(4))
+                return this.setNext('line-start');
+            const s = this.peek(3);
+            if ((s === '---' || s === '...') && isEmpty(this.charAt(3))) {
+                yield* this.pushCount(3);
+                this.indentValue = 0;
+                this.indentNext = 0;
+                return s === '---' ? 'doc' : 'stream';
+            }
+        }
+        this.indentValue = yield* this.pushSpaces(false);
+        if (this.indentNext > this.indentValue && !isEmpty(this.charAt(1)))
+            this.indentNext = this.indentValue;
+        return yield* this.parseBlockStart();
+    }
+    *parseBlockStart() {
+        const [ch0, ch1] = this.peek(2);
+        if (!ch1 && !this.atEnd)
+            return this.setNext('block-start');
+        if ((ch0 === '-' || ch0 === '?' || ch0 === ':') && isEmpty(ch1)) {
+            const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
+            this.indentNext = this.indentValue + 1;
+            this.indentValue += n;
+            return yield* this.parseBlockStart();
+        }
+        return 'doc';
+    }
+    *parseDocument() {
+        yield* this.pushSpaces(true);
+        const line = this.getLine();
+        if (line === null)
+            return this.setNext('doc');
+        let n = yield* this.pushIndicators();
+        switch (line[n]) {
+            case '#':
+                yield* this.pushCount(line.length - n);
+            // fallthrough
+            case undefined:
+                yield* this.pushNewline();
+                return yield* this.parseLineStart();
+            case '{':
+            case '[':
+                yield* this.pushCount(1);
+                this.flowKey = false;
+                this.flowLevel = 1;
+                return 'flow';
+            case '}':
+            case ']':
+                // this is an error
+                yield* this.pushCount(1);
+                return 'doc';
+            case '*':
+                yield* this.pushUntil(isNotAnchorChar);
+                return 'doc';
+            case '"':
+            case "'":
+                return yield* this.parseQuotedScalar();
+            case '|':
+            case '>':
+                n += yield* this.parseBlockScalarHeader();
+                n += yield* this.pushSpaces(true);
+                yield* this.pushCount(line.length - n);
+                yield* this.pushNewline();
+                return yield* this.parseBlockScalar();
+            default:
+                return yield* this.parsePlainScalar();
+        }
+    }
+    *parseFlowCollection() {
+        let nl, sp;
+        let indent = -1;
+        do {
+            nl = yield* this.pushNewline();
+            if (nl > 0) {
+                sp = yield* this.pushSpaces(false);
+                this.indentValue = indent = sp;
+            }
+            else {
+                sp = 0;
+            }
+            sp += yield* this.pushSpaces(true);
+        } while (nl + sp > 0);
+        const line = this.getLine();
+        if (line === null)
+            return this.setNext('flow');
+        if ((indent !== -1 && indent < this.indentNext && line[0] !== '#') ||
+            (indent === 0 &&
+                (line.startsWith('---') || line.startsWith('...')) &&
+                isEmpty(line[3]))) {
+            // Allowing for the terminal ] or } at the same (rather than greater)
+            // indent level as the initial [ or { is technically invalid, but
+            // failing here would be surprising to users.
+            const atFlowEndMarker = indent === this.indentNext - 1 &&
+                this.flowLevel === 1 &&
+                (line[0] === ']' || line[0] === '}');
+            if (!atFlowEndMarker) {
+                // this is an error
+                this.flowLevel = 0;
+                yield FLOW_END;
+                return yield* this.parseLineStart();
+            }
+        }
+        let n = 0;
+        while (line[n] === ',') {
+            n += yield* this.pushCount(1);
+            n += yield* this.pushSpaces(true);
+            this.flowKey = false;
+        }
+        n += yield* this.pushIndicators();
+        switch (line[n]) {
+            case undefined:
+                return 'flow';
+            case '#':
+                yield* this.pushCount(line.length - n);
+                return 'flow';
+            case '{':
+            case '[':
+                yield* this.pushCount(1);
+                this.flowKey = false;
+                this.flowLevel += 1;
+                return 'flow';
+            case '}':
+            case ']':
+                yield* this.pushCount(1);
+                this.flowKey = true;
+                this.flowLevel -= 1;
+                return this.flowLevel ? 'flow' : 'doc';
+            case '*':
+                yield* this.pushUntil(isNotAnchorChar);
+                return 'flow';
+            case '"':
+            case "'":
+                this.flowKey = true;
+                return yield* this.parseQuotedScalar();
+            case ':': {
+                const next = this.charAt(1);
+                if (this.flowKey || isEmpty(next) || next === ',') {
+                    this.flowKey = false;
+                    yield* this.pushCount(1);
+                    yield* this.pushSpaces(true);
+                    return 'flow';
+                }
+            }
+            // fallthrough
+            default:
+                this.flowKey = false;
+                return yield* this.parsePlainScalar();
+        }
+    }
+    *parseQuotedScalar() {
+        const quote = this.charAt(0);
+        let end = this.buffer.indexOf(quote, this.pos + 1);
+        if (quote === "'") {
+            while (end !== -1 && this.buffer[end + 1] === "'")
+                end = this.buffer.indexOf("'", end + 2);
+        }
+        else {
+            // double-quote
+            while (end !== -1) {
+                let n = 0;
+                while (this.buffer[end - 1 - n] === '\\')
+                    n += 1;
+                if (n % 2 === 0)
+                    break;
+                end = this.buffer.indexOf('"', end + 1);
+            }
+        }
+        // Only looking for newlines within the quotes
+        const qb = this.buffer.substring(0, end);
+        let nl = qb.indexOf('\n', this.pos);
+        if (nl !== -1) {
+            while (nl !== -1) {
+                const cs = this.continueScalar(nl + 1);
+                if (cs === -1)
+                    break;
+                nl = qb.indexOf('\n', cs);
+            }
+            if (nl !== -1) {
+                // this is an error caused by an unexpected unindent
+                end = nl - (qb[nl - 1] === '\r' ? 2 : 1);
+            }
+        }
+        if (end === -1) {
+            if (!this.atEnd)
+                return this.setNext('quoted-scalar');
+            end = this.buffer.length;
+        }
+        yield* this.pushToIndex(end + 1, false);
+        return this.flowLevel ? 'flow' : 'doc';
+    }
+    *parseBlockScalarHeader() {
+        this.blockScalarIndent = -1;
+        this.blockScalarKeep = false;
+        let i = this.pos;
+        while (true) {
+            const ch = this.buffer[++i];
+            if (ch === '+')
+                this.blockScalarKeep = true;
+            else if (ch > '0' && ch <= '9')
+                this.blockScalarIndent = Number(ch) - 1;
+            else if (ch !== '-')
+                break;
+        }
+        return yield* this.pushUntil(ch => isEmpty(ch) || ch === '#');
+    }
+    *parseBlockScalar() {
+        let nl = this.pos - 1; // may be -1 if this.pos === 0
+        let indent = 0;
+        let ch;
+        loop: for (let i = this.pos; (ch = this.buffer[i]); ++i) {
+            switch (ch) {
+                case ' ':
+                    indent += 1;
+                    break;
+                case '\n':
+                    nl = i;
+                    indent = 0;
+                    break;
+                case '\r': {
+                    const next = this.buffer[i + 1];
+                    if (!next && !this.atEnd)
+                        return this.setNext('block-scalar');
+                    if (next === '\n')
+                        break;
+                } // fallthrough
+                default:
+                    break loop;
+            }
+        }
+        if (!ch && !this.atEnd)
+            return this.setNext('block-scalar');
+        if (indent >= this.indentNext) {
+            if (this.blockScalarIndent === -1)
+                this.indentNext = indent;
+            else {
+                this.indentNext =
+                    this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
+            }
+            do {
+                const cs = this.continueScalar(nl + 1);
+                if (cs === -1)
+                    break;
+                nl = this.buffer.indexOf('\n', cs);
+            } while (nl !== -1);
+            if (nl === -1) {
+                if (!this.atEnd)
+                    return this.setNext('block-scalar');
+                nl = this.buffer.length;
+            }
+        }
+        // Trailing insufficiently indented tabs are invalid.
+        // To catch that during parsing, we include them in the block scalar value.
+        let i = nl + 1;
+        ch = this.buffer[i];
+        while (ch === ' ')
+            ch = this.buffer[++i];
+        if (ch === '\t') {
+            while (ch === '\t' || ch === ' ' || ch === '\r' || ch === '\n')
+                ch = this.buffer[++i];
+            nl = i - 1;
+        }
+        else if (!this.blockScalarKeep) {
+            do {
+                let i = nl - 1;
+                let ch = this.buffer[i];
+                if (ch === '\r')
+                    ch = this.buffer[--i];
+                const lastChar = i; // Drop the line if last char not more indented
+                while (ch === ' ')
+                    ch = this.buffer[--i];
+                if (ch === '\n' && i >= this.pos && i + 1 + indent > lastChar)
+                    nl = i;
+                else
+                    break;
+            } while (true);
+        }
+        yield SCALAR;
+        yield* this.pushToIndex(nl + 1, true);
+        return yield* this.parseLineStart();
+    }
+    *parsePlainScalar() {
+        const inFlow = this.flowLevel > 0;
+        let end = this.pos - 1;
+        let i = this.pos - 1;
+        let ch;
+        while ((ch = this.buffer[++i])) {
+            if (ch === ':') {
+                const next = this.buffer[i + 1];
+                if (isEmpty(next) || (inFlow && flowIndicatorChars.has(next)))
+                    break;
+                end = i;
+            }
+            else if (isEmpty(ch)) {
+                let next = this.buffer[i + 1];
+                if (ch === '\r') {
+                    if (next === '\n') {
+                        i += 1;
+                        ch = '\n';
+                        next = this.buffer[i + 1];
+                    }
+                    else
+                        end = i;
+                }
+                if (next === '#' || (inFlow && flowIndicatorChars.has(next)))
+                    break;
+                if (ch === '\n') {
+                    const cs = this.continueScalar(i + 1);
+                    if (cs === -1)
+                        break;
+                    i = Math.max(i, cs - 2); // to advance, but still account for ' #'
+                }
+            }
+            else {
+                if (inFlow && flowIndicatorChars.has(ch))
+                    break;
+                end = i;
+            }
+        }
+        if (!ch && !this.atEnd)
+            return this.setNext('plain-scalar');
+        yield SCALAR;
+        yield* this.pushToIndex(end + 1, true);
+        return inFlow ? 'flow' : 'doc';
+    }
+    *pushCount(n) {
+        if (n > 0) {
+            yield this.buffer.substr(this.pos, n);
+            this.pos += n;
+            return n;
+        }
+        return 0;
+    }
+    *pushToIndex(i, allowEmpty) {
+        const s = this.buffer.slice(this.pos, i);
+        if (s) {
+            yield s;
+            this.pos += s.length;
+            return s.length;
+        }
+        else if (allowEmpty)
+            yield '';
+        return 0;
+    }
+    *pushIndicators() {
+        switch (this.charAt(0)) {
+            case '!':
+                return ((yield* this.pushTag()) +
+                    (yield* this.pushSpaces(true)) +
+                    (yield* this.pushIndicators()));
+            case '&':
+                return ((yield* this.pushUntil(isNotAnchorChar)) +
+                    (yield* this.pushSpaces(true)) +
+                    (yield* this.pushIndicators()));
+            case '-': // this is an error
+            case '?': // this is an error outside flow collections
+            case ':': {
+                const inFlow = this.flowLevel > 0;
+                const ch1 = this.charAt(1);
+                if (isEmpty(ch1) || (inFlow && flowIndicatorChars.has(ch1))) {
+                    if (!inFlow)
+                        this.indentNext = this.indentValue + 1;
+                    else if (this.flowKey)
+                        this.flowKey = false;
+                    return ((yield* this.pushCount(1)) +
+                        (yield* this.pushSpaces(true)) +
+                        (yield* this.pushIndicators()));
+                }
+            }
+        }
+        return 0;
+    }
+    *pushTag() {
+        if (this.charAt(1) === '<') {
+            let i = this.pos + 2;
+            let ch = this.buffer[i];
+            while (!isEmpty(ch) && ch !== '>')
+                ch = this.buffer[++i];
+            return yield* this.pushToIndex(ch === '>' ? i + 1 : i, false);
+        }
+        else {
+            let i = this.pos + 1;
+            let ch = this.buffer[i];
+            while (ch) {
+                if (tagChars.has(ch))
+                    ch = this.buffer[++i];
+                else if (ch === '%' &&
+                    hexDigits.has(this.buffer[i + 1]) &&
+                    hexDigits.has(this.buffer[i + 2])) {
+                    ch = this.buffer[(i += 3)];
+                }
+                else
+                    break;
+            }
+            return yield* this.pushToIndex(i, false);
+        }
+    }
+    *pushNewline() {
+        const ch = this.buffer[this.pos];
+        if (ch === '\n')
+            return yield* this.pushCount(1);
+        else if (ch === '\r' && this.charAt(1) === '\n')
+            return yield* this.pushCount(2);
+        else
+            return 0;
+    }
+    *pushSpaces(allowTabs) {
+        let i = this.pos - 1;
+        let ch;
+        do {
+            ch = this.buffer[++i];
+        } while (ch === ' ' || (allowTabs && ch === '\t'));
+        const n = i - this.pos;
+        if (n > 0) {
+            yield this.buffer.substr(this.pos, n);
+            this.pos = i;
+        }
+        return n;
+    }
+    *pushUntil(test) {
+        let i = this.pos;
+        let ch = this.buffer[i];
+        while (!test(ch))
+            ch = this.buffer[++i];
+        return yield* this.pushToIndex(i, false);
+    }
+}
+
+/**
+ * Tracks newlines during parsing in order to provide an efficient API for
+ * determining the one-indexed `{ line, col }` position for any offset
+ * within the input.
+ */
+class LineCounter {
+    constructor() {
+        this.lineStarts = [];
+        /**
+         * Should be called in ascending order. Otherwise, call
+         * `lineCounter.lineStarts.sort()` before calling `linePos()`.
+         */
+        this.addNewLine = (offset) => this.lineStarts.push(offset);
+        /**
+         * Performs a binary search and returns the 1-indexed { line, col }
+         * position of `offset`. If `line === 0`, `addNewLine` has never been
+         * called or `offset` is before the first known newline.
+         */
+        this.linePos = (offset) => {
+            let low = 0;
+            let high = this.lineStarts.length;
+            while (low < high) {
+                const mid = (low + high) >> 1; // Math.floor((low + high) / 2)
+                if (this.lineStarts[mid] < offset)
+                    low = mid + 1;
+                else
+                    high = mid;
+            }
+            if (this.lineStarts[low] === offset)
+                return { line: low + 1, col: 1 };
+            if (low === 0)
+                return { line: 0, col: offset };
+            const start = this.lineStarts[low - 1];
+            return { line: low, col: offset - start + 1 };
+        };
+    }
+}
+
+function includesToken(list, type) {
+    for (let i = 0; i < list.length; ++i)
+        if (list[i].type === type)
+            return true;
+    return false;
+}
+function findNonEmptyIndex(list) {
+    for (let i = 0; i < list.length; ++i) {
+        switch (list[i].type) {
+            case 'space':
+            case 'comment':
+            case 'newline':
+                break;
+            default:
+                return i;
+        }
+    }
+    return -1;
+}
+function isFlowToken(token) {
+    switch (token?.type) {
+        case 'alias':
+        case 'scalar':
+        case 'single-quoted-scalar':
+        case 'double-quoted-scalar':
+        case 'flow-collection':
+            return true;
+        default:
+            return false;
+    }
+}
+function getPrevProps(parent) {
+    switch (parent.type) {
+        case 'document':
+            return parent.start;
+        case 'block-map': {
+            const it = parent.items[parent.items.length - 1];
+            return it.sep ?? it.start;
+        }
+        case 'block-seq':
+            return parent.items[parent.items.length - 1].start;
+        /* istanbul ignore next should not happen */
+        default:
+            return [];
+    }
+}
+/** Note: May modify input array */
+function getFirstKeyStartProps(prev) {
+    if (prev.length === 0)
+        return [];
+    let i = prev.length;
+    loop: while (--i >= 0) {
+        switch (prev[i].type) {
+            case 'doc-start':
+            case 'explicit-key-ind':
+            case 'map-value-ind':
+            case 'seq-item-ind':
+            case 'newline':
+                break loop;
+        }
+    }
+    return prev.splice(i, prev.length);
+}
+function fixFlowSeqItems(fc) {
+    if (fc.start.type === 'flow-seq-start') {
+        for (const it of fc.items) {
+            if (it.sep &&
+                !it.value &&
+                !includesToken(it.start, 'explicit-key-ind') &&
+                !includesToken(it.sep, 'map-value-ind')) {
+                if (it.key)
+                    it.value = it.key;
+                delete it.key;
+                if (isFlowToken(it.value)) {
+                    if (it.value.end)
+                        Array.prototype.push.apply(it.value.end, it.sep);
+                    else
+                        it.value.end = it.sep;
+                }
+                else
+                    Array.prototype.push.apply(it.start, it.sep);
+                delete it.sep;
+            }
+        }
+    }
+}
+/**
+ * A YAML concrete syntax tree (CST) parser
+ *
+ * ```ts
+ * const src: string = ...
+ * for (const token of new Parser().parse(src)) {
+ *   // token: Token
+ * }
+ * ```
+ *
+ * To use the parser with a user-provided lexer:
+ *
+ * ```ts
+ * function* parse(source: string, lexer: Lexer) {
+ *   const parser = new Parser()
+ *   for (const lexeme of lexer.lex(source))
+ *     yield* parser.next(lexeme)
+ *   yield* parser.end()
+ * }
+ *
+ * const src: string = ...
+ * const lexer = new Lexer()
+ * for (const token of parse(src, lexer)) {
+ *   // token: Token
+ * }
+ * ```
+ */
+class Parser {
+    /**
+     * @param onNewLine - If defined, called separately with the start position of
+     *   each new line (in `parse()`, including the start of input).
+     */
+    constructor(onNewLine) {
+        /** If true, space and sequence indicators count as indentation */
+        this.atNewLine = true;
+        /** If true, next token is a scalar value */
+        this.atScalar = false;
+        /** Current indentation level */
+        this.indent = 0;
+        /** Current offset since the start of parsing */
+        this.offset = 0;
+        /** On the same line with a block map key */
+        this.onKeyLine = false;
+        /** Top indicates the node that's currently being built */
+        this.stack = [];
+        /** The source of the current token, set in parse() */
+        this.source = '';
+        /** The type of the current token, set in parse() */
+        this.type = '';
+        // Must be defined after `next()`
+        this.lexer = new Lexer();
+        this.onNewLine = onNewLine;
+    }
+    /**
+     * Parse `source` as a YAML stream.
+     * If `incomplete`, a part of the last line may be left as a buffer for the next call.
+     *
+     * Errors are not thrown, but yielded as `{ type: 'error', message }` tokens.
+     *
+     * @returns A generator of tokens representing each directive, document, and other structure.
+     */
+    *parse(source, incomplete = false) {
+        if (this.onNewLine && this.offset === 0)
+            this.onNewLine(0);
+        for (const lexeme of this.lexer.lex(source, incomplete))
+            yield* this.next(lexeme);
+        if (!incomplete)
+            yield* this.end();
+    }
+    /**
+     * Advance the parser by the `source` of one lexical token.
+     */
+    *next(source) {
+        this.source = source;
+        if (this.atScalar) {
+            this.atScalar = false;
+            yield* this.step();
+            this.offset += source.length;
+            return;
+        }
+        const type = tokenType(source);
+        if (!type) {
+            const message = `Not a YAML token: ${source}`;
+            yield* this.pop({ type: 'error', offset: this.offset, message, source });
+            this.offset += source.length;
+        }
+        else if (type === 'scalar') {
+            this.atNewLine = false;
+            this.atScalar = true;
+            this.type = 'scalar';
+        }
+        else {
+            this.type = type;
+            yield* this.step();
+            switch (type) {
+                case 'newline':
+                    this.atNewLine = true;
+                    this.indent = 0;
+                    if (this.onNewLine)
+                        this.onNewLine(this.offset + source.length);
+                    break;
+                case 'space':
+                    if (this.atNewLine && source[0] === ' ')
+                        this.indent += source.length;
+                    break;
+                case 'explicit-key-ind':
+                case 'map-value-ind':
+                case 'seq-item-ind':
+                    if (this.atNewLine)
+                        this.indent += source.length;
+                    break;
+                case 'doc-mode':
+                case 'flow-error-end':
+                    return;
+                default:
+                    this.atNewLine = false;
+            }
+            this.offset += source.length;
+        }
+    }
+    /** Call at end of input to push out any remaining constructions */
+    *end() {
+        while (this.stack.length > 0)
+            yield* this.pop();
+    }
+    get sourceToken() {
+        const st = {
+            type: this.type,
+            offset: this.offset,
+            indent: this.indent,
+            source: this.source
+        };
+        return st;
+    }
+    *step() {
+        const top = this.peek(1);
+        if (this.type === 'doc-end' && (!top || top.type !== 'doc-end')) {
+            while (this.stack.length > 0)
+                yield* this.pop();
+            this.stack.push({
+                type: 'doc-end',
+                offset: this.offset,
+                source: this.source
+            });
+            return;
+        }
+        if (!top)
+            return yield* this.stream();
+        switch (top.type) {
+            case 'document':
+                return yield* this.document(top);
+            case 'alias':
+            case 'scalar':
+            case 'single-quoted-scalar':
+            case 'double-quoted-scalar':
+                return yield* this.scalar(top);
+            case 'block-scalar':
+                return yield* this.blockScalar(top);
+            case 'block-map':
+                return yield* this.blockMap(top);
+            case 'block-seq':
+                return yield* this.blockSequence(top);
+            case 'flow-collection':
+                return yield* this.flowCollection(top);
+            case 'doc-end':
+                return yield* this.documentEnd(top);
+        }
+        /* istanbul ignore next should not happen */
+        yield* this.pop();
+    }
+    peek(n) {
+        return this.stack[this.stack.length - n];
+    }
+    *pop(error) {
+        const token = error ?? this.stack.pop();
+        /* istanbul ignore if should not happen */
+        if (!token) {
+            const message = 'Tried to pop an empty stack';
+            yield { type: 'error', offset: this.offset, source: '', message };
+        }
+        else if (this.stack.length === 0) {
+            yield token;
+        }
+        else {
+            const top = this.peek(1);
+            if (token.type === 'block-scalar') {
+                // Block scalars use their parent rather than header indent
+                token.indent = 'indent' in top ? top.indent : 0;
+            }
+            else if (token.type === 'flow-collection' && top.type === 'document') {
+                // Ignore all indent for top-level flow collections
+                token.indent = 0;
+            }
+            if (token.type === 'flow-collection')
+                fixFlowSeqItems(token);
+            switch (top.type) {
+                case 'document':
+                    top.value = token;
+                    break;
+                case 'block-scalar':
+                    top.props.push(token); // error
+                    break;
+                case 'block-map': {
+                    const it = top.items[top.items.length - 1];
+                    if (it.value) {
+                        top.items.push({ start: [], key: token, sep: [] });
+                        this.onKeyLine = true;
+                        return;
+                    }
+                    else if (it.sep) {
+                        it.value = token;
+                    }
+                    else {
+                        Object.assign(it, { key: token, sep: [] });
+                        this.onKeyLine = !it.explicitKey;
+                        return;
+                    }
+                    break;
+                }
+                case 'block-seq': {
+                    const it = top.items[top.items.length - 1];
+                    if (it.value)
+                        top.items.push({ start: [], value: token });
+                    else
+                        it.value = token;
+                    break;
+                }
+                case 'flow-collection': {
+                    const it = top.items[top.items.length - 1];
+                    if (!it || it.value)
+                        top.items.push({ start: [], key: token, sep: [] });
+                    else if (it.sep)
+                        it.value = token;
+                    else
+                        Object.assign(it, { key: token, sep: [] });
+                    return;
+                }
+                /* istanbul ignore next should not happen */
+                default:
+                    yield* this.pop();
+                    yield* this.pop(token);
+            }
+            if ((top.type === 'document' ||
+                top.type === 'block-map' ||
+                top.type === 'block-seq') &&
+                (token.type === 'block-map' || token.type === 'block-seq')) {
+                const last = token.items[token.items.length - 1];
+                if (last &&
+                    !last.sep &&
+                    !last.value &&
+                    last.start.length > 0 &&
+                    findNonEmptyIndex(last.start) === -1 &&
+                    (token.indent === 0 ||
+                        last.start.every(st => st.type !== 'comment' || st.indent < token.indent))) {
+                    if (top.type === 'document')
+                        top.end = last.start;
+                    else
+                        top.items.push({ start: last.start });
+                    token.items.splice(-1, 1);
+                }
+            }
+        }
+    }
+    *stream() {
+        switch (this.type) {
+            case 'directive-line':
+                yield { type: 'directive', offset: this.offset, source: this.source };
+                return;
+            case 'byte-order-mark':
+            case 'space':
+            case 'comment':
+            case 'newline':
+                yield this.sourceToken;
+                return;
+            case 'doc-mode':
+            case 'doc-start': {
+                const doc = {
+                    type: 'document',
+                    offset: this.offset,
+                    start: []
+                };
+                if (this.type === 'doc-start')
+                    doc.start.push(this.sourceToken);
+                this.stack.push(doc);
+                return;
+            }
+        }
+        yield {
+            type: 'error',
+            offset: this.offset,
+            message: `Unexpected ${this.type} token in YAML stream`,
+            source: this.source
+        };
+    }
+    *document(doc) {
+        if (doc.value)
+            return yield* this.lineEnd(doc);
+        switch (this.type) {
+            case 'doc-start': {
+                if (findNonEmptyIndex(doc.start) !== -1) {
+                    yield* this.pop();
+                    yield* this.step();
+                }
+                else
+                    doc.start.push(this.sourceToken);
+                return;
+            }
+            case 'anchor':
+            case 'tag':
+            case 'space':
+            case 'comment':
+            case 'newline':
+                doc.start.push(this.sourceToken);
+                return;
+        }
+        const bv = this.startBlockValue(doc);
+        if (bv)
+            this.stack.push(bv);
+        else {
+            yield {
+                type: 'error',
+                offset: this.offset,
+                message: `Unexpected ${this.type} token in YAML document`,
+                source: this.source
+            };
+        }
+    }
+    *scalar(scalar) {
+        if (this.type === 'map-value-ind') {
+            const prev = getPrevProps(this.peek(2));
+            const start = getFirstKeyStartProps(prev);
+            let sep;
+            if (scalar.end) {
+                sep = scalar.end;
+                sep.push(this.sourceToken);
+                delete scalar.end;
+            }
+            else
+                sep = [this.sourceToken];
+            const map = {
+                type: 'block-map',
+                offset: scalar.offset,
+                indent: scalar.indent,
+                items: [{ start, key: scalar, sep }]
+            };
+            this.onKeyLine = true;
+            this.stack[this.stack.length - 1] = map;
+        }
+        else
+            yield* this.lineEnd(scalar);
+    }
+    *blockScalar(scalar) {
+        switch (this.type) {
+            case 'space':
+            case 'comment':
+            case 'newline':
+                scalar.props.push(this.sourceToken);
+                return;
+            case 'scalar':
+                scalar.source = this.source;
+                // block-scalar source includes trailing newline
+                this.atNewLine = true;
+                this.indent = 0;
+                if (this.onNewLine) {
+                    let nl = this.source.indexOf('\n') + 1;
+                    while (nl !== 0) {
+                        this.onNewLine(this.offset + nl);
+                        nl = this.source.indexOf('\n', nl) + 1;
+                    }
+                }
+                yield* this.pop();
+                break;
+            /* istanbul ignore next should not happen */
+            default:
+                yield* this.pop();
+                yield* this.step();
+        }
+    }
+    *blockMap(map) {
+        const it = map.items[map.items.length - 1];
+        // it.sep is true-ish if pair already has key or : separator
+        switch (this.type) {
+            case 'newline':
+                this.onKeyLine = false;
+                if (it.value) {
+                    const end = 'end' in it.value ? it.value.end : undefined;
+                    const last = Array.isArray(end) ? end[end.length - 1] : undefined;
+                    if (last?.type === 'comment')
+                        end?.push(this.sourceToken);
+                    else
+                        map.items.push({ start: [this.sourceToken] });
+                }
+                else if (it.sep) {
+                    it.sep.push(this.sourceToken);
+                }
+                else {
+                    it.start.push(this.sourceToken);
+                }
+                return;
+            case 'space':
+            case 'comment':
+                if (it.value) {
+                    map.items.push({ start: [this.sourceToken] });
+                }
+                else if (it.sep) {
+                    it.sep.push(this.sourceToken);
+                }
+                else {
+                    if (this.atIndentedComment(it.start, map.indent)) {
+                        const prev = map.items[map.items.length - 2];
+                        const end = prev?.value?.end;
+                        if (Array.isArray(end)) {
+                            Array.prototype.push.apply(end, it.start);
+                            end.push(this.sourceToken);
+                            map.items.pop();
+                            return;
+                        }
+                    }
+                    it.start.push(this.sourceToken);
+                }
+                return;
+        }
+        if (this.indent >= map.indent) {
+            const atMapIndent = !this.onKeyLine && this.indent === map.indent;
+            const atNextItem = atMapIndent &&
+                (it.sep || it.explicitKey) &&
+                this.type !== 'seq-item-ind';
+            // For empty nodes, assign newline-separated not indented empty tokens to following node
+            let start = [];
+            if (atNextItem && it.sep && !it.value) {
+                const nl = [];
+                for (let i = 0; i < it.sep.length; ++i) {
+                    const st = it.sep[i];
+                    switch (st.type) {
+                        case 'newline':
+                            nl.push(i);
+                            break;
+                        case 'space':
+                            break;
+                        case 'comment':
+                            if (st.indent > map.indent)
+                                nl.length = 0;
+                            break;
+                        default:
+                            nl.length = 0;
+                    }
+                }
+                if (nl.length >= 2)
+                    start = it.sep.splice(nl[1]);
+            }
+            switch (this.type) {
+                case 'anchor':
+                case 'tag':
+                    if (atNextItem || it.value) {
+                        start.push(this.sourceToken);
+                        map.items.push({ start });
+                        this.onKeyLine = true;
+                    }
+                    else if (it.sep) {
+                        it.sep.push(this.sourceToken);
+                    }
+                    else {
+                        it.start.push(this.sourceToken);
+                    }
+                    return;
+                case 'explicit-key-ind':
+                    if (!it.sep && !it.explicitKey) {
+                        it.start.push(this.sourceToken);
+                        it.explicitKey = true;
+                    }
+                    else if (atNextItem || it.value) {
+                        start.push(this.sourceToken);
+                        map.items.push({ start, explicitKey: true });
+                    }
+                    else {
+                        this.stack.push({
+                            type: 'block-map',
+                            offset: this.offset,
+                            indent: this.indent,
+                            items: [{ start: [this.sourceToken], explicitKey: true }]
+                        });
+                    }
+                    this.onKeyLine = true;
+                    return;
+                case 'map-value-ind':
+                    if (it.explicitKey) {
+                        if (!it.sep) {
+                            if (includesToken(it.start, 'newline')) {
+                                Object.assign(it, { key: null, sep: [this.sourceToken] });
+                            }
+                            else {
+                                const start = getFirstKeyStartProps(it.start);
+                                this.stack.push({
+                                    type: 'block-map',
+                                    offset: this.offset,
+                                    indent: this.indent,
+                                    items: [{ start, key: null, sep: [this.sourceToken] }]
+                                });
+                            }
+                        }
+                        else if (it.value) {
+                            map.items.push({ start: [], key: null, sep: [this.sourceToken] });
+                        }
+                        else if (includesToken(it.sep, 'map-value-ind')) {
+                            this.stack.push({
+                                type: 'block-map',
+                                offset: this.offset,
+                                indent: this.indent,
+                                items: [{ start, key: null, sep: [this.sourceToken] }]
+                            });
+                        }
+                        else if (isFlowToken(it.key) &&
+                            !includesToken(it.sep, 'newline')) {
+                            const start = getFirstKeyStartProps(it.start);
+                            const key = it.key;
+                            const sep = it.sep;
+                            sep.push(this.sourceToken);
+                            // @ts-expect-error type guard is wrong here
+                            delete it.key, delete it.sep;
+                            this.stack.push({
+                                type: 'block-map',
+                                offset: this.offset,
+                                indent: this.indent,
+                                items: [{ start, key, sep }]
+                            });
+                        }
+                        else if (start.length > 0) {
+                            // Not actually at next item
+                            it.sep = it.sep.concat(start, this.sourceToken);
+                        }
+                        else {
+                            it.sep.push(this.sourceToken);
+                        }
+                    }
+                    else {
+                        if (!it.sep) {
+                            Object.assign(it, { key: null, sep: [this.sourceToken] });
+                        }
+                        else if (it.value || atNextItem) {
+                            map.items.push({ start, key: null, sep: [this.sourceToken] });
+                        }
+                        else if (includesToken(it.sep, 'map-value-ind')) {
+                            this.stack.push({
+                                type: 'block-map',
+                                offset: this.offset,
+                                indent: this.indent,
+                                items: [{ start: [], key: null, sep: [this.sourceToken] }]
+                            });
+                        }
+                        else {
+                            it.sep.push(this.sourceToken);
+                        }
+                    }
+                    this.onKeyLine = true;
+                    return;
+                case 'alias':
+                case 'scalar':
+                case 'single-quoted-scalar':
+                case 'double-quoted-scalar': {
+                    const fs = this.flowScalar(this.type);
+                    if (atNextItem || it.value) {
+                        map.items.push({ start, key: fs, sep: [] });
+                        this.onKeyLine = true;
+                    }
+                    else if (it.sep) {
+                        this.stack.push(fs);
+                    }
+                    else {
+                        Object.assign(it, { key: fs, sep: [] });
+                        this.onKeyLine = true;
+                    }
+                    return;
+                }
+                default: {
+                    const bv = this.startBlockValue(map);
+                    if (bv) {
+                        if (atMapIndent && bv.type !== 'block-seq') {
+                            map.items.push({ start });
+                        }
+                        this.stack.push(bv);
+                        return;
+                    }
+                }
+            }
+        }
+        yield* this.pop();
+        yield* this.step();
+    }
+    *blockSequence(seq) {
+        const it = seq.items[seq.items.length - 1];
+        switch (this.type) {
+            case 'newline':
+                if (it.value) {
+                    const end = 'end' in it.value ? it.value.end : undefined;
+                    const last = Array.isArray(end) ? end[end.length - 1] : undefined;
+                    if (last?.type === 'comment')
+                        end?.push(this.sourceToken);
+                    else
+                        seq.items.push({ start: [this.sourceToken] });
+                }
+                else
+                    it.start.push(this.sourceToken);
+                return;
+            case 'space':
+            case 'comment':
+                if (it.value)
+                    seq.items.push({ start: [this.sourceToken] });
+                else {
+                    if (this.atIndentedComment(it.start, seq.indent)) {
+                        const prev = seq.items[seq.items.length - 2];
+                        const end = prev?.value?.end;
+                        if (Array.isArray(end)) {
+                            Array.prototype.push.apply(end, it.start);
+                            end.push(this.sourceToken);
+                            seq.items.pop();
+                            return;
+                        }
+                    }
+                    it.start.push(this.sourceToken);
+                }
+                return;
+            case 'anchor':
+            case 'tag':
+                if (it.value || this.indent <= seq.indent)
+                    break;
+                it.start.push(this.sourceToken);
+                return;
+            case 'seq-item-ind':
+                if (this.indent !== seq.indent)
+                    break;
+                if (it.value || includesToken(it.start, 'seq-item-ind'))
+                    seq.items.push({ start: [this.sourceToken] });
+                else
+                    it.start.push(this.sourceToken);
+                return;
+        }
+        if (this.indent > seq.indent) {
+            const bv = this.startBlockValue(seq);
+            if (bv) {
+                this.stack.push(bv);
+                return;
+            }
+        }
+        yield* this.pop();
+        yield* this.step();
+    }
+    *flowCollection(fc) {
+        const it = fc.items[fc.items.length - 1];
+        if (this.type === 'flow-error-end') {
+            let top;
+            do {
+                yield* this.pop();
+                top = this.peek(1);
+            } while (top && top.type === 'flow-collection');
+        }
+        else if (fc.end.length === 0) {
+            switch (this.type) {
+                case 'comma':
+                case 'explicit-key-ind':
+                    if (!it || it.sep)
+                        fc.items.push({ start: [this.sourceToken] });
+                    else
+                        it.start.push(this.sourceToken);
+                    return;
+                case 'map-value-ind':
+                    if (!it || it.value)
+                        fc.items.push({ start: [], key: null, sep: [this.sourceToken] });
+                    else if (it.sep)
+                        it.sep.push(this.sourceToken);
+                    else
+                        Object.assign(it, { key: null, sep: [this.sourceToken] });
+                    return;
+                case 'space':
+                case 'comment':
+                case 'newline':
+                case 'anchor':
+                case 'tag':
+                    if (!it || it.value)
+                        fc.items.push({ start: [this.sourceToken] });
+                    else if (it.sep)
+                        it.sep.push(this.sourceToken);
+                    else
+                        it.start.push(this.sourceToken);
+                    return;
+                case 'alias':
+                case 'scalar':
+                case 'single-quoted-scalar':
+                case 'double-quoted-scalar': {
+                    const fs = this.flowScalar(this.type);
+                    if (!it || it.value)
+                        fc.items.push({ start: [], key: fs, sep: [] });
+                    else if (it.sep)
+                        this.stack.push(fs);
+                    else
+                        Object.assign(it, { key: fs, sep: [] });
+                    return;
+                }
+                case 'flow-map-end':
+                case 'flow-seq-end':
+                    fc.end.push(this.sourceToken);
+                    return;
+            }
+            const bv = this.startBlockValue(fc);
+            /* istanbul ignore else should not happen */
+            if (bv)
+                this.stack.push(bv);
+            else {
+                yield* this.pop();
+                yield* this.step();
+            }
+        }
+        else {
+            const parent = this.peek(2);
+            if (parent.type === 'block-map' &&
+                ((this.type === 'map-value-ind' && parent.indent === fc.indent) ||
+                    (this.type === 'newline' &&
+                        !parent.items[parent.items.length - 1].sep))) {
+                yield* this.pop();
+                yield* this.step();
+            }
+            else if (this.type === 'map-value-ind' &&
+                parent.type !== 'flow-collection') {
+                const prev = getPrevProps(parent);
+                const start = getFirstKeyStartProps(prev);
+                fixFlowSeqItems(fc);
+                const sep = fc.end.splice(1, fc.end.length);
+                sep.push(this.sourceToken);
+                const map = {
+                    type: 'block-map',
+                    offset: fc.offset,
+                    indent: fc.indent,
+                    items: [{ start, key: fc, sep }]
+                };
+                this.onKeyLine = true;
+                this.stack[this.stack.length - 1] = map;
+            }
+            else {
+                yield* this.lineEnd(fc);
+            }
+        }
+    }
+    flowScalar(type) {
+        if (this.onNewLine) {
+            let nl = this.source.indexOf('\n') + 1;
+            while (nl !== 0) {
+                this.onNewLine(this.offset + nl);
+                nl = this.source.indexOf('\n', nl) + 1;
+            }
+        }
+        return {
+            type,
+            offset: this.offset,
+            indent: this.indent,
+            source: this.source
+        };
+    }
+    startBlockValue(parent) {
+        switch (this.type) {
+            case 'alias':
+            case 'scalar':
+            case 'single-quoted-scalar':
+            case 'double-quoted-scalar':
+                return this.flowScalar(this.type);
+            case 'block-scalar-header':
+                return {
+                    type: 'block-scalar',
+                    offset: this.offset,
+                    indent: this.indent,
+                    props: [this.sourceToken],
+                    source: ''
+                };
+            case 'flow-map-start':
+            case 'flow-seq-start':
+                return {
+                    type: 'flow-collection',
+                    offset: this.offset,
+                    indent: this.indent,
+                    start: this.sourceToken,
+                    items: [],
+                    end: []
+                };
+            case 'seq-item-ind':
+                return {
+                    type: 'block-seq',
+                    offset: this.offset,
+                    indent: this.indent,
+                    items: [{ start: [this.sourceToken] }]
+                };
+            case 'explicit-key-ind': {
+                this.onKeyLine = true;
+                const prev = getPrevProps(parent);
+                const start = getFirstKeyStartProps(prev);
+                start.push(this.sourceToken);
+                return {
+                    type: 'block-map',
+                    offset: this.offset,
+                    indent: this.indent,
+                    items: [{ start, explicitKey: true }]
+                };
+            }
+            case 'map-value-ind': {
+                this.onKeyLine = true;
+                const prev = getPrevProps(parent);
+                const start = getFirstKeyStartProps(prev);
+                return {
+                    type: 'block-map',
+                    offset: this.offset,
+                    indent: this.indent,
+                    items: [{ start, key: null, sep: [this.sourceToken] }]
+                };
+            }
+        }
+        return null;
+    }
+    atIndentedComment(start, indent) {
+        if (this.type !== 'comment')
+            return false;
+        if (this.indent <= indent)
+            return false;
+        return start.every(st => st.type === 'newline' || st.type === 'space');
+    }
+    *documentEnd(docEnd) {
+        if (this.type !== 'doc-mode') {
+            if (docEnd.end)
+                docEnd.end.push(this.sourceToken);
+            else
+                docEnd.end = [this.sourceToken];
+            if (this.type === 'newline')
+                yield* this.pop();
+        }
+    }
+    *lineEnd(token) {
+        switch (this.type) {
+            case 'comma':
+            case 'doc-start':
+            case 'doc-end':
+            case 'flow-seq-end':
+            case 'flow-map-end':
+            case 'map-value-ind':
+                yield* this.pop();
+                yield* this.step();
+                break;
+            case 'newline':
+                this.onKeyLine = false;
+            // fallthrough
+            case 'space':
+            case 'comment':
+            default:
+                // all other values are errors
+                if (token.end)
+                    token.end.push(this.sourceToken);
+                else
+                    token.end = [this.sourceToken];
+                if (this.type === 'newline')
+                    yield* this.pop();
+        }
+    }
+}
+
+function parseOptions(options) {
+    const prettyErrors = options.prettyErrors !== false;
+    const lineCounter = options.lineCounter || (prettyErrors && new LineCounter()) || null;
+    return { lineCounter, prettyErrors };
+}
+/**
+ * Parse the input as a stream of YAML documents.
+ *
+ * Documents should be separated from each other by `...` or `---` marker lines.
+ *
+ * @returns If an empty `docs` array is returned, it will be of type
+ *   EmptyStream and contain additional stream information. In
+ *   TypeScript, you should use `'empty' in docs` as a type guard for it.
+ */
+function parseAllDocuments(source, options = {}) {
+    const { lineCounter, prettyErrors } = parseOptions(options);
+    const parser = new Parser(lineCounter?.addNewLine);
+    const composer = new Composer(options);
+    const docs = Array.from(composer.compose(parser.parse(source)));
+    if (prettyErrors && lineCounter)
+        for (const doc of docs) {
+            doc.errors.forEach(prettifyError(source, lineCounter));
+            doc.warnings.forEach(prettifyError(source, lineCounter));
+        }
+    if (docs.length > 0)
+        return docs;
+    return Object.assign([], { empty: true }, composer.streamInfo());
+}
+/** Parse an input string into a single YAML.Document */
+function parseDocument(source, options = {}) {
+    const { lineCounter, prettyErrors } = parseOptions(options);
+    const parser = new Parser(lineCounter?.addNewLine);
+    const composer = new Composer(options);
+    // `doc` is always set by compose.end(true) at the very latest
+    let doc = null;
+    for (const _doc of composer.compose(parser.parse(source), true, source.length)) {
+        if (!doc)
+            doc = _doc;
+        else if (doc.options.logLevel !== 'silent') {
+            doc.errors.push(new YAMLParseError(_doc.range.slice(0, 2), 'MULTIPLE_DOCS', 'Source contains multiple documents; please use YAML.parseAllDocuments()'));
+            break;
+        }
+    }
+    if (prettyErrors && lineCounter) {
+        doc.errors.forEach(prettifyError(source, lineCounter));
+        doc.warnings.forEach(prettifyError(source, lineCounter));
+    }
+    return doc;
+}
+function parse$a(src, reviver, options) {
+    let _reviver = undefined;
+    if (typeof reviver === 'function') {
+        _reviver = reviver;
+    }
+    else if (options === undefined && reviver && typeof reviver === 'object') {
+        options = reviver;
+    }
+    const doc = parseDocument(src, options);
+    if (!doc)
+        return null;
+    doc.warnings.forEach(warning => warn(doc.options.logLevel, warning));
+    if (doc.errors.length > 0) {
+        if (doc.options.logLevel !== 'silent')
+            throw doc.errors[0];
+        else
+            doc.errors = [];
+    }
+    return doc.toJS(Object.assign({ reviver: _reviver }, options));
+}
+function stringify(value, replacer, options) {
+    let _replacer = null;
+    if (typeof replacer === 'function' || Array.isArray(replacer)) {
+        _replacer = replacer;
+    }
+    else if (options === undefined && replacer) {
+        options = replacer;
+    }
+    if (typeof options === 'string')
+        options = options.length;
+    if (typeof options === 'number') {
+        const indent = Math.round(options);
+        options = indent < 1 ? undefined : indent > 8 ? { indent: 8 } : { indent };
+    }
+    if (value === undefined) {
+        const { keepUndefined } = options ?? replacer ?? {};
+        if (!keepUndefined)
+            return undefined;
+    }
+    return new Document(value, _replacer, options).toString(options);
+}
+
+var YAML = {
+	__proto__: null,
+	Alias: Alias,
+	CST: cst,
+	Composer: Composer,
+	Document: Document,
+	Lexer: Lexer,
+	LineCounter: LineCounter,
+	Pair: Pair,
+	Parser: Parser,
+	Scalar: Scalar,
+	Schema: Schema,
+	YAMLError: YAMLError,
+	YAMLMap: YAMLMap,
+	YAMLParseError: YAMLParseError,
+	YAMLSeq: YAMLSeq,
+	YAMLWarning: YAMLWarning,
+	isAlias: isAlias,
+	isCollection: isCollection$1,
+	isDocument: isDocument,
+	isMap: isMap,
+	isNode: isNode$1,
+	isPair: isPair,
+	isScalar: isScalar$1,
+	isSeq: isSeq,
+	parse: parse$a,
+	parseAllDocuments: parseAllDocuments,
+	parseDocument: parseDocument,
+	stringify: stringify,
+	visit: visit$1,
+	visitAsync: visitAsync
+};
+
+// `export * as default from ...` fails on Webpack v4
+// https://github.com/eemeli/yaml/issues/228
+
+var browser$2 = {
+	__proto__: null,
+	Alias: Alias,
+	CST: cst,
+	Composer: Composer,
+	Document: Document,
+	Lexer: Lexer,
+	LineCounter: LineCounter,
+	Pair: Pair,
+	Parser: Parser,
+	Scalar: Scalar,
+	Schema: Schema,
+	YAMLError: YAMLError,
+	YAMLMap: YAMLMap,
+	YAMLParseError: YAMLParseError,
+	YAMLSeq: YAMLSeq,
+	YAMLWarning: YAMLWarning,
+	default: YAML,
+	isAlias: isAlias,
+	isCollection: isCollection$1,
+	isDocument: isDocument,
+	isMap: isMap,
+	isNode: isNode$1,
+	isPair: isPair,
+	isScalar: isScalar$1,
+	isSeq: isSeq,
+	parse: parse$a,
+	parseAllDocuments: parseAllDocuments,
+	parseDocument: parseDocument,
+	stringify: stringify,
+	visit: visit$1,
+	visitAsync: visitAsync
+};
+
+var require$$3 = /*@__PURE__*/getAugmentedNamespace(browser$2);
+
+// eslint-disable-next-line n/no-deprecated-api
+const { createRequire, createRequireFromPath } = require$$0$8;
+
+function req$2 (name, rootFile) {
+  const create = createRequire || createRequireFromPath;
+  const require = create(rootFile);
+  return require(name)
+}
+
+var req_1 = req$2;
+
+const req$1 = req_1;
+
+/**
+ * Load Options
+ *
+ * @private
+ * @method options
+ *
+ * @param  {Object} config  PostCSS Config
+ *
+ * @return {Object} options PostCSS Options
+ */
+const options = (config, file) => {
+  if (config.parser && typeof config.parser === 'string') {
+    try {
+      config.parser = req$1(config.parser, file);
+    } catch (err) {
+      throw new Error(`Loading PostCSS Parser failed: ${err.message}\n\n(@${file})`)
+    }
+  }
+
+  if (config.syntax && typeof config.syntax === 'string') {
+    try {
+      config.syntax = req$1(config.syntax, file);
+    } catch (err) {
+      throw new Error(`Loading PostCSS Syntax failed: ${err.message}\n\n(@${file})`)
+    }
+  }
+
+  if (config.stringifier && typeof config.stringifier === 'string') {
+    try {
+      config.stringifier = req$1(config.stringifier, file);
+    } catch (err) {
+      throw new Error(`Loading PostCSS Stringifier failed: ${err.message}\n\n(@${file})`)
+    }
+  }
+
+  if (config.plugins) {
+    delete config.plugins;
+  }
+
+  return config
+};
+
+var options_1 = options;
+
+const req = req_1;
+
+/**
+ * Plugin Loader
+ *
+ * @private
+ * @method load
+ *
+ * @param  {String} plugin PostCSS Plugin Name
+ * @param  {Object} options PostCSS Plugin Options
+ *
+ * @return {Function} PostCSS Plugin
+ */
+const load = (plugin, options, file) => {
+  try {
+    if (
+      options === null ||
+      options === undefined ||
+      Object.keys(options).length === 0
+    ) {
+      return req(plugin, file)
+    } else {
+      return req(plugin, file)(options)
+    }
+  } catch (err) {
+    throw new Error(`Loading PostCSS Plugin failed: ${err.message}\n\n(@${file})`)
+  }
+};
+
+/**
+ * Load Plugins
+ *
+ * @private
+ * @method plugins
+ *
+ * @param {Object} config PostCSS Config Plugins
+ *
+ * @return {Array} plugins PostCSS Plugins
+ */
+const plugins = (config, file) => {
+  let plugins = [];
+
+  if (Array.isArray(config.plugins)) {
+    plugins = config.plugins.filter(Boolean);
+  } else {
+    plugins = Object.keys(config.plugins)
+      .filter((plugin) => {
+        return config.plugins[plugin] !== false ? plugin : ''
+      })
+      .map((plugin) => {
+        return load(plugin, config.plugins[plugin], file)
+      });
+  }
+
+  if (plugins.length && plugins.length > 0) {
+    plugins.forEach((plugin, i) => {
+      if (plugin.default) {
+        plugin = plugin.default;
+      }
+
+      if (plugin.postcss === true) {
+        plugin = plugin();
+      } else if (plugin.postcss) {
+        plugin = plugin.postcss;
+      }
+
+      if (
+        // eslint-disable-next-line
+        !(
+          (typeof plugin === 'object' && Array.isArray(plugin.plugins)) ||
+          (typeof plugin === 'object' && plugin.postcssPlugin) ||
+          (typeof plugin === 'function')
+        )
+      ) {
+        throw new TypeError(`Invalid PostCSS Plugin found at: plugins[${i}]\n\n(@${file})`)
+      }
+    });
+  }
+
+  return plugins
+};
+
+var plugins_1 = plugins;
+
+const resolve = require$$0$4.resolve;
+const url$4 = require$$0$9;
+
+const config$1 = src$2;
+const yaml = require$$3;
+
+const loadOptions = options_1;
+const loadPlugins = plugins_1;
+
+/* istanbul ignore next */
+const interopRequireDefault = (obj) => obj && obj.__esModule ? obj : { default: obj };
+
+/**
+ * Process the result from cosmiconfig
+ *
+ * @param  {Object} ctx Config Context
+ * @param  {Object} result Cosmiconfig result
+ *
+ * @return {Object} PostCSS Config
+ */
+const processResult = (ctx, result) => {
+  const file = result.filepath || '';
+  let config = interopRequireDefault(result.config).default || {};
+
+  if (typeof config === 'function') {
+    config = config(ctx);
+  } else {
+    config = Object.assign({}, config, ctx);
+  }
+
+  if (!config.plugins) {
+    config.plugins = [];
+  }
+
+  return {
+    plugins: loadPlugins(config, file),
+    options: loadOptions(config, file),
+    file
+  }
+};
+
+/**
+ * Builds the Config Context
+ *
+ * @param  {Object} ctx Config Context
+ *
+ * @return {Object} Config Context
+ */
+const createContext = (ctx) => {
+  /**
+   * @type {Object}
+   *
+   * @prop {String} cwd=process.cwd() Config search start location
+   * @prop {String} env=process.env.NODE_ENV Config Enviroment, will be set to `development` by `postcss-load-config` if `process.env.NODE_ENV` is `undefined`
+   */
+  ctx = Object.assign({
+    cwd: process.cwd(),
+    env: process.env.NODE_ENV
+  }, ctx);
+
+  if (!ctx.env) {
+    process.env.NODE_ENV = 'development';
+  }
+
+  return ctx
+};
+
+const importDefault = async filepath => {
+  const module = await import(url$4.pathToFileURL(filepath).href);
+  return module.default
+};
+
+const addTypeScriptLoader = (options = {}, loader) => {
+  const moduleName = 'postcss';
+
+  return {
+    ...options,
+    searchPlaces: [
+      ...(options.searchPlaces || []),
+      'package.json',
+      `.${moduleName}rc`,
+      `.${moduleName}rc.json`,
+      `.${moduleName}rc.yaml`,
+      `.${moduleName}rc.yml`,
+      `.${moduleName}rc.ts`,
+      `.${moduleName}rc.cts`,
+      `.${moduleName}rc.js`,
+      `.${moduleName}rc.cjs`,
+      `.${moduleName}rc.mjs`,
+      `${moduleName}.config.ts`,
+      `${moduleName}.config.cts`,
+      `${moduleName}.config.js`,
+      `${moduleName}.config.cjs`,
+      `${moduleName}.config.mjs`
+    ],
+    loaders: {
+      ...options.loaders,
+      '.yaml': (filepath, content) => yaml.parse(content),
+      '.yml': (filepath, content) => yaml.parse(content),
+      '.js': importDefault,
+      '.cjs': importDefault,
+      '.mjs': importDefault,
+      '.ts': loader,
+      '.cts': loader
+    }
+  }
+};
+
+const withTypeScriptLoader = (rcFunc) => {
+  return (ctx, path, options) => {
+    return rcFunc(ctx, path, addTypeScriptLoader(options, (configFile) => {
+      let registerer = { enabled () {} };
+
+      try {
+        // Register TypeScript compiler instance
+        registerer = __require('ts-node').register({
+          // transpile to cjs even if compilerOptions.module in tsconfig is not Node16/NodeNext.
+          moduleTypes: { '**/*.cts': 'cjs' }
+        });
+
+        return __require(configFile)
+      } catch (err) {
+        if (err.code === 'MODULE_NOT_FOUND') {
+          throw new Error(
+            `'ts-node' is required for the TypeScript configuration files. Make sure it is installed\nError: ${err.message}`
+          )
+        }
+
+        throw err
+      } finally {
+        registerer.enabled(false);
+      }
+    }))
+  }
+};
+
+/**
+ * Load Config
+ *
+ * @method rc
+ *
+ * @param  {Object} ctx Config Context
+ * @param  {String} path Config Path
+ * @param  {Object} options Config Options
+ *
+ * @return {Promise} config PostCSS Config
+ */
+const rc = withTypeScriptLoader((ctx, path, options) => {
+  /**
+   * @type {Object} The full Config Context
+   */
+  ctx = createContext(ctx);
+
+  /**
+   * @type {String} `process.cwd()`
+   */
+  path = path ? resolve(path) : process.cwd();
+
+  return config$1.lilconfig('postcss', options)
+    .search(path)
+    .then((result) => {
+      if (!result) {
+        throw new Error(`No PostCSS Config found in: ${path}`)
+      }
+
+      return processResult(ctx, result)
+    })
+});
+
+/**
+ * Autoload Config for PostCSS
+ *
+ * @author Michael Ciniawsky @michael-ciniawsky 
+ * @license MIT
+ *
+ * @module postcss-load-config
+ * @version 2.1.0
+ *
+ * @requires comsiconfig
+ * @requires ./options
+ * @requires ./plugins
+ */
+var src$1 = rc;
+
+var postcssrc = /*@__PURE__*/getDefaultExportFromCjs(src$1);
+
+// Copyright 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Simon Lydell
+// License: MIT.
+var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
+RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]|[^\/\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;
+Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
+Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;
+StringLiteral = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;
+NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
+Template = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;
+WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu;
+LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
+MultiLineComment = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;
+SingleLineComment = /\/\/.*/y;
+HashbangComment = /^#!.*/;
+JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
+JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;
+JSXString = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;
+JSXText = /[^<>{}]+/y;
+TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
+TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
+KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
+KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
+Newline = RegExp(LineTerminatorSequence.source);
+var jsTokens_1 = function*(input, {jsx = false} = {}) {
+	var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
+	({length} = input);
+	lastIndex = 0;
+	lastSignificantToken = "";
+	stack = [
+		{tag: "JS"}
+	];
+	braces = [];
+	parenNesting = 0;
+	postfixIncDec = false;
+	if (match = HashbangComment.exec(input)) {
+		yield ({
+			type: "HashbangComment",
+			value: match[0]
+		});
+		lastIndex = match[0].length;
+	}
+	while (lastIndex < length) {
+		mode = stack[stack.length - 1];
+		switch (mode.tag) {
+			case "JS":
+			case "JSNonExpressionParen":
+			case "InterpolationInTemplate":
+			case "InterpolationInJSX":
+				if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
+					RegularExpressionLiteral.lastIndex = lastIndex;
+					if (match = RegularExpressionLiteral.exec(input)) {
+						lastIndex = RegularExpressionLiteral.lastIndex;
+						lastSignificantToken = match[0];
+						postfixIncDec = true;
+						yield ({
+							type: "RegularExpressionLiteral",
+							value: match[0],
+							closed: match[1] !== void 0 && match[1] !== "\\"
+						});
+						continue;
+					}
+				}
+				Punctuator.lastIndex = lastIndex;
+				if (match = Punctuator.exec(input)) {
+					punctuator = match[0];
+					nextLastIndex = Punctuator.lastIndex;
+					nextLastSignificantToken = punctuator;
+					switch (punctuator) {
+						case "(":
+							if (lastSignificantToken === "?NonExpressionParenKeyword") {
+								stack.push({
+									tag: "JSNonExpressionParen",
+									nesting: parenNesting
+								});
+							}
+							parenNesting++;
+							postfixIncDec = false;
+							break;
+						case ")":
+							parenNesting--;
+							postfixIncDec = true;
+							if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
+								stack.pop();
+								nextLastSignificantToken = "?NonExpressionParenEnd";
+								postfixIncDec = false;
+							}
+							break;
+						case "{":
+							Punctuator.lastIndex = 0;
+							isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
+							braces.push(isExpression);
+							postfixIncDec = false;
+							break;
+						case "}":
+							switch (mode.tag) {
+								case "InterpolationInTemplate":
+									if (braces.length === mode.nesting) {
+										Template.lastIndex = lastIndex;
+										match = Template.exec(input);
+										lastIndex = Template.lastIndex;
+										lastSignificantToken = match[0];
+										if (match[1] === "${") {
+											lastSignificantToken = "?InterpolationInTemplate";
+											postfixIncDec = false;
+											yield ({
+												type: "TemplateMiddle",
+												value: match[0]
+											});
+										} else {
+											stack.pop();
+											postfixIncDec = true;
+											yield ({
+												type: "TemplateTail",
+												value: match[0],
+												closed: match[1] === "`"
+											});
+										}
+										continue;
+									}
+									break;
+								case "InterpolationInJSX":
+									if (braces.length === mode.nesting) {
+										stack.pop();
+										lastIndex += 1;
+										lastSignificantToken = "}";
+										yield ({
+											type: "JSXPunctuator",
+											value: "}"
+										});
+										continue;
+									}
+							}
+							postfixIncDec = braces.pop();
+							nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
+							break;
+						case "]":
+							postfixIncDec = true;
+							break;
+						case "++":
+						case "--":
+							nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
+							break;
+						case "<":
+							if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
+								stack.push({tag: "JSXTag"});
+								lastIndex += 1;
+								lastSignificantToken = "<";
+								yield ({
+									type: "JSXPunctuator",
+									value: punctuator
+								});
+								continue;
+							}
+							postfixIncDec = false;
+							break;
+						default:
+							postfixIncDec = false;
+					}
+					lastIndex = nextLastIndex;
+					lastSignificantToken = nextLastSignificantToken;
+					yield ({
+						type: "Punctuator",
+						value: punctuator
+					});
+					continue;
+				}
+				Identifier.lastIndex = lastIndex;
+				if (match = Identifier.exec(input)) {
+					lastIndex = Identifier.lastIndex;
+					nextLastSignificantToken = match[0];
+					switch (match[0]) {
+						case "for":
+						case "if":
+						case "while":
+						case "with":
+							if (lastSignificantToken !== "." && lastSignificantToken !== "?.") {
+								nextLastSignificantToken = "?NonExpressionParenKeyword";
+							}
+					}
+					lastSignificantToken = nextLastSignificantToken;
+					postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
+					yield ({
+						type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
+						value: match[0]
+					});
+					continue;
+				}
+				StringLiteral.lastIndex = lastIndex;
+				if (match = StringLiteral.exec(input)) {
+					lastIndex = StringLiteral.lastIndex;
+					lastSignificantToken = match[0];
+					postfixIncDec = true;
+					yield ({
+						type: "StringLiteral",
+						value: match[0],
+						closed: match[2] !== void 0
+					});
+					continue;
+				}
+				NumericLiteral.lastIndex = lastIndex;
+				if (match = NumericLiteral.exec(input)) {
+					lastIndex = NumericLiteral.lastIndex;
+					lastSignificantToken = match[0];
+					postfixIncDec = true;
+					yield ({
+						type: "NumericLiteral",
+						value: match[0]
+					});
+					continue;
+				}
+				Template.lastIndex = lastIndex;
+				if (match = Template.exec(input)) {
+					lastIndex = Template.lastIndex;
+					lastSignificantToken = match[0];
+					if (match[1] === "${") {
+						lastSignificantToken = "?InterpolationInTemplate";
+						stack.push({
+							tag: "InterpolationInTemplate",
+							nesting: braces.length
+						});
+						postfixIncDec = false;
+						yield ({
+							type: "TemplateHead",
+							value: match[0]
+						});
+					} else {
+						postfixIncDec = true;
+						yield ({
+							type: "NoSubstitutionTemplate",
+							value: match[0],
+							closed: match[1] === "`"
+						});
+					}
+					continue;
+				}
+				break;
+			case "JSXTag":
+			case "JSXTagEnd":
+				JSXPunctuator.lastIndex = lastIndex;
+				if (match = JSXPunctuator.exec(input)) {
+					lastIndex = JSXPunctuator.lastIndex;
+					nextLastSignificantToken = match[0];
+					switch (match[0]) {
+						case "<":
+							stack.push({tag: "JSXTag"});
+							break;
+						case ">":
+							stack.pop();
+							if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
+								nextLastSignificantToken = "?JSX";
+								postfixIncDec = true;
+							} else {
+								stack.push({tag: "JSXChildren"});
+							}
+							break;
+						case "{":
+							stack.push({
+								tag: "InterpolationInJSX",
+								nesting: braces.length
+							});
+							nextLastSignificantToken = "?InterpolationInJSX";
+							postfixIncDec = false;
+							break;
+						case "/":
+							if (lastSignificantToken === "<") {
+								stack.pop();
+								if (stack[stack.length - 1].tag === "JSXChildren") {
+									stack.pop();
+								}
+								stack.push({tag: "JSXTagEnd"});
+							}
+					}
+					lastSignificantToken = nextLastSignificantToken;
+					yield ({
+						type: "JSXPunctuator",
+						value: match[0]
+					});
+					continue;
+				}
+				JSXIdentifier.lastIndex = lastIndex;
+				if (match = JSXIdentifier.exec(input)) {
+					lastIndex = JSXIdentifier.lastIndex;
+					lastSignificantToken = match[0];
+					yield ({
+						type: "JSXIdentifier",
+						value: match[0]
+					});
+					continue;
+				}
+				JSXString.lastIndex = lastIndex;
+				if (match = JSXString.exec(input)) {
+					lastIndex = JSXString.lastIndex;
+					lastSignificantToken = match[0];
+					yield ({
+						type: "JSXString",
+						value: match[0],
+						closed: match[2] !== void 0
+					});
+					continue;
+				}
+				break;
+			case "JSXChildren":
+				JSXText.lastIndex = lastIndex;
+				if (match = JSXText.exec(input)) {
+					lastIndex = JSXText.lastIndex;
+					lastSignificantToken = match[0];
+					yield ({
+						type: "JSXText",
+						value: match[0]
+					});
+					continue;
+				}
+				switch (input[lastIndex]) {
+					case "<":
+						stack.push({tag: "JSXTag"});
+						lastIndex++;
+						lastSignificantToken = "<";
+						yield ({
+							type: "JSXPunctuator",
+							value: "<"
+						});
+						continue;
+					case "{":
+						stack.push({
+							tag: "InterpolationInJSX",
+							nesting: braces.length
+						});
+						lastIndex++;
+						lastSignificantToken = "?InterpolationInJSX";
+						postfixIncDec = false;
+						yield ({
+							type: "JSXPunctuator",
+							value: "{"
+						});
+						continue;
+				}
+		}
+		WhiteSpace.lastIndex = lastIndex;
+		if (match = WhiteSpace.exec(input)) {
+			lastIndex = WhiteSpace.lastIndex;
+			yield ({
+				type: "WhiteSpace",
+				value: match[0]
+			});
+			continue;
+		}
+		LineTerminatorSequence.lastIndex = lastIndex;
+		if (match = LineTerminatorSequence.exec(input)) {
+			lastIndex = LineTerminatorSequence.lastIndex;
+			postfixIncDec = false;
+			if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
+				lastSignificantToken = "?NoLineTerminatorHere";
+			}
+			yield ({
+				type: "LineTerminatorSequence",
+				value: match[0]
+			});
+			continue;
+		}
+		MultiLineComment.lastIndex = lastIndex;
+		if (match = MultiLineComment.exec(input)) {
+			lastIndex = MultiLineComment.lastIndex;
+			if (Newline.test(match[0])) {
+				postfixIncDec = false;
+				if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
+					lastSignificantToken = "?NoLineTerminatorHere";
+				}
+			}
+			yield ({
+				type: "MultiLineComment",
+				value: match[0],
+				closed: match[1] !== void 0
+			});
+			continue;
+		}
+		SingleLineComment.lastIndex = lastIndex;
+		if (match = SingleLineComment.exec(input)) {
+			lastIndex = SingleLineComment.lastIndex;
+			postfixIncDec = false;
+			yield ({
+				type: "SingleLineComment",
+				value: match[0]
+			});
+			continue;
+		}
+		firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
+		lastIndex += firstCodePoint.length;
+		lastSignificantToken = firstCodePoint;
+		postfixIncDec = false;
+		yield ({
+			type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
+			value: firstCodePoint
+		});
+	}
+	return void 0;
+};
+
+var jsTokens = /*@__PURE__*/getDefaultExportFromCjs(jsTokens_1);
+
+function stripLiteralJsTokens(code, options) {
+  const FILL = " ";
+  const FILL_COMMENT = " ";
+  let result = "";
+  const tokens = [];
+  for (const token of jsTokens(code, { jsx: false })) {
+    tokens.push(token);
+    if (token.type === "SingleLineComment") {
+      result += FILL_COMMENT.repeat(token.value.length);
+      continue;
+    }
+    if (token.type === "MultiLineComment") {
+      result += token.value.replace(/[^\n]/g, FILL_COMMENT);
+      continue;
+    }
+    if (token.type === "StringLiteral") {
+      if (!token.closed) {
+        result += token.value;
+        continue;
+      }
+      const body = token.value.slice(1, -1);
+      {
+        result += token.value[0] + FILL.repeat(body.length) + token.value[token.value.length - 1];
+        continue;
+      }
+    }
+    if (token.type === "NoSubstitutionTemplate") {
+      const body = token.value.slice(1, -1);
+      {
+        result += `\`${body.replace(/[^\n]/g, FILL)}\``;
+        continue;
+      }
+    }
+    if (token.type === "RegularExpressionLiteral") {
+      const body = token.value;
+      {
+        result += body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${FILL.repeat($1.length)}/${$2}`);
+        continue;
+      }
+    }
+    if (token.type === "TemplateHead") {
+      const body = token.value.slice(1, -2);
+      {
+        result += `\`${body.replace(/[^\n]/g, FILL)}\${`;
+        continue;
+      }
+    }
+    if (token.type === "TemplateTail") {
+      const body = token.value.slice(0, -2);
+      {
+        result += `}${body.replace(/[^\n]/g, FILL)}\``;
+        continue;
+      }
+    }
+    if (token.type === "TemplateMiddle") {
+      const body = token.value.slice(1, -2);
+      {
+        result += `}${body.replace(/[^\n]/g, FILL)}\${`;
+        continue;
+      }
+    }
+    result += token.value;
+  }
+  return {
+    result,
+    tokens
+  };
+}
+
+function stripLiteral(code, options) {
+  return stripLiteralDetailed(code).result;
+}
+function stripLiteralDetailed(code, options) {
+  return stripLiteralJsTokens(code);
+}
+
+var main$1 = {exports: {}};
+
+var name = "dotenv";
+var version$1 = "16.4.5";
+var description = "Loads environment variables from .env file";
+var main = "lib/main.js";
+var types = "lib/main.d.ts";
+var exports = {
+	".": {
+		types: "./lib/main.d.ts",
+		require: "./lib/main.js",
+		"default": "./lib/main.js"
+	},
+	"./config": "./config.js",
+	"./config.js": "./config.js",
+	"./lib/env-options": "./lib/env-options.js",
+	"./lib/env-options.js": "./lib/env-options.js",
+	"./lib/cli-options": "./lib/cli-options.js",
+	"./lib/cli-options.js": "./lib/cli-options.js",
+	"./package.json": "./package.json"
+};
+var scripts = {
+	"dts-check": "tsc --project tests/types/tsconfig.json",
+	lint: "standard",
+	"lint-readme": "standard-markdown",
+	pretest: "npm run lint && npm run dts-check",
+	test: "tap tests/*.js --100 -Rspec",
+	"test:coverage": "tap --coverage-report=lcov",
+	prerelease: "npm test",
+	release: "standard-version"
+};
+var repository = {
+	type: "git",
+	url: "git://github.com/motdotla/dotenv.git"
+};
+var funding = "https://dotenvx.com";
+var keywords = [
+	"dotenv",
+	"env",
+	".env",
+	"environment",
+	"variables",
+	"config",
+	"settings"
+];
+var readmeFilename = "README.md";
+var license = "BSD-2-Clause";
+var devDependencies = {
+	"@definitelytyped/dtslint": "^0.0.133",
+	"@types/node": "^18.11.3",
+	decache: "^4.6.1",
+	sinon: "^14.0.1",
+	standard: "^17.0.0",
+	"standard-markdown": "^7.1.0",
+	"standard-version": "^9.5.0",
+	tap: "^16.3.0",
+	tar: "^6.1.11",
+	typescript: "^4.8.4"
+};
+var engines = {
+	node: ">=12"
+};
+var browser$1 = {
+	fs: false
+};
+var require$$4 = {
+	name: name,
+	version: version$1,
+	description: description,
+	main: main,
+	types: types,
+	exports: exports,
+	scripts: scripts,
+	repository: repository,
+	funding: funding,
+	keywords: keywords,
+	readmeFilename: readmeFilename,
+	license: license,
+	devDependencies: devDependencies,
+	engines: engines,
+	browser: browser$1
+};
+
+const fs$9 = require$$0__default;
+const path$9 = require$$0$4;
+const os$2 = require$$2;
+const crypto$1 = require$$3$1;
+const packageJson = require$$4;
+
+const version = packageJson.version;
+
+const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
+
+// Parse src into an Object
+function parse$9 (src) {
+  const obj = {};
+
+  // Convert buffer to string
+  let lines = src.toString();
+
+  // Convert line breaks to same format
+  lines = lines.replace(/\r\n?/mg, '\n');
+
+  let match;
+  while ((match = LINE.exec(lines)) != null) {
+    const key = match[1];
+
+    // Default undefined or null to empty string
+    let value = (match[2] || '');
+
+    // Remove whitespace
+    value = value.trim();
+
+    // Check if double quoted
+    const maybeQuote = value[0];
+
+    // Remove surrounding quotes
+    value = value.replace(/^(['"`])([\s\S]*)\1$/mg, '$2');
+
+    // Expand newlines if double quoted
+    if (maybeQuote === '"') {
+      value = value.replace(/\\n/g, '\n');
+      value = value.replace(/\\r/g, '\r');
+    }
+
+    // Add to object
+    obj[key] = value;
+  }
+
+  return obj
+}
+
+function _parseVault (options) {
+  const vaultPath = _vaultPath(options);
+
+  // Parse .env.vault
+  const result = DotenvModule.configDotenv({ path: vaultPath });
+  if (!result.parsed) {
+    const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
+    err.code = 'MISSING_DATA';
+    throw err
+  }
+
+  // handle scenario for comma separated keys - for use with key rotation
+  // example: DOTENV_KEY="dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod"
+  const keys = _dotenvKey(options).split(',');
+  const length = keys.length;
+
+  let decrypted;
+  for (let i = 0; i < length; i++) {
+    try {
+      // Get full key
+      const key = keys[i].trim();
+
+      // Get instructions for decrypt
+      const attrs = _instructions(result, key);
+
+      // Decrypt
+      decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
+
+      break
+    } catch (error) {
+      // last key
+      if (i + 1 >= length) {
+        throw error
+      }
+      // try next key
+    }
+  }
+
+  // Parse decrypted .env string
+  return DotenvModule.parse(decrypted)
+}
+
+function _log (message) {
+  console.log(`[dotenv@${version}][INFO] ${message}`);
+}
+
+function _warn (message) {
+  console.log(`[dotenv@${version}][WARN] ${message}`);
+}
+
+function _debug (message) {
+  console.log(`[dotenv@${version}][DEBUG] ${message}`);
+}
+
+function _dotenvKey (options) {
+  // prioritize developer directly setting options.DOTENV_KEY
+  if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
+    return options.DOTENV_KEY
+  }
+
+  // secondary infra already contains a DOTENV_KEY environment variable
+  if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
+    return process.env.DOTENV_KEY
+  }
+
+  // fallback to empty string
+  return ''
+}
+
+function _instructions (result, dotenvKey) {
+  // Parse DOTENV_KEY. Format is a URI
+  let uri;
+  try {
+    uri = new URL(dotenvKey);
+  } catch (error) {
+    if (error.code === 'ERR_INVALID_URL') {
+      const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development');
+      err.code = 'INVALID_DOTENV_KEY';
+      throw err
+    }
+
+    throw error
+  }
+
+  // Get decrypt key
+  const key = uri.password;
+  if (!key) {
+    const err = new Error('INVALID_DOTENV_KEY: Missing key part');
+    err.code = 'INVALID_DOTENV_KEY';
+    throw err
+  }
+
+  // Get environment
+  const environment = uri.searchParams.get('environment');
+  if (!environment) {
+    const err = new Error('INVALID_DOTENV_KEY: Missing environment part');
+    err.code = 'INVALID_DOTENV_KEY';
+    throw err
+  }
+
+  // Get ciphertext payload
+  const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
+  const ciphertext = result.parsed[environmentKey]; // DOTENV_VAULT_PRODUCTION
+  if (!ciphertext) {
+    const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
+    err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT';
+    throw err
+  }
+
+  return { ciphertext, key }
+}
+
+function _vaultPath (options) {
+  let possibleVaultPath = null;
+
+  if (options && options.path && options.path.length > 0) {
+    if (Array.isArray(options.path)) {
+      for (const filepath of options.path) {
+        if (fs$9.existsSync(filepath)) {
+          possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`;
+        }
+      }
+    } else {
+      possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`;
+    }
+  } else {
+    possibleVaultPath = path$9.resolve(process.cwd(), '.env.vault');
+  }
+
+  if (fs$9.existsSync(possibleVaultPath)) {
+    return possibleVaultPath
+  }
+
+  return null
+}
+
+function _resolveHome (envPath) {
+  return envPath[0] === '~' ? path$9.join(os$2.homedir(), envPath.slice(1)) : envPath
+}
+
+function _configVault (options) {
+  _log('Loading env from encrypted .env.vault');
+
+  const parsed = DotenvModule._parseVault(options);
+
+  let processEnv = process.env;
+  if (options && options.processEnv != null) {
+    processEnv = options.processEnv;
+  }
+
+  DotenvModule.populate(processEnv, parsed, options);
+
+  return { parsed }
+}
+
+function configDotenv (options) {
+  const dotenvPath = path$9.resolve(process.cwd(), '.env');
+  let encoding = 'utf8';
+  const debug = Boolean(options && options.debug);
+
+  if (options && options.encoding) {
+    encoding = options.encoding;
+  } else {
+    if (debug) {
+      _debug('No encoding is specified. UTF-8 is used by default');
+    }
+  }
+
+  let optionPaths = [dotenvPath]; // default, look for .env
+  if (options && options.path) {
+    if (!Array.isArray(options.path)) {
+      optionPaths = [_resolveHome(options.path)];
+    } else {
+      optionPaths = []; // reset default
+      for (const filepath of options.path) {
+        optionPaths.push(_resolveHome(filepath));
+      }
+    }
+  }
+
+  // Build the parsed data in a temporary object (because we need to return it).  Once we have the final
+  // parsed data, we will combine it with process.env (or options.processEnv if provided).
+  let lastError;
+  const parsedAll = {};
+  for (const path of optionPaths) {
+    try {
+      // Specifying an encoding returns a string instead of a buffer
+      const parsed = DotenvModule.parse(fs$9.readFileSync(path, { encoding }));
+
+      DotenvModule.populate(parsedAll, parsed, options);
+    } catch (e) {
+      if (debug) {
+        _debug(`Failed to load ${path} ${e.message}`);
+      }
+      lastError = e;
+    }
+  }
+
+  let processEnv = process.env;
+  if (options && options.processEnv != null) {
+    processEnv = options.processEnv;
+  }
+
+  DotenvModule.populate(processEnv, parsedAll, options);
+
+  if (lastError) {
+    return { parsed: parsedAll, error: lastError }
+  } else {
+    return { parsed: parsedAll }
+  }
+}
+
+// Populates process.env from .env file
+function config (options) {
+  // fallback to original dotenv if DOTENV_KEY is not set
+  if (_dotenvKey(options).length === 0) {
+    return DotenvModule.configDotenv(options)
+  }
+
+  const vaultPath = _vaultPath(options);
+
+  // dotenvKey exists but .env.vault file does not exist
+  if (!vaultPath) {
+    _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
+
+    return DotenvModule.configDotenv(options)
+  }
+
+  return DotenvModule._configVault(options)
+}
+
+function decrypt (encrypted, keyStr) {
+  const key = Buffer.from(keyStr.slice(-64), 'hex');
+  let ciphertext = Buffer.from(encrypted, 'base64');
+
+  const nonce = ciphertext.subarray(0, 12);
+  const authTag = ciphertext.subarray(-16);
+  ciphertext = ciphertext.subarray(12, -16);
+
+  try {
+    const aesgcm = crypto$1.createDecipheriv('aes-256-gcm', key, nonce);
+    aesgcm.setAuthTag(authTag);
+    return `${aesgcm.update(ciphertext)}${aesgcm.final()}`
+  } catch (error) {
+    const isRange = error instanceof RangeError;
+    const invalidKeyLength = error.message === 'Invalid key length';
+    const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data';
+
+    if (isRange || invalidKeyLength) {
+      const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)');
+      err.code = 'INVALID_DOTENV_KEY';
+      throw err
+    } else if (decryptionFailed) {
+      const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY');
+      err.code = 'DECRYPTION_FAILED';
+      throw err
+    } else {
+      throw error
+    }
+  }
+}
+
+// Populate process.env with parsed values
+function populate (processEnv, parsed, options = {}) {
+  const debug = Boolean(options && options.debug);
+  const override = Boolean(options && options.override);
+
+  if (typeof parsed !== 'object') {
+    const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate');
+    err.code = 'OBJECT_REQUIRED';
+    throw err
+  }
+
+  // Set process.env
+  for (const key of Object.keys(parsed)) {
+    if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
+      if (override === true) {
+        processEnv[key] = parsed[key];
+      }
+
+      if (debug) {
+        if (override === true) {
+          _debug(`"${key}" is already defined and WAS overwritten`);
+        } else {
+          _debug(`"${key}" is already defined and was NOT overwritten`);
+        }
+      }
+    } else {
+      processEnv[key] = parsed[key];
+    }
+  }
+}
+
+const DotenvModule = {
+  configDotenv,
+  _configVault,
+  _parseVault,
+  config,
+  decrypt,
+  parse: parse$9,
+  populate
+};
+
+main$1.exports.configDotenv = DotenvModule.configDotenv;
+main$1.exports._configVault = DotenvModule._configVault;
+main$1.exports._parseVault = DotenvModule._parseVault;
+main$1.exports.config = DotenvModule.config;
+main$1.exports.decrypt = DotenvModule.decrypt;
+var parse_1$1 = main$1.exports.parse = DotenvModule.parse;
+main$1.exports.populate = DotenvModule.populate;
+
+main$1.exports = DotenvModule;
+
+// * /
+// *   (\\)?            # is it escaped with a backslash?
+// *   (\$)             # literal $
+// *   (?!\()           # shouldnt be followed by parenthesis
+// *   (\{?)            # first brace wrap opening
+// *   ([\w.]+)         # key
+// *   (?::-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))? # optional default nested 3 times
+// *   (\}?)            # last brace warp closing
+// * /xi
+
+const DOTENV_SUBSTITUTION_REGEX = /(\\)?(\$)(?!\()(\{?)([\w.]+)(?::?-((?:\$\{(?:\$\{(?:\$\{[^}]*\}|[^}])*}|[^}])*}|[^}])+))?(\}?)/gi;
+
+function _resolveEscapeSequences (value) {
+  return value.replace(/\\\$/g, '$')
+}
+
+function interpolate (value, processEnv, parsed) {
+  return value.replace(DOTENV_SUBSTITUTION_REGEX, (match, escaped, dollarSign, openBrace, key, defaultValue, closeBrace) => {
+    if (escaped === '\\') {
+      return match.slice(1)
+    } else {
+      if (processEnv[key]) {
+        if (processEnv[key] === parsed[key]) {
+          return processEnv[key]
+        } else {
+          // scenario: PASSWORD_EXPAND_NESTED=${PASSWORD_EXPAND}
+          return interpolate(processEnv[key], processEnv, parsed)
+        }
+      }
+
+      if (parsed[key]) {
+        // avoid recursion from EXPAND_SELF=$EXPAND_SELF
+        if (parsed[key] === value) {
+          return parsed[key]
+        } else {
+          return interpolate(parsed[key], processEnv, parsed)
+        }
+      }
+
+      if (defaultValue) {
+        if (defaultValue.startsWith('$')) {
+          return interpolate(defaultValue, processEnv, parsed)
+        } else {
+          return defaultValue
+        }
+      }
+
+      return ''
+    }
+  })
+}
+
+function expand (options) {
+  let processEnv = process.env;
+  if (options && options.processEnv != null) {
+    processEnv = options.processEnv;
+  }
+
+  for (const key in options.parsed) {
+    let value = options.parsed[key];
+
+    const inProcessEnv = Object.prototype.hasOwnProperty.call(processEnv, key);
+    if (inProcessEnv) {
+      if (processEnv[key] === options.parsed[key]) {
+        // assume was set to processEnv from the .env file if the values match and therefore interpolate
+        value = interpolate(value, processEnv, options.parsed);
+      } else {
+        // do not interpolate - assume processEnv had the intended value even if containing a $.
+        value = processEnv[key];
+      }
+    } else {
+      // not inProcessEnv so assume interpolation for this .env key
+      value = interpolate(value, processEnv, options.parsed);
+    }
+
+    options.parsed[key] = _resolveEscapeSequences(value);
+  }
+
+  for (const processKey in options.parsed) {
+    processEnv[processKey] = options.parsed[processKey];
+  }
+
+  return options
+}
+
+var expand_1 = expand;
+
+function getEnvFilesForMode(mode, envDir) {
+  return [
+    /** default file */
+    `.env`,
+    /** local file */
+    `.env.local`,
+    /** mode file */
+    `.env.${mode}`,
+    /** mode local file */
+    `.env.${mode}.local`
+  ].map((file) => normalizePath$3(path$n.join(envDir, file)));
+}
+function loadEnv(mode, envDir, prefixes = "VITE_") {
+  if (mode === "local") {
+    throw new Error(
+      `"local" cannot be used as a mode name because it conflicts with the .local postfix for .env files.`
+    );
+  }
+  prefixes = arraify(prefixes);
+  const env = {};
+  const envFiles = getEnvFilesForMode(mode, envDir);
+  const parsed = Object.fromEntries(
+    envFiles.flatMap((filePath) => {
+      if (!tryStatSync(filePath)?.isFile()) return [];
+      return Object.entries(parse_1$1(fs__default.readFileSync(filePath)));
+    })
+  );
+  if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === void 0) {
+    process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV;
+  }
+  if (parsed.BROWSER && process.env.BROWSER === void 0) {
+    process.env.BROWSER = parsed.BROWSER;
+  }
+  if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === void 0) {
+    process.env.BROWSER_ARGS = parsed.BROWSER_ARGS;
+  }
+  const processEnv = { ...process.env };
+  expand_1({ parsed, processEnv });
+  for (const [key, value] of Object.entries(parsed)) {
+    if (prefixes.some((prefix) => key.startsWith(prefix))) {
+      env[key] = value;
+    }
+  }
+  for (const key in process.env) {
+    if (prefixes.some((prefix) => key.startsWith(prefix))) {
+      env[key] = process.env[key];
+    }
+  }
+  return env;
+}
+function resolveEnvPrefix({
+  envPrefix = "VITE_"
+}) {
+  envPrefix = arraify(envPrefix);
+  if (envPrefix.includes("")) {
+    throw new Error(
+      `envPrefix option contains value '', which could lead unexpected exposure of sensitive information.`
+    );
+  }
+  return envPrefix;
+}
+
+const modulePreloadPolyfillId = "vite/modulepreload-polyfill";
+const resolvedModulePreloadPolyfillId = "\0" + modulePreloadPolyfillId + ".js";
+function modulePreloadPolyfillPlugin(config) {
+  const skip = config.command !== "build" || config.build.ssr;
+  let polyfillString;
+  return {
+    name: "vite:modulepreload-polyfill",
+    resolveId(id) {
+      if (id === modulePreloadPolyfillId) {
+        return resolvedModulePreloadPolyfillId;
+      }
+    },
+    load(id) {
+      if (id === resolvedModulePreloadPolyfillId) {
+        if (skip) {
+          return "";
+        }
+        if (!polyfillString) {
+          polyfillString = `${isModernFlag}&&(${polyfill.toString()}());`;
+        }
+        return { code: polyfillString, moduleSideEffects: true };
+      }
+    }
+  };
+}
+function polyfill() {
+  const relList = document.createElement("link").relList;
+  if (relList && relList.supports && relList.supports("modulepreload")) {
+    return;
+  }
+  for (const link of document.querySelectorAll('link[rel="modulepreload"]')) {
+    processPreload(link);
+  }
+  new MutationObserver((mutations) => {
+    for (const mutation of mutations) {
+      if (mutation.type !== "childList") {
+        continue;
+      }
+      for (const node of mutation.addedNodes) {
+        if (node.tagName === "LINK" && node.rel === "modulepreload")
+          processPreload(node);
+      }
+    }
+  }).observe(document, { childList: true, subtree: true });
+  function getFetchOpts(link) {
+    const fetchOpts = {};
+    if (link.integrity) fetchOpts.integrity = link.integrity;
+    if (link.referrerPolicy) fetchOpts.referrerPolicy = link.referrerPolicy;
+    if (link.crossOrigin === "use-credentials")
+      fetchOpts.credentials = "include";
+    else if (link.crossOrigin === "anonymous") fetchOpts.credentials = "omit";
+    else fetchOpts.credentials = "same-origin";
+    return fetchOpts;
+  }
+  function processPreload(link) {
+    if (link.ep)
+      return;
+    link.ep = true;
+    const fetchOpts = getFetchOpts(link);
+    fetch(link.href, fetchOpts);
+  }
+}
+
+const htmlProxyRE$1 = /\?html-proxy=?(?:&inline-css)?(?:&style-attr)?&index=(\d+)\.(?:js|css)$/;
+const isHtmlProxyRE = /\?html-proxy\b/;
+const inlineCSSRE$1 = /__VITE_INLINE_CSS__([a-z\d]{8}_\d+)__/g;
+const inlineImportRE = /(?]*type\s*=\s*(?:"importmap"|'importmap'|importmap)[^>]*>.*?<\/script>/is;
+const moduleScriptRE = /[ \t]*]*type\s*=\s*(?:"module"|'module'|module)[^>]*>/i;
+const modulePreloadLinkRE = /[ \t]*]*rel\s*=\s*(?:"modulepreload"|'modulepreload'|modulepreload)[\s\S]*?\/>/i;
+const importMapAppendRE = new RegExp(
+  [moduleScriptRE, modulePreloadLinkRE].map((r) => r.source).join("|"),
+  "i"
+);
+const isHTMLProxy = (id) => isHtmlProxyRE.test(id);
+const isHTMLRequest = (request) => htmlLangRE.test(request);
+const htmlProxyMap = /* @__PURE__ */ new WeakMap();
+const htmlProxyResult = /* @__PURE__ */ new Map();
+function htmlInlineProxyPlugin(config) {
+  htmlProxyMap.set(config, /* @__PURE__ */ new Map());
+  return {
+    name: "vite:html-inline-proxy",
+    resolveId(id) {
+      if (isHTMLProxy(id)) {
+        return id;
+      }
+    },
+    load(id) {
+      const proxyMatch = htmlProxyRE$1.exec(id);
+      if (proxyMatch) {
+        const index = Number(proxyMatch[1]);
+        const file = cleanUrl(id);
+        const url = file.replace(normalizePath$3(config.root), "");
+        const result = htmlProxyMap.get(config).get(url)?.[index];
+        if (result) {
+          return result;
+        } else {
+          throw new Error(`No matching HTML proxy module found from ${id}`);
+        }
+      }
+    }
+  };
+}
+function addToHTMLProxyCache(config, filePath, index, result) {
+  if (!htmlProxyMap.get(config)) {
+    htmlProxyMap.set(config, /* @__PURE__ */ new Map());
+  }
+  if (!htmlProxyMap.get(config).get(filePath)) {
+    htmlProxyMap.get(config).set(filePath, []);
+  }
+  htmlProxyMap.get(config).get(filePath)[index] = result;
+}
+function addToHTMLProxyTransformResult(hash, code) {
+  htmlProxyResult.set(hash, code);
+}
+const assetAttrsConfig = {
+  link: ["href"],
+  video: ["src", "poster"],
+  source: ["src", "srcset"],
+  img: ["src", "srcset"],
+  image: ["xlink:href", "href"],
+  use: ["xlink:href", "href"]
+};
+const noInlineLinkRels = /* @__PURE__ */ new Set([
+  "icon",
+  "apple-touch-icon",
+  "apple-touch-startup-image",
+  "manifest"
+]);
+const isAsyncScriptMap = /* @__PURE__ */ new WeakMap();
+function nodeIsElement(node) {
+  return node.nodeName[0] !== "#";
+}
+function traverseNodes(node, visitor) {
+  if (node.nodeName === "template") {
+    node = node.content;
+  }
+  visitor(node);
+  if (nodeIsElement(node) || node.nodeName === "#document" || node.nodeName === "#document-fragment") {
+    node.childNodes.forEach((childNode) => traverseNodes(childNode, visitor));
+  }
+}
+async function traverseHtml(html, filePath, visitor) {
+  const { parse } = await import('./dep-D-7KCb9p.js');
+  const ast = parse(html, {
+    scriptingEnabled: false,
+    // parse inside