diff --git a/smart-kiosk-assistant/.gitignore b/smart-kiosk-assistant/.gitignore index c6e1499a..34d18218 100644 --- a/smart-kiosk-assistant/.gitignore +++ b/smart-kiosk-assistant/.gitignore @@ -22,3 +22,6 @@ Sample_data/sample2.mp4 # Metrics tool output dumps (large, machine-generated) metrics/ + +# TypeScript incremental build cache (machine/environment-specific) +kiosk-ui/**/*.tsbuildinfo diff --git a/smart-kiosk-assistant/Makefile b/smart-kiosk-assistant/Makefile index bd00c3b4..d865a616 100644 --- a/smart-kiosk-assistant/Makefile +++ b/smart-kiosk-assistant/Makefile @@ -47,24 +47,30 @@ SAMPLE_DATA_DIR ?= ./Sample_data SAMPLE_VIDEO_1_URL ?= SAMPLE_VIDEO_2_URL ?= -# edge-ai-libraries path (audio-analyzer + text-to-speech build contexts live here) -EAL_PATH := ../edge-ai-libraries/microservices - -# Services with fully local build contexts (no edge-ai-libraries needed) +# Services with fully local build contexts LOCAL_ONLY_SERVICES := metrics-collector rag-service kiosk-core kiosk-ui queue-service rtsp-streamer -# Identity feature (profile-gated). Pass IDENTITY=true to build/start the -# identity-service container AND tell kiosk-core to call it. Default off so the -# standard stack is unchanged. -IDENTITY ?= false +# Identity feature (profile-gated). Driven by KIOSK_CORE_IDENTITY_ENABLED in +# .env by default — set it to true there to build/start the identity-service +# container AND tell kiosk-core to call it. `IDENTITY=true|false` on the make +# command line still takes precedence over .env for one-off overrides. +# Default off so the standard stack is unchanged. +# NOTE: capture the .env value with ":=" (immediate expansion) BEFORE the +# "export KIOSK_CORE_IDENTITY_ENABLED = ..." line below rebinds that same +# name — otherwise IDENTITY and KIOSK_CORE_IDENTITY_ENABLED would reference +# each other recursively and make would abort with "Recursive variable +# 'IDENTITY' references itself". +_ENV_IDENTITY_ENABLED := $(KIOSK_CORE_IDENTITY_ENABLED) +IDENTITY ?= $(_ENV_IDENTITY_ENABLED) _IDENTITY_ON = $(filter true TRUE,$(IDENTITY)) _IDENTITY_PROFILE = $(if $(_IDENTITY_ON),--profile identity,) _IDENTITY_SVC = $(if $(_IDENTITY_ON),identity-service,) export KIOSK_CORE_IDENTITY_ENABLED = $(if $(_IDENTITY_ON),true,false) -# Services that require edge-ai-libraries checkout to build from source. -# When EAL_PATH is absent, pre-built images (intel/*:RELEASE_TAG) are used instead. -EAL_SERVICES := audio-analyzer text-to-speech +# audio-analyzer and text-to-speech live in a separate repository +# (edge-ai-libraries) and have no local build context here — they are always +# pulled pre-built from Docker Hub, using the tags pinned in docker-compose.yml. +REGISTRY_ONLY_SERVICES := audio-analyzer text-to-speech # Colors RED := \033[0;31m @@ -268,7 +274,6 @@ show-config: ## Print resolved configuration @echo " REGISTRY = $(REGISTRY) (docker-compose prefix: $(_DOCKER_REGISTRY))" @echo " RELEASE_TAG = $(RELEASE_TAG)" @echo " COMPOSE_FILE = $(COMPOSE_FILE)" - @echo " EAL_PATH = $(EAL_PATH) ($$([ -d '$(EAL_PATH)' ] && echo 'found' || echo 'not present — EAL services use pre-built images'))" @echo "" @echo "$(YELLOW)Inference:$(NC)" @echo " TARGET_DEVICE = $(TARGET_DEVICE)" @@ -278,6 +283,10 @@ show-config: ## Print resolved configuration @echo "$(YELLOW)Authentication:$(NC)" @echo " HF_TOKEN = $$([ -n '$(HF_TOKEN)' ] && echo '***set***' || echo 'NOT SET')" @echo "" + @echo "$(YELLOW)Identity feature:$(NC)" + @echo " IDENTITY = $(IDENTITY) (from .env KIOSK_CORE_IDENTITY_ENABLED, override with IDENTITY=true|false)" + @echo " identity-service = $$([ -n '$(_IDENTITY_SVC)' ] && echo 'enabled — will start with --profile identity' || echo 'disabled')" + @echo "" # ============================================================================= # Build @@ -288,33 +297,16 @@ build: check-env ## Build (REGISTRY=false) or pull (REGISTRY=true) all images @if [ "$(REGISTRY)" = "false" ] || [ "$(REGISTRY)" = "FALSE" ]; then \ echo "$(YELLOW) REGISTRY=false → Building local services from source$(NC)"; \ REGISTRY=$(_DOCKER_REGISTRY) docker compose -f $(COMPOSE_FILE) $(_IDENTITY_PROFILE) build $(LOCAL_ONLY_SERVICES) $(_IDENTITY_SVC); \ - if [ -d "$(EAL_PATH)/audio-analyzer" ] && [ -d "$(EAL_PATH)/text-to-speech" ]; then \ - echo "$(YELLOW) Building EAL services (audio-analyzer, text-to-speech) from source...$(NC)"; \ - REGISTRY=$(_DOCKER_REGISTRY) docker compose -f $(COMPOSE_FILE) build audio-analyzer text-to-speech; \ - else \ - echo "$(YELLOW) ⚠ edge-ai-libraries not found at $(EAL_PATH) — pulling pre-built images...$(NC)"; \ - _aa_image="$(_ENV_REGISTRY)/audio-analyzer:$(RELEASE_TAG)"; \ - _tts_image="$(_ENV_REGISTRY)/text-to-speech:2026.1.0"; \ - if docker image inspect "$$_aa_image" >/dev/null 2>&1; then \ - echo "$(GREEN) ✓ $$_aa_image already present locally — skipping pull$(NC)"; \ - else \ - REGISTRY=$(_ENV_REGISTRY) docker compose -f $(COMPOSE_FILE) pull audio-analyzer; \ - fi; \ - if docker image inspect "$$_tts_image" >/dev/null 2>&1; then \ - echo "$(GREEN) ✓ $$_tts_image already present locally — skipping pull$(NC)"; \ - else \ - REGISTRY=$(_ENV_REGISTRY) docker compose -f $(COMPOSE_FILE) pull text-to-speech; \ - fi; \ - fi; \ else \ echo "$(YELLOW) REGISTRY=$(REGISTRY) → Pulling images from registry$(NC)"; \ - REGISTRY=$(REGISTRY) docker compose -f $(COMPOSE_FILE) pull \ - $(LOCAL_ONLY_SERVICES) $(EAL_SERVICES); \ + REGISTRY=$(REGISTRY) docker compose -f $(COMPOSE_FILE) pull $(LOCAL_ONLY_SERVICES); \ if [ -n "$(_IDENTITY_SVC)" ]; then \ echo "$(YELLOW) Building identity-service locally (no registry image)...$(NC)"; \ REGISTRY=$(_DOCKER_REGISTRY) docker compose -f $(COMPOSE_FILE) $(_IDENTITY_PROFILE) build identity-service; \ fi; \ - fi + fi; \ + echo "$(YELLOW) Pulling audio-analyzer, text-to-speech from Docker Hub (edge-ai-libraries — separate repo, no local build)...$(NC)"; \ + REGISTRY=$(_DOCKER_REGISTRY) docker compose -f $(COMPOSE_FILE) pull $(REGISTRY_ONLY_SERVICES) @echo "$(GREEN)✓ Images ready$(NC)" # ============================================================================= @@ -337,7 +329,7 @@ up: check-env setup-dirs ## Start all services down: ## Stop all services @echo "$(BLUE)Stopping Smart Kiosk Assistant...$(NC)" - docker compose -f $(COMPOSE_FILE) down + docker compose -f $(COMPOSE_FILE) $(_IDENTITY_PROFILE) down @echo "$(GREEN)✓ All services stopped$(NC)" restart: down up ## Stop then restart all services diff --git a/smart-kiosk-assistant/configs/identity/identity_config.yaml b/smart-kiosk-assistant/configs/identity/identity_config.yaml index 38dba548..6f437257 100644 --- a/smart-kiosk-assistant/configs/identity/identity_config.yaml +++ b/smart-kiosk-assistant/configs/identity/identity_config.yaml @@ -24,9 +24,18 @@ voice_embedding_dim: 192 # ── Verification thresholds & fusion ───────────────────────────────────────── # Authentication requires BOTH modalities. The fused score must clear the # combined threshold. Per-modality thresholds are retained for diagnostics. -fusion_face_weight: 0.6 -fusion_voice_weight: 0.4 -combined_threshold: 0.78 +# +# NOTE (2026-07-14): tuned down from the initial defaults (0.6/0.4, 0.78) after +# real-world testing showed face recognition is highly reliable (0.75-0.98) +# while the converted ECAPA voice model shows wide session-to-session variance +# (0.29-0.84 for genuine same-person attempts) due to uncalibrated browser-mic +# audio -- no code defect found in the embedding/normalization/search pipeline. +# Leaning more on the more-reliable face modality and lowering the combined +# bar reduces false rejects while still requiring both biometrics to broadly +# agree. +fusion_face_weight: 0.7 +fusion_voice_weight: 0.3 +combined_threshold: 0.65 face_threshold: 0.80 voice_threshold: 0.75 diff --git a/smart-kiosk-assistant/docker-compose.yml b/smart-kiosk-assistant/docker-compose.yml index 85cf8da4..1a7f789e 100644 --- a/smart-kiosk-assistant/docker-compose.yml +++ b/smart-kiosk-assistant/docker-compose.yml @@ -4,10 +4,12 @@ # Mic audio is captured by the browser via Web Audio API and uploaded as a # file -- no host mic passthrough into the container is required. # +# audio-analyzer and text-to-speech live in the separate edge-ai-libraries +# repository and have no local build context here — they are always pulled +# pre-built from Docker Hub using the image tags declared below. +# # Pull (default): docker compose pull && docker compose up -d # Build from src: docker compose build && docker compose up -d -# (requires edge-ai-libraries cloned as a sibling repo; -# see docs/build-from-source.md) # Stop: docker compose down # Logs: docker compose logs -f @@ -148,9 +150,6 @@ services: restart: unless-stopped audio-analyzer: - build: - context: ../edge-ai-libraries/microservices/audio-analyzer - dockerfile: Dockerfile image: ${REGISTRY:-intel}/audio-analyzer:${RELEASE_TAG:-latest} container_name: audio-analyzer # Hardcoded to match the image's baked-in app user and the @@ -208,9 +207,6 @@ services: restart: unless-stopped text-to-speech: - build: - context: ../edge-ai-libraries/microservices/text-to-speech - dockerfile: Dockerfile image: ${REGISTRY:-intel}/text-to-speech:2026.1.0 container_name: text-to-speech user: "1000:1000" diff --git a/smart-kiosk-assistant/identity-service/README.md b/smart-kiosk-assistant/identity-service/README.md index 3aba377c..8e859e6e 100644 --- a/smart-kiosk-assistant/identity-service/README.md +++ b/smart-kiosk-assistant/identity-service/README.md @@ -80,12 +80,43 @@ Base URL inside the cluster: `http://identity-service:8013` | GET | `/health` | Liveness probe | ✅ | | GET | `/api/v1/identity/challenge` | Random voice challenge prompt | ✅ | | GET | `/api/v1/identity/stats` | Profile + index counts, `inference_ready` | ✅ | -| POST | `/api/v1/identity/verify` | Multimodal (face+voice) verification | ⏳ Phase 6 (pipeline) | -| POST | `/api/v1/identity/register` | Admin / manual enrolment | ⏳ Phase 5 (pipeline) | +| POST | `/api/v1/identity/verify` | Multimodal (face+voice) verification | ✅ | +| POST | `/api/v1/identity/register` | Admin / manual enrolment | ✅ | -`verify` and `register` are reachable today but return a structured -*"pipeline pending"* response until Phases 5–6 wire the decode → embed → search → -fuse path. +kiosk-core (`:8012`) proxies this contract 1:1 when `KIOSK_CORE_IDENTITY_ENABLED=true` +(see [kiosk-core proxy](#kiosk-core-proxy--kiosk-ui-gate) below), plus one always-on +capability endpoint kiosk-ui uses to decide whether to show the auth gate at all: + +| Method | Path (kiosk-core) | Purpose | +|---|---|---| +| GET | `/api/v1/identity/enabled` | Runtime flag mirroring `KIOSK_CORE_IDENTITY_ENABLED`; **always reachable**, even when the identity feature is off. | +| GET | `/api/v1/identity/challenge` | Proxies identity-service `/challenge` (gated by the flag). | +| POST | `/api/v1/identity/verify` | Proxies identity-service `/verify`; both `image_base64` and `audio_base64` required. | +| POST | `/api/v1/identity/register` | Proxies identity-service `/register` (self-service enrolment); both `image_base64` and `audio_base64` required. | + +--- + +## kiosk-core proxy + kiosk-ui gate + +kiosk-ui wraps the existing chat home page in an `AuthGate` (mounted once in +`main.tsx`, so `App.tsx`/the chat experience itself is untouched): + +1. On load, it calls `GET /api/v1/identity/enabled`. If the identity feature is + disabled or the backend is unreachable, the gate **bypasses** and renders the + chat home page exactly as before — zero behavioural change. +2. If enabled, it shows a **Login** screen: live camera preview + an on-screen + challenge phrase (read aloud). On "Authenticate" it captures one JPEG frame + and a ~3s WAV clip and calls `verify()`. A verified user is redirected to the + existing chat home page; an unverified user sees an on-screen + *"User not authenticated"* error and can retry or register. +3. A **Register** screen (linked from Login) collects a display name, generates + a `user_id` slug (`name` + random suffix), captures face + voice the same + way, and calls `register()` — reusing the same identity-service enrolment + pipeline the video-file bootstrap path uses, so newly registered users are + written to the same FAISS indices + `loyalty_profiles` SQLite table. + +Relevant kiosk-ui source: `src/components/Auth/{AuthGate,LoginScreen,RegisterScreen}.tsx`, +`src/hooks/{useCamera,useVoiceCapture}.ts`, `src/api/identityApi.ts`. --- @@ -195,7 +226,11 @@ identity-service/ `inference_ready` flips to `true`. - **Phase 6 — verification:** fusion scoring + profile retrieval in `verify()`; inject favourites/restrictions into the kiosk-core LLM session context. -- **Phase 7 — UI:** challenge display + verify gate in the Gradio / kiosk-ui flow. +- **Phase 7 — UI:** ✅ done — `AuthGate` in kiosk-ui gates the chat home page + behind face+voice login, with a self-service Register screen. Gate presence + is driven entirely by the backend `KIOSK_CORE_IDENTITY_ENABLED` flag (via + `GET /api/v1/identity/enabled`), so it is a pure add-on with no impact on the + chat experience when the feature is off. - **Phase 8 — tests & docs:** pytest suite under `tests/`; LLD, sequence/class diagrams, schema and API documentation under `docs/`. diff --git a/smart-kiosk-assistant/identity-service/identity_core/service.py b/smart-kiosk-assistant/identity-service/identity_core/service.py index d1964b25..f66dd4e8 100644 --- a/smart-kiosk-assistant/identity-service/identity_core/service.py +++ b/smart-kiosk-assistant/identity-service/identity_core/service.py @@ -200,6 +200,15 @@ def _ok(record, f_sim, v_sim, fused) -> VerifyResponse: ) if fused >= settings.combined_threshold: return _ok(face_record, face_sim, voice_sim, fused) + logger.info( + "[IDENTITY] Verify REJECTED user_id=%s face=%s voice=%s " + "fused=%s < combined_threshold=%s", + face_record.user_id, + face_sim, + voice_sim, + fused, + settings.combined_threshold, + ) return VerifyResponse( verified=False, face_similarity=face_sim, @@ -207,6 +216,14 @@ def _ok(record, f_sim, v_sim, fused) -> VerifyResponse: fused_score=fused, reason="No matching profile above the combined threshold.", ) + logger.info( + "[IDENTITY] Verify REJECTED face_user=%s voice_user=%s " + "face_sim=%s voice_sim=%s (modality mismatch or no hit)", + face_record.user_id if face_record else None, + voice_record.user_id if voice_record else None, + face_sim, + voice_sim, + ) return VerifyResponse( verified=False, face_similarity=face_sim, @@ -218,6 +235,13 @@ def _ok(record, f_sim, v_sim, fused) -> VerifyResponse: if request.image_base64: if face_record is not None and face_sim >= settings.face_threshold: return _ok(face_record, face_sim, None, None) + logger.info( + "[IDENTITY] Verify REJECTED (face-only) user=%s face_sim=%s " + "< face_threshold=%s", + face_record.user_id if face_record else None, + face_sim, + settings.face_threshold, + ) return VerifyResponse( verified=False, face_similarity=face_sim, @@ -226,6 +250,13 @@ def _ok(record, f_sim, v_sim, fused) -> VerifyResponse: if voice_record is not None and voice_sim >= settings.voice_threshold: return _ok(voice_record, None, voice_sim, None) + logger.info( + "[IDENTITY] Verify REJECTED (voice-only) user=%s voice_sim=%s " + "< voice_threshold=%s", + voice_record.user_id if voice_record else None, + voice_sim, + settings.voice_threshold, + ) return VerifyResponse( verified=False, voice_similarity=voice_sim, diff --git a/smart-kiosk-assistant/kiosk-ui/dist/assets/index-CTQ1XkHn.js b/smart-kiosk-assistant/kiosk-ui/dist/assets/index-CTQ1XkHn.js new file mode 100644 index 00000000..e35a5c5e --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/dist/assets/index-CTQ1XkHn.js @@ -0,0 +1,125 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function n(a){if(a.ep)return;a.ep=!0;const u=r(a);fetch(a.href,u)}})();var zl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jd={exports:{}},wo={},Td={exports:{}},je={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vx;function tC(){if(Vx)return je;Vx=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.iterator;function m(I){return I===null||typeof I!="object"?null:(I=v&&I[v]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function b(I,z,oe){this.props=I,this.context=z,this.refs=w,this.updater=oe||x}b.prototype.isReactComponent={},b.prototype.setState=function(I,z){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,z,"setState")},b.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function P(){}P.prototype=b.prototype;function A(I,z,oe){this.props=I,this.context=z,this.refs=w,this.updater=oe||x}var j=A.prototype=new P;j.constructor=A,S(j,b.prototype),j.isPureReactComponent=!0;var T=Array.isArray,_=Object.prototype.hasOwnProperty,O={current:null},C={key:!0,ref:!0,__self:!0,__source:!0};function M(I,z,oe){var ce,ve={},ge=null,Ee=null;if(z!=null)for(ce in z.ref!==void 0&&(Ee=z.ref),z.key!==void 0&&(ge=""+z.key),z)_.call(z,ce)&&!C.hasOwnProperty(ce)&&(ve[ce]=z[ce]);var Se=arguments.length-2;if(Se===1)ve.children=oe;else if(1>>1,z=G[I];if(0>>1;Ia(ve,W))gea(Ee,ve)?(G[I]=Ee,G[ge]=W,I=ge):(G[I]=ve,G[ce]=W,I=ce);else if(gea(Ee,W))G[I]=Ee,G[ge]=W,I=ge;else break e}}return Z}function a(G,Z){var W=G.sortIndex-Z.sortIndex;return W!==0?W:G.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],h=1,v=null,m=3,x=!1,S=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(G){for(var Z=r(d);Z!==null;){if(Z.callback===null)n(d);else if(Z.startTime<=G)n(d),Z.sortIndex=Z.expirationTime,t(f,Z);else break;Z=r(d)}}function T(G){if(w=!1,j(G),!S)if(r(f)!==null)S=!0,J(_);else{var Z=r(d);Z!==null&&te(T,Z.startTime-G)}}function _(G,Z){S=!1,w&&(w=!1,P(M),M=-1),x=!0;var W=m;try{for(j(Z),v=r(f);v!==null&&(!(v.expirationTime>Z)||G&&!F());){var I=v.callback;if(typeof I=="function"){v.callback=null,m=v.priorityLevel;var z=I(v.expirationTime<=Z);Z=e.unstable_now(),typeof z=="function"?v.callback=z:v===r(f)&&n(f),j(Z)}else n(f);v=r(f)}if(v!==null)var oe=!0;else{var ce=r(d);ce!==null&&te(T,ce.startTime-Z),oe=!1}return oe}finally{v=null,m=W,x=!1}}var O=!1,C=null,M=-1,$=5,K=-1;function F(){return!(e.unstable_now()-K<$)}function B(){if(C!==null){var G=e.unstable_now();K=G;var Z=!0;try{Z=C(!0,G)}finally{Z?H():(O=!1,C=null)}}else O=!1}var H;if(typeof A=="function")H=function(){A(B)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,X=Y.port2;Y.port1.onmessage=B,H=function(){X.postMessage(null)}}else H=function(){b(B,0)};function J(G){C=G,O||(O=!0,H())}function te(G,Z){M=b(function(){G(e.unstable_now())},Z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(G){G.callback=null},e.unstable_continueExecution=function(){S||x||(S=!0,J(_))},e.unstable_forceFrameRate=function(G){0>G||125I?(G.sortIndex=W,t(d,G),r(f)===null&&G===r(d)&&(w?(P(M),M=-1):w=!0,te(T,W-I))):(G.sortIndex=z,t(f,G),S||x||(S=!0,J(_))),G},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(G){var Z=m;return function(){var W=m;m=Z;try{return G.apply(this,arguments)}finally{m=W}}}})(Md)),Md}var Qx;function aC(){return Qx||(Qx=1,Cd.exports=iC()),Cd.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Zx;function oC(){if(Zx)return zt;Zx=1;var e=tg(),t=aC();function r(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,d=/^[: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]*$/,h={},v={};function m(i){return f.call(v,i)?!0:f.call(h,i)?!1:d.test(i)?v[i]=!0:(h[i]=!0,!1)}function x(i,o,s,p){if(s!==null&&s.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return p?!1:s!==null?!s.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function S(i,o,s,p){if(o===null||typeof o>"u"||x(i,o,s,p))return!0;if(p)return!1;if(s!==null)switch(s.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function w(i,o,s,p,y,g,E){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=p,this.attributeNamespace=y,this.mustUseProperty=s,this.propertyName=i,this.type=o,this.sanitizeURL=g,this.removeEmptyString=E}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){b[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];b[o]=new w(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){b[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){b[i]=new w(i,2,!1,i,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(i){b[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){b[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){b[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){b[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){b[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function A(i){return i[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(i){var o=i.replace(P,A);b[o]=new w(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(P,A);b[o]=new w(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(P,A);b[o]=new w(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){b[i]=new w(i,1,!1,i.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){b[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function j(i,o,s,p){var y=b.hasOwnProperty(o)?b[o]:null;(y!==null?y.type!==0:p||!(2N||y[E]!==g[N]){var R=` +`+y[E].replace(" at new "," at ");return i.displayName&&R.includes("")&&(R=R.replace("",i.displayName)),R}while(1<=E&&0<=N);break}}}finally{oe=!1,Error.prepareStackTrace=s}return(i=i?i.displayName||i.name:"")?z(i):""}function ve(i){switch(i.tag){case 5:return z(i.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return i=ce(i.type,!1),i;case 11:return i=ce(i.type.render,!1),i;case 1:return i=ce(i.type,!0),i;default:return""}}function ge(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case O:return"Portal";case $:return"Profiler";case M:return"StrictMode";case H:return"Suspense";case Y:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case F:return(i.displayName||"Context")+".Consumer";case K:return(i._context.displayName||"Context")+".Provider";case B:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case X:return o=i.displayName||null,o!==null?o:ge(i.type)||"Memo";case J:o=i._payload,i=i._init;try{return ge(i(o))}catch{}}return null}function Ee(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ge(o);case 8:return o===M?"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 o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Se(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ue(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function be(i){var o=ue(i)?"checked":"value",s=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),p=""+i[o];if(!i.hasOwnProperty(o)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var y=s.get,g=s.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return y.call(this)},set:function(E){p=""+E,g.call(this,E)}}),Object.defineProperty(i,o,{enumerable:s.enumerable}),{getValue:function(){return p},setValue:function(E){p=""+E},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Pe(i){i._valueTracker||(i._valueTracker=be(i))}function ie(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var s=o.getValue(),p="";return i&&(p=ue(i)?i.checked?"true":"false":i.value),i=p,i!==s?(o.setValue(i),!0):!1}function qe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Te(i,o){var s=o.checked;return W({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??i._wrapperState.initialChecked})}function et(i,o){var s=o.defaultValue==null?"":o.defaultValue,p=o.checked!=null?o.checked:o.defaultChecked;s=Se(o.value!=null?o.value:s),i._wrapperState={initialChecked:p,initialValue:s,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function tt(i,o){o=o.checked,o!=null&&j(i,"checked",o,!1)}function vt(i,o){tt(i,o);var s=Se(o.value),p=o.type;if(s!=null)p==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+s):i.value!==""+s&&(i.value=""+s);else if(p==="submit"||p==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?Er(i,o.type,s):o.hasOwnProperty("defaultValue")&&Er(i,o.type,Se(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function dr(i,o,s){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var p=o.type;if(!(p!=="submit"&&p!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,s||o===i.value||(i.value=o),i.defaultValue=o}s=i.name,s!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,s!==""&&(i.name=s)}function Er(i,o,s){(o!=="number"||qe(i.ownerDocument)!==i)&&(s==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+s&&(i.defaultValue=""+s))}var jr=Array.isArray;function $t(i,o,s,p){if(i=i.options,o){o={};for(var y=0;y"+o.valueOf().toString()+"",o=Nu.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function Ra(i,o){if(o){var s=i.firstChild;if(s&&s===i.lastChild&&s.nodeType===3){s.nodeValue=o;return}}i.textContent=o}var Da={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},ak=["Webkit","ms","Moz","O"];Object.keys(Da).forEach(function(i){ak.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),Da[o]=Da[i]})});function u0(i,o,s){return o==null||typeof o=="boolean"||o===""?"":s||typeof o!="number"||o===0||Da.hasOwnProperty(i)&&Da[i]?(""+o).trim():o+"px"}function l0(i,o){i=i.style;for(var s in o)if(o.hasOwnProperty(s)){var p=s.indexOf("--")===0,y=u0(s,o[s],p);s==="float"&&(s="cssFloat"),p?i.setProperty(s,y):i[s]=y}}var ok=W({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 Bc(i,o){if(o){if(ok[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(r(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(r(61))}if(o.style!=null&&typeof o.style!="object")throw Error(r(62))}}function qc(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){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 zc=null;function Fc(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Uc=null,_i=null,Oi=null;function s0(i){if(i=ao(i)){if(typeof Uc!="function")throw Error(r(280));var o=i.stateNode;o&&(o=rl(o),Uc(i.stateNode,i.type,o))}}function c0(i){_i?Oi?Oi.push(i):Oi=[i]:_i=i}function f0(){if(_i){var i=_i,o=Oi;if(Oi=_i=null,s0(i),o)for(i=0;i>>=0,i===0?32:31-(mk(i)/gk|0)|0}var Lu=64,Bu=4194304;function za(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function qu(i,o){var s=i.pendingLanes;if(s===0)return 0;var p=0,y=i.suspendedLanes,g=i.pingedLanes,E=s&268435455;if(E!==0){var N=E&~y;N!==0?p=za(N):(g&=E,g!==0&&(p=za(g)))}else E=s&~y,E!==0?p=za(E):g!==0&&(p=za(g));if(p===0)return 0;if(o!==0&&o!==p&&(o&y)===0&&(y=p&-p,g=o&-o,y>=g||y===16&&(g&4194240)!==0))return o;if((p&4)!==0&&(p|=s&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=p;0s;s++)o.push(i);return o}function Fa(i,o,s){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-hr(o),i[o]=s}function Sk(i,o){var s=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var p=i.eventTimes;for(i=i.expirationTimes;0=Ya),B0=" ",q0=!1;function z0(i,o){switch(i){case"keyup":return Yk.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function F0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ei=!1;function Zk(i,o){switch(i){case"compositionend":return F0(o);case"keypress":return o.which!==32?null:(q0=!0,B0);case"textInput":return i=o.data,i===B0&&q0?null:i;default:return null}}function Jk(i,o){if(Ei)return i==="compositionend"||!lf&&z0(i,o)?(i=N0(),Hu=tf=vn=null,Ei=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:s,offset:o-i};i=p}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=X0(s)}}function Q0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Q0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Z0(){for(var i=window,o=qe();o instanceof i.HTMLIFrameElement;){try{var s=typeof o.contentWindow.location.href=="string"}catch{s=!1}if(s)i=o.contentWindow;else break;o=qe(i.document)}return o}function ff(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function l2(i){var o=Z0(),s=i.focusedElem,p=i.selectionRange;if(o!==s&&s&&s.ownerDocument&&Q0(s.ownerDocument.documentElement,s)){if(p!==null&&ff(s)){if(o=p.start,i=p.end,i===void 0&&(i=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(i,s.value.length);else if(i=(o=s.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var y=s.textContent.length,g=Math.min(p.start,y);p=p.end===void 0?g:Math.min(p.end,y),!i.extend&&g>p&&(y=p,p=g,g=y),y=Y0(s,g);var E=Y0(s,p);y&&E&&(i.rangeCount!==1||i.anchorNode!==y.node||i.anchorOffset!==y.offset||i.focusNode!==E.node||i.focusOffset!==E.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),i.removeAllRanges(),g>p?(i.addRange(o),i.extend(E.node,E.offset)):(o.setEnd(E.node,E.offset),i.addRange(o)))}}for(o=[],i=s;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,ji=null,df=null,eo=null,pf=!1;function J0(i,o,s){var p=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;pf||ji==null||ji!==qe(p)||(p=ji,"selectionStart"in p&&ff(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),eo&&Ja(eo,p)||(eo=p,p=Ju(df,"onSelect"),0Ni||(i.current=Pf[Ni],Pf[Ni]=null,Ni--)}function Ue(i,o){Ni++,Pf[Ni]=i.current,i.current=o}var bn={},Pt=gn(bn),Rt=gn(!1),Hn=bn;function Ii(i,o){var s=i.type.contextTypes;if(!s)return bn;var p=i.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===o)return p.__reactInternalMemoizedMaskedChildContext;var y={},g;for(g in s)y[g]=o[g];return p&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=y),y}function Dt(i){return i=i.childContextTypes,i!=null}function nl(){Ve(Rt),Ve(Pt)}function hb(i,o,s){if(Pt.current!==bn)throw Error(r(168));Ue(Pt,o),Ue(Rt,s)}function vb(i,o,s){var p=i.stateNode;if(o=o.childContextTypes,typeof p.getChildContext!="function")return s;p=p.getChildContext();for(var y in p)if(!(y in o))throw Error(r(108,Ee(i)||"Unknown",y));return W({},s,p)}function il(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||bn,Hn=Pt.current,Ue(Pt,i),Ue(Rt,Rt.current),!0}function yb(i,o,s){var p=i.stateNode;if(!p)throw Error(r(169));s?(i=vb(i,o,Hn),p.__reactInternalMemoizedMergedChildContext=i,Ve(Rt),Ve(Pt),Ue(Pt,i)):Ve(Rt),Ue(Rt,s)}var Ur=null,al=!1,Af=!1;function mb(i){Ur===null?Ur=[i]:Ur.push(i)}function x2(i){al=!0,mb(i)}function xn(){if(!Af&&Ur!==null){Af=!0;var i=0,o=Le;try{var s=Ur;for(Le=1;i>=E,y-=E,Wr=1<<32-hr(o)+y|s<Oe?(gt=we,we=null):gt=we.sibling;var Ie=re(U,we,V[Oe],le);if(Ie===null){we===null&&(we=gt);break}i&&we&&Ie.alternate===null&&o(U,we),L=g(Ie,L,Oe),xe===null?me=Ie:xe.sibling=Ie,xe=Ie,we=gt}if(Oe===V.length)return s(U,we),Ke&&Gn(U,Oe),me;if(we===null){for(;OeOe?(gt=we,we=null):gt=we.sibling;var Tn=re(U,we,Ie.value,le);if(Tn===null){we===null&&(we=gt);break}i&&we&&Tn.alternate===null&&o(U,we),L=g(Tn,L,Oe),xe===null?me=Tn:xe.sibling=Tn,xe=Tn,we=gt}if(Ie.done)return s(U,we),Ke&&Gn(U,Oe),me;if(we===null){for(;!Ie.done;Oe++,Ie=V.next())Ie=ae(U,Ie.value,le),Ie!==null&&(L=g(Ie,L,Oe),xe===null?me=Ie:xe.sibling=Ie,xe=Ie);return Ke&&Gn(U,Oe),me}for(we=p(U,we);!Ie.done;Oe++,Ie=V.next())Ie=fe(we,U,Oe,Ie.value,le),Ie!==null&&(i&&Ie.alternate!==null&&we.delete(Ie.key===null?Oe:Ie.key),L=g(Ie,L,Oe),xe===null?me=Ie:xe.sibling=Ie,xe=Ie);return i&&we.forEach(function(eC){return o(U,eC)}),Ke&&Gn(U,Oe),me}function at(U,L,V,le){if(typeof V=="object"&&V!==null&&V.type===C&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case _:e:{for(var me=V.key,xe=L;xe!==null;){if(xe.key===me){if(me=V.type,me===C){if(xe.tag===7){s(U,xe.sibling),L=y(xe,V.props.children),L.return=U,U=L;break e}}else if(xe.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===J&&_b(me)===xe.type){s(U,xe.sibling),L=y(xe,V.props),L.ref=oo(U,xe,V),L.return=U,U=L;break e}s(U,xe);break}else o(U,xe);xe=xe.sibling}V.type===C?(L=ti(V.props.children,U.mode,le,V.key),L.return=U,U=L):(le=Nl(V.type,V.key,V.props,null,U.mode,le),le.ref=oo(U,L,V),le.return=U,U=le)}return E(U);case O:e:{for(xe=V.key;L!==null;){if(L.key===xe)if(L.tag===4&&L.stateNode.containerInfo===V.containerInfo&&L.stateNode.implementation===V.implementation){s(U,L.sibling),L=y(L,V.children||[]),L.return=U,U=L;break e}else{s(U,L);break}else o(U,L);L=L.sibling}L=_d(V,U.mode,le),L.return=U,U=L}return E(U);case J:return xe=V._init,at(U,L,xe(V._payload),le)}if(jr(V))return he(U,L,V,le);if(Z(V))return ye(U,L,V,le);sl(U,V)}return typeof V=="string"&&V!==""||typeof V=="number"?(V=""+V,L!==null&&L.tag===6?(s(U,L.sibling),L=y(L,V),L.return=U,U=L):(s(U,L),L=Sd(V,U.mode,le),L.return=U,U=L),E(U)):s(U,L)}return at}var Li=Ob(!0),Pb=Ob(!1),cl=gn(null),fl=null,Bi=null,Mf=null;function Nf(){Mf=Bi=fl=null}function If(i){var o=cl.current;Ve(cl),i._currentValue=o}function $f(i,o,s){for(;i!==null;){var p=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),i===s)break;i=i.return}}function qi(i,o){fl=i,Mf=Bi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(Lt=!0),i.firstContext=null)}function er(i){var o=i._currentValue;if(Mf!==i)if(i={context:i,memoizedValue:o,next:null},Bi===null){if(fl===null)throw Error(r(308));Bi=i,fl.dependencies={lanes:0,firstContext:i}}else Bi=Bi.next=i;return o}var Kn=null;function Rf(i){Kn===null?Kn=[i]:Kn.push(i)}function Ab(i,o,s,p){var y=o.interleaved;return y===null?(s.next=s,Rf(o)):(s.next=y.next,y.next=s),o.interleaved=s,Vr(i,p)}function Vr(i,o){i.lanes|=o;var s=i.alternate;for(s!==null&&(s.lanes|=o),s=i,i=i.return;i!==null;)i.childLanes|=o,s=i.alternate,s!==null&&(s.childLanes|=o),s=i,i=i.return;return s.tag===3?s.stateNode:null}var wn=!1;function Df(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Eb(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Gr(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Sn(i,o,s){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(Me&2)!==0){var y=p.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),p.pending=o,Vr(i,s)}return y=p.interleaved,y===null?(o.next=o,Rf(p)):(o.next=y.next,y.next=o),p.interleaved=o,Vr(i,s)}function dl(i,o,s){if(o=o.updateQueue,o!==null&&(o=o.shared,(s&4194240)!==0)){var p=o.lanes;p&=i.pendingLanes,s|=p,o.lanes=s,Yc(i,s)}}function jb(i,o){var s=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,s===p)){var y=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var E={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};g===null?y=g=E:g=g.next=E,s=s.next}while(s!==null);g===null?y=g=o:g=g.next=o}else y=g=o;s={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:g,shared:p.shared,effects:p.effects},i.updateQueue=s;return}i=s.lastBaseUpdate,i===null?s.firstBaseUpdate=o:i.next=o,s.lastBaseUpdate=o}function pl(i,o,s,p){var y=i.updateQueue;wn=!1;var g=y.firstBaseUpdate,E=y.lastBaseUpdate,N=y.shared.pending;if(N!==null){y.shared.pending=null;var R=N,Q=R.next;R.next=null,E===null?g=Q:E.next=Q,E=R;var ne=i.alternate;ne!==null&&(ne=ne.updateQueue,N=ne.lastBaseUpdate,N!==E&&(N===null?ne.firstBaseUpdate=Q:N.next=Q,ne.lastBaseUpdate=R))}if(g!==null){var ae=y.baseState;E=0,ne=Q=R=null,N=g;do{var re=N.lane,fe=N.eventTime;if((p&re)===re){ne!==null&&(ne=ne.next={eventTime:fe,lane:0,tag:N.tag,payload:N.payload,callback:N.callback,next:null});e:{var he=i,ye=N;switch(re=o,fe=s,ye.tag){case 1:if(he=ye.payload,typeof he=="function"){ae=he.call(fe,ae,re);break e}ae=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ye.payload,re=typeof he=="function"?he.call(fe,ae,re):he,re==null)break e;ae=W({},ae,re);break e;case 2:wn=!0}}N.callback!==null&&N.lane!==0&&(i.flags|=64,re=y.effects,re===null?y.effects=[N]:re.push(N))}else fe={eventTime:fe,lane:re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ne===null?(Q=ne=fe,R=ae):ne=ne.next=fe,E|=re;if(N=N.next,N===null){if(N=y.shared.pending,N===null)break;re=N,N=re.next,re.next=null,y.lastBaseUpdate=re,y.shared.pending=null}}while(!0);if(ne===null&&(R=ae),y.baseState=R,y.firstBaseUpdate=Q,y.lastBaseUpdate=ne,o=y.shared.interleaved,o!==null){y=o;do E|=y.lane,y=y.next;while(y!==o)}else g===null&&(y.shared.lanes=0);Qn|=E,i.lanes=E,i.memoizedState=ae}}function Tb(i,o,s){if(i=o.effects,o.effects=null,i!==null)for(o=0;os?s:4,i(!0);var p=Ff.transition;Ff.transition={};try{i(!1),o()}finally{Le=s,Ff.transition=p}}function Kb(){return tr().memoizedState}function O2(i,o,s){var p=An(i);if(s={lane:p,action:s,hasEagerState:!1,eagerState:null,next:null},Xb(i))Yb(o,s);else if(s=Ab(i,o,s,p),s!==null){var y=Nt();xr(s,i,p,y),Qb(s,o,p)}}function P2(i,o,s){var p=An(i),y={lane:p,action:s,hasEagerState:!1,eagerState:null,next:null};if(Xb(i))Yb(o,y);else{var g=i.alternate;if(i.lanes===0&&(g===null||g.lanes===0)&&(g=o.lastRenderedReducer,g!==null))try{var E=o.lastRenderedState,N=g(E,s);if(y.hasEagerState=!0,y.eagerState=N,vr(N,E)){var R=o.interleaved;R===null?(y.next=y,Rf(o)):(y.next=R.next,R.next=y),o.interleaved=y;return}}catch{}finally{}s=Ab(i,o,y,p),s!==null&&(y=Nt(),xr(s,i,p,y),Qb(s,o,p))}}function Xb(i){var o=i.alternate;return i===Qe||o!==null&&o===Qe}function Yb(i,o){co=yl=!0;var s=i.pending;s===null?o.next=o:(o.next=s.next,s.next=o),i.pending=o}function Qb(i,o,s){if((s&4194240)!==0){var p=o.lanes;p&=i.pendingLanes,s|=p,o.lanes=s,Yc(i,s)}}var bl={readContext:er,useCallback:At,useContext:At,useEffect:At,useImperativeHandle:At,useInsertionEffect:At,useLayoutEffect:At,useMemo:At,useReducer:At,useRef:At,useState:At,useDebugValue:At,useDeferredValue:At,useTransition:At,useMutableSource:At,useSyncExternalStore:At,useId:At,unstable_isNewReconciler:!1},A2={readContext:er,useCallback:function(i,o){return Mr().memoizedState=[i,o===void 0?null:o],i},useContext:er,useEffect:qb,useImperativeHandle:function(i,o,s){return s=s!=null?s.concat([i]):null,ml(4194308,4,Ub.bind(null,o,i),s)},useLayoutEffect:function(i,o){return ml(4194308,4,i,o)},useInsertionEffect:function(i,o){return ml(4,2,i,o)},useMemo:function(i,o){var s=Mr();return o=o===void 0?null:o,i=i(),s.memoizedState=[i,o],i},useReducer:function(i,o,s){var p=Mr();return o=s!==void 0?s(o):o,p.memoizedState=p.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},p.queue=i,i=i.dispatch=O2.bind(null,Qe,i),[p.memoizedState,i]},useRef:function(i){var o=Mr();return i={current:i},o.memoizedState=i},useState:Lb,useDebugValue:Xf,useDeferredValue:function(i){return Mr().memoizedState=i},useTransition:function(){var i=Lb(!1),o=i[0];return i=_2.bind(null,i[1]),Mr().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,s){var p=Qe,y=Mr();if(Ke){if(s===void 0)throw Error(r(407));s=s()}else{if(s=o(),mt===null)throw Error(r(349));(Yn&30)!==0||Nb(p,o,s)}y.memoizedState=s;var g={value:s,getSnapshot:o};return y.queue=g,qb($b.bind(null,p,g,i),[i]),p.flags|=2048,ho(9,Ib.bind(null,p,g,s,o),void 0,null),s},useId:function(){var i=Mr(),o=mt.identifierPrefix;if(Ke){var s=Hr,p=Wr;s=(p&~(1<<32-hr(p)-1)).toString(32)+s,o=":"+o+"R"+s,s=fo++,0<\/script>",i=i.removeChild(i.firstChild)):typeof p.is=="string"?i=E.createElement(s,{is:p.is}):(i=E.createElement(s),s==="select"&&(E=i,p.multiple?E.multiple=!0:p.size&&(E.size=p.size))):i=E.createElementNS(i,s),i[kr]=o,i[io]=p,mx(i,o,!1,!1),o.stateNode=i;e:{switch(E=qc(s,p),s){case"dialog":He("cancel",i),He("close",i),y=p;break;case"iframe":case"object":case"embed":He("load",i),y=p;break;case"video":case"audio":for(y=0;yHi&&(o.flags|=128,p=!0,vo(g,!1),o.lanes=4194304)}else{if(!p)if(i=hl(E),i!==null){if(o.flags|=128,p=!0,s=i.updateQueue,s!==null&&(o.updateQueue=s,o.flags|=4),vo(g,!0),g.tail===null&&g.tailMode==="hidden"&&!E.alternate&&!Ke)return Et(o),null}else 2*it()-g.renderingStartTime>Hi&&s!==1073741824&&(o.flags|=128,p=!0,vo(g,!1),o.lanes=4194304);g.isBackwards?(E.sibling=o.child,o.child=E):(s=g.last,s!==null?s.sibling=E:o.child=E,g.last=E)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=it(),o.sibling=null,s=Ye.current,Ue(Ye,p?s&1|2:s&1),o):(Et(o),null);case 22:case 23:return bd(),p=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==p&&(o.flags|=8192),p&&(o.mode&1)!==0?(Gt&1073741824)!==0&&(Et(o),o.subtreeFlags&6&&(o.flags|=8192)):Et(o),null;case 24:return null;case 25:return null}throw Error(r(156,o.tag))}function I2(i,o){switch(jf(o),o.tag){case 1:return Dt(o.type)&&nl(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return zi(),Ve(Rt),Ve(Pt),zf(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Bf(o),null;case 13:if(Ve(Ye),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Di()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Ve(Ye),null;case 4:return zi(),null;case 10:return If(o.type._context),null;case 22:case 23:return bd(),null;case 24:return null;default:return null}}var _l=!1,jt=!1,$2=typeof WeakSet=="function"?WeakSet:Set,de=null;function Ui(i,o){var s=i.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(p){rt(i,o,p)}else s.current=null}function ud(i,o,s){try{s()}catch(p){rt(i,o,p)}}var xx=!1;function R2(i,o){if(bf=Uu,i=Z0(),ff(i)){if("selectionStart"in i)var s={start:i.selectionStart,end:i.selectionEnd};else e:{s=(s=i.ownerDocument)&&s.defaultView||window;var p=s.getSelection&&s.getSelection();if(p&&p.rangeCount!==0){s=p.anchorNode;var y=p.anchorOffset,g=p.focusNode;p=p.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var E=0,N=-1,R=-1,Q=0,ne=0,ae=i,re=null;t:for(;;){for(var fe;ae!==s||y!==0&&ae.nodeType!==3||(N=E+y),ae!==g||p!==0&&ae.nodeType!==3||(R=E+p),ae.nodeType===3&&(E+=ae.nodeValue.length),(fe=ae.firstChild)!==null;)re=ae,ae=fe;for(;;){if(ae===i)break t;if(re===s&&++Q===y&&(N=E),re===g&&++ne===p&&(R=E),(fe=ae.nextSibling)!==null)break;ae=re,re=ae.parentNode}ae=fe}s=N===-1||R===-1?null:{start:N,end:R}}else s=null}s=s||{start:0,end:0}}else s=null;for(xf={focusedElem:i,selectionRange:s},Uu=!1,de=o;de!==null;)if(o=de,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,de=i;else for(;de!==null;){o=de;try{var he=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(he!==null){var ye=he.memoizedProps,at=he.memoizedState,U=o.stateNode,L=U.getSnapshotBeforeUpdate(o.elementType===o.type?ye:mr(o.type,ye),at);U.__reactInternalSnapshotBeforeUpdate=L}break;case 3:var V=o.stateNode.containerInfo;V.nodeType===1?V.textContent="":V.nodeType===9&&V.documentElement&&V.removeChild(V.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(le){rt(o,o.return,le)}if(i=o.sibling,i!==null){i.return=o.return,de=i;break}de=o.return}return he=xx,xx=!1,he}function yo(i,o,s){var p=o.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var y=p=p.next;do{if((y.tag&i)===i){var g=y.destroy;y.destroy=void 0,g!==void 0&&ud(o,s,g)}y=y.next}while(y!==p)}}function Ol(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var s=o=o.next;do{if((s.tag&i)===i){var p=s.create;s.destroy=p()}s=s.next}while(s!==o)}}function ld(i){var o=i.ref;if(o!==null){var s=i.stateNode;switch(i.tag){case 5:i=s;break;default:i=s}typeof o=="function"?o(i):o.current=i}}function wx(i){var o=i.alternate;o!==null&&(i.alternate=null,wx(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[kr],delete o[io],delete o[Of],delete o[g2],delete o[b2])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function Sx(i){return i.tag===5||i.tag===3||i.tag===4}function _x(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Sx(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function sd(i,o,s){var p=i.tag;if(p===5||p===6)i=i.stateNode,o?s.nodeType===8?s.parentNode.insertBefore(i,o):s.insertBefore(i,o):(s.nodeType===8?(o=s.parentNode,o.insertBefore(i,s)):(o=s,o.appendChild(i)),s=s._reactRootContainer,s!=null||o.onclick!==null||(o.onclick=tl));else if(p!==4&&(i=i.child,i!==null))for(sd(i,o,s),i=i.sibling;i!==null;)sd(i,o,s),i=i.sibling}function cd(i,o,s){var p=i.tag;if(p===5||p===6)i=i.stateNode,o?s.insertBefore(i,o):s.appendChild(i);else if(p!==4&&(i=i.child,i!==null))for(cd(i,o,s),i=i.sibling;i!==null;)cd(i,o,s),i=i.sibling}var wt=null,gr=!1;function _n(i,o,s){for(s=s.child;s!==null;)Ox(i,o,s),s=s.sibling}function Ox(i,o,s){if(Tr&&typeof Tr.onCommitFiberUnmount=="function")try{Tr.onCommitFiberUnmount(Du,s)}catch{}switch(s.tag){case 5:jt||Ui(s,o);case 6:var p=wt,y=gr;wt=null,_n(i,o,s),wt=p,gr=y,wt!==null&&(gr?(i=wt,s=s.stateNode,i.nodeType===8?i.parentNode.removeChild(s):i.removeChild(s)):wt.removeChild(s.stateNode));break;case 18:wt!==null&&(gr?(i=wt,s=s.stateNode,i.nodeType===8?_f(i.parentNode,s):i.nodeType===1&&_f(i,s),Ga(i)):_f(wt,s.stateNode));break;case 4:p=wt,y=gr,wt=s.stateNode.containerInfo,gr=!0,_n(i,o,s),wt=p,gr=y;break;case 0:case 11:case 14:case 15:if(!jt&&(p=s.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){y=p=p.next;do{var g=y,E=g.destroy;g=g.tag,E!==void 0&&((g&2)!==0||(g&4)!==0)&&ud(s,o,E),y=y.next}while(y!==p)}_n(i,o,s);break;case 1:if(!jt&&(Ui(s,o),p=s.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=s.memoizedProps,p.state=s.memoizedState,p.componentWillUnmount()}catch(N){rt(s,o,N)}_n(i,o,s);break;case 21:_n(i,o,s);break;case 22:s.mode&1?(jt=(p=jt)||s.memoizedState!==null,_n(i,o,s),jt=p):_n(i,o,s);break;default:_n(i,o,s)}}function Px(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var s=i.stateNode;s===null&&(s=i.stateNode=new $2),o.forEach(function(p){var y=H2.bind(null,i,p);s.has(p)||(s.add(p),p.then(y,y))})}}function br(i,o){var s=o.deletions;if(s!==null)for(var p=0;py&&(y=E),p&=~g}if(p=y,p=it()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*L2(p/1960))-p,10i?16:i,Pn===null)var p=!1;else{if(i=Pn,Pn=null,Tl=0,(Me&6)!==0)throw Error(r(331));var y=Me;for(Me|=4,de=i.current;de!==null;){var g=de,E=g.child;if((de.flags&16)!==0){var N=g.deletions;if(N!==null){for(var R=0;Rit()-pd?Jn(i,0):dd|=s),qt(i,o)}function Lx(i,o){o===0&&((i.mode&1)===0?o=1:(o=Bu,Bu<<=1,(Bu&130023424)===0&&(Bu=4194304)));var s=Nt();i=Vr(i,o),i!==null&&(Fa(i,o,s),qt(i,s))}function W2(i){var o=i.memoizedState,s=0;o!==null&&(s=o.retryLane),Lx(i,s)}function H2(i,o){var s=0;switch(i.tag){case 13:var p=i.stateNode,y=i.memoizedState;y!==null&&(s=y.retryLane);break;case 19:p=i.stateNode;break;default:throw Error(r(314))}p!==null&&p.delete(o),Lx(i,s)}var Bx;Bx=function(i,o,s){if(i!==null)if(i.memoizedProps!==o.pendingProps||Rt.current)Lt=!0;else{if((i.lanes&s)===0&&(o.flags&128)===0)return Lt=!1,M2(i,o,s);Lt=(i.flags&131072)!==0}else Lt=!1,Ke&&(o.flags&1048576)!==0&&gb(o,ul,o.index);switch(o.lanes=0,o.tag){case 2:var p=o.type;Sl(i,o),i=o.pendingProps;var y=Ii(o,Pt.current);qi(o,s),y=Wf(null,o,p,i,y,s);var g=Hf();return o.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Dt(p)?(g=!0,il(o)):g=!1,o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,Df(o),y.updater=xl,o.stateNode=y,y._reactInternals=o,Qf(o,p,i,s),o=td(null,o,p,!0,g,s)):(o.tag=0,Ke&&g&&Ef(o),Mt(null,o,y,s),o=o.child),o;case 16:p=o.elementType;e:{switch(Sl(i,o),i=o.pendingProps,y=p._init,p=y(p._payload),o.type=p,y=o.tag=G2(p),i=mr(p,i),y){case 0:o=ed(null,o,p,i,s);break e;case 1:o=fx(null,o,p,i,s);break e;case 11:o=ox(null,o,p,i,s);break e;case 14:o=ux(null,o,p,mr(p.type,i),s);break e}throw Error(r(306,p,""))}return o;case 0:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:mr(p,y),ed(i,o,p,y,s);case 1:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:mr(p,y),fx(i,o,p,y,s);case 3:e:{if(dx(o),i===null)throw Error(r(387));p=o.pendingProps,g=o.memoizedState,y=g.element,Eb(i,o),pl(o,p,null,s);var E=o.memoizedState;if(p=E.element,g.isDehydrated)if(g={element:p,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},o.updateQueue.baseState=g,o.memoizedState=g,o.flags&256){y=Fi(Error(r(423)),o),o=px(i,o,p,s,y);break e}else if(p!==y){y=Fi(Error(r(424)),o),o=px(i,o,p,s,y);break e}else for(Vt=mn(o.stateNode.containerInfo.firstChild),Ht=o,Ke=!0,yr=null,s=Pb(o,null,p,s),o.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Di(),p===y){o=Kr(i,o,s);break e}Mt(i,o,p,s)}o=o.child}return o;case 5:return kb(o),i===null&&kf(o),p=o.type,y=o.pendingProps,g=i!==null?i.memoizedProps:null,E=y.children,wf(p,y)?E=null:g!==null&&wf(p,g)&&(o.flags|=32),cx(i,o),Mt(i,o,E,s),o.child;case 6:return i===null&&kf(o),null;case 13:return hx(i,o,s);case 4:return Lf(o,o.stateNode.containerInfo),p=o.pendingProps,i===null?o.child=Li(o,null,p,s):Mt(i,o,p,s),o.child;case 11:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:mr(p,y),ox(i,o,p,y,s);case 7:return Mt(i,o,o.pendingProps,s),o.child;case 8:return Mt(i,o,o.pendingProps.children,s),o.child;case 12:return Mt(i,o,o.pendingProps.children,s),o.child;case 10:e:{if(p=o.type._context,y=o.pendingProps,g=o.memoizedProps,E=y.value,Ue(cl,p._currentValue),p._currentValue=E,g!==null)if(vr(g.value,E)){if(g.children===y.children&&!Rt.current){o=Kr(i,o,s);break e}}else for(g=o.child,g!==null&&(g.return=o);g!==null;){var N=g.dependencies;if(N!==null){E=g.child;for(var R=N.firstContext;R!==null;){if(R.context===p){if(g.tag===1){R=Gr(-1,s&-s),R.tag=2;var Q=g.updateQueue;if(Q!==null){Q=Q.shared;var ne=Q.pending;ne===null?R.next=R:(R.next=ne.next,ne.next=R),Q.pending=R}}g.lanes|=s,R=g.alternate,R!==null&&(R.lanes|=s),$f(g.return,s,o),N.lanes|=s;break}R=R.next}}else if(g.tag===10)E=g.type===o.type?null:g.child;else if(g.tag===18){if(E=g.return,E===null)throw Error(r(341));E.lanes|=s,N=E.alternate,N!==null&&(N.lanes|=s),$f(E,s,o),E=g.sibling}else E=g.child;if(E!==null)E.return=g;else for(E=g;E!==null;){if(E===o){E=null;break}if(g=E.sibling,g!==null){g.return=E.return,E=g;break}E=E.return}g=E}Mt(i,o,y.children,s),o=o.child}return o;case 9:return y=o.type,p=o.pendingProps.children,qi(o,s),y=er(y),p=p(y),o.flags|=1,Mt(i,o,p,s),o.child;case 14:return p=o.type,y=mr(p,o.pendingProps),y=mr(p.type,y),ux(i,o,p,y,s);case 15:return lx(i,o,o.type,o.pendingProps,s);case 17:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:mr(p,y),Sl(i,o),o.tag=1,Dt(p)?(i=!0,il(o)):i=!1,qi(o,s),Jb(o,p,y),Qf(o,p,y,s),td(null,o,p,!0,i,s);case 19:return yx(i,o,s);case 22:return sx(i,o,s)}throw Error(r(156,o.tag))};function qx(i,o){return b0(i,o)}function V2(i,o,s,p){this.tag=i,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(i,o,s,p){return new V2(i,o,s,p)}function wd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function G2(i){if(typeof i=="function")return wd(i)?1:0;if(i!=null){if(i=i.$$typeof,i===B)return 11;if(i===X)return 14}return 2}function jn(i,o){var s=i.alternate;return s===null?(s=nr(i.tag,o,i.key,i.mode),s.elementType=i.elementType,s.type=i.type,s.stateNode=i.stateNode,s.alternate=i,i.alternate=s):(s.pendingProps=o,s.type=i.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=i.flags&14680064,s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,o=i.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},s.sibling=i.sibling,s.index=i.index,s.ref=i.ref,s}function Nl(i,o,s,p,y,g){var E=2;if(p=i,typeof i=="function")wd(i)&&(E=1);else if(typeof i=="string")E=5;else e:switch(i){case C:return ti(s.children,y,g,o);case M:E=8,y|=8;break;case $:return i=nr(12,s,o,y|2),i.elementType=$,i.lanes=g,i;case H:return i=nr(13,s,o,y),i.elementType=H,i.lanes=g,i;case Y:return i=nr(19,s,o,y),i.elementType=Y,i.lanes=g,i;case te:return Il(s,y,g,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case K:E=10;break e;case F:E=9;break e;case B:E=11;break e;case X:E=14;break e;case J:E=16,p=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return o=nr(E,s,o,y),o.elementType=i,o.type=p,o.lanes=g,o}function ti(i,o,s,p){return i=nr(7,i,p,o),i.lanes=s,i}function Il(i,o,s,p){return i=nr(22,i,p,o),i.elementType=te,i.lanes=s,i.stateNode={isHidden:!1},i}function Sd(i,o,s){return i=nr(6,i,null,o),i.lanes=s,i}function _d(i,o,s){return o=nr(4,i.children!==null?i.children:[],i.key,o),o.lanes=s,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function K2(i,o,s,p,y){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xc(0),this.expirationTimes=Xc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xc(0),this.identifierPrefix=p,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Od(i,o,s,p,y,g,E,N,R){return i=new K2(i,o,s,N,R),o===1?(o=1,g===!0&&(o|=8)):o=0,g=nr(3,null,null,o),i.current=g,g.stateNode=i,g.memoizedState={element:p,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Df(g),i}function X2(i,o,s){var p=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),kd.exports=oC(),kd.exports}var ew;function lC(){if(ew)return Fl;ew=1;var e=uC();return Fl.createRoot=e.createRoot,Fl.hydrateRoot=e.hydrateRoot,Fl}var sC=lC();const cC="/assets/BrandSlot-B9l4dQxi.svg",Dy={TITLE:"Kiosk Voice Assistant",COPYRIGHT:"© 2026 Intel Corporation. All rights reserved.",VERSION:"2026.1.0"},Ze={startStream:"/api/v1/sessions/start-stream",pushAudio:e=>`/api/v1/sessions/${e}/audio`,endAudio:e=>`/api/v1/sessions/${e}/audio/end`,pollSession:e=>`/api/v1/sessions/${e}`,sessionAudioFile:(e,t)=>`/api/v1/sessions/${e}/audio/${encodeURIComponent(t)}`,products:"/api/v1/products",order:e=>`/api/v1/orders/${e}`,currentOrder:e=>`/api/v1/users/${encodeURIComponent(e)}/orders/current`,upsell:"/api/v1/upsell",ragContext:"/rag/api/v1/context",ragContextFile:"/rag/api/v1/context/file",ragModelInfo:"/rag/api/v1/model-info",ragPerformance:"/rag/api/v1/performance",asrModelInfo:"/asr/v1/model-info",asrPerformance:"/asr/v1/performance",ttsModelInfo:"/tts/v1/model-info",ttsPerformance:"/tts/v1/performance",metrics:"/metrics-svc/metrics",pipelineLatest:"/api/v1/pipeline/latest",identityEnabled:"/api/v1/identity/enabled",identityChallenge:"/api/v1/identity/challenge",identityVerify:"/api/v1/identity/verify",identityRegister:"/api/v1/identity/register"},$r={chunkSeconds:5,sampleRate:16e3,pollIntervalMs:350,perfRefreshMs:1e4,maxHistoryTurns:4,userId:"kiosk-user"},UA=[{label:"QuickBite (QSR)",file:"QuickBite-M.md"},{label:"MegaRetail (Retail Store)",file:"MegaRetail-M.md"},{label:"SkyJet (Airline)",file:"SkyJet-S.md"}],fC=()=>k.jsx("header",{className:"sticky top-0 left-0 right-0 z-50 bg-intel-blue w-full flex items-center px-4 sm:px-6 border-b border-intel-blue-dark",style:{height:"60px"},children:k.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[k.jsx("img",{src:cC,alt:"Intel",className:"h-[44px] w-auto object-contain"}),k.jsxs("div",{className:"flex flex-col",children:[k.jsx("span",{className:"text-sm sm:text-base font-semibold text-white font-display leading-tight",children:Dy.TITLE}),k.jsxs("span",{className:"text-[10px] text-white/50 font-mono tracking-widest uppercase hidden sm:block",children:["AI Kiosk Assistant · v",Dy.VERSION]})]})]})}),dC=()=>k.jsx("footer",{className:"sticky bottom-0 left-0 right-0 w-full bg-intel-blue text-white text-center px-8 h-12 text-sm z-10 shadow-[0_-2px_8px_rgba(0,0,0,0.04)] border-t border-intel-blue-dark flex items-center justify-center font-text",children:k.jsx("span",{children:Dy.COPYRIGHT})});function Nd({role:e,text:t,streaming:r,isLatest:n}){const[a,u]=D.useState(!1),l=e==="user",c=async()=>{try{await navigator.clipboard.writeText(t),u(!0),setTimeout(()=>u(!1),2e3)}catch{}};return k.jsx("div",{className:`flex ${l?"justify-end":"justify-start"} kiosk-message-fade-in`,style:n?{animation:"messageSlideIn 0.3s ease-out"}:void 0,children:k.jsxs("div",{className:`group relative max-w-[80%] rounded-2xl px-4 py-3 text-sm whitespace-pre-wrap break-words shadow-sm transition-all duration-150 ${l?"bg-kiosk-user text-white rounded-br-sm hover:shadow-md":"bg-kiosk-asst text-intel-dark rounded-bl-sm hover:shadow-md"}`,children:[t,r?k.jsx("span",{className:"kiosk-cursor ml-0.5 inline-block",children:"▋"}):null,!l&&!r&&t&&k.jsx("button",{type:"button",onClick:()=>void c(),className:"absolute -top-2 -right-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 bg-white rounded-full p-1.5 shadow-md border border-kiosk-border hover:bg-kiosk-pane",title:"Copy message","aria-label":"Copy message to clipboard",children:a?k.jsx("svg",{className:"w-3.5 h-3.5 text-green-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:k.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):k.jsx("svg",{className:"w-3.5 h-3.5 text-intel-blue",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:k.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})})}function pC(){return k.jsx("div",{className:"flex justify-start",children:k.jsx("div",{className:"bg-kiosk-asst rounded-2xl rounded-bl-sm px-4 py-3 shadow-sm",children:k.jsxs("div",{className:"flex items-center space-x-1",children:[k.jsx("div",{className:"kiosk-typing-dot",style:{animationDelay:"0ms"}}),k.jsx("div",{className:"kiosk-typing-dot",style:{animationDelay:"200ms"}}),k.jsx("div",{className:"kiosk-typing-dot",style:{animationDelay:"400ms"}})]})})})}function hC(){const e=[{icon:"🍔",text:`"What's on the menu?"`},{icon:"🍕",text:'"Show me your burgers"'},{icon:"🛒",text:`"I'd like to order a burger"`},{icon:"⏰",text:'"What are your opening hours?"'}];return k.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center px-6",children:[k.jsx("div",{className:"text-6xl mb-4 animate-bounce-slow",children:"🤖"}),k.jsx("h2",{className:"text-2xl font-semibold text-intel-dark mb-2",children:"Welcome! I'm your kiosk assistant"}),k.jsx("p",{className:"text-kiosk-textmd mb-8 max-w-md",children:"Ask me anything about our menu, place an order, or get help"}),k.jsxs("div",{className:"mb-8",children:[k.jsx("p",{className:"text-xs text-kiosk-textlo uppercase tracking-wide font-medium mb-3",children:"Try asking:"}),k.jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map((t,r)=>k.jsxs("div",{className:"flex items-center space-x-2 bg-white rounded-lg border border-kiosk-border px-4 py-3 text-sm text-kiosk-textmd hover:border-intel-blue hover:bg-kiosk-pane transition-all duration-150 cursor-pointer",children:[k.jsx("span",{className:"text-lg",children:t.icon}),k.jsx("span",{children:t.text})]},r))})]}),k.jsxs("p",{className:"text-xs text-kiosk-textlo flex items-center space-x-2",children:[k.jsx("span",{className:"text-lg",children:"🎤"}),k.jsx("span",{children:"Tap the microphone below to start speaking"})]})]})}function vC({messages:e,partialUser:t,partialAssistant:r,phase:n}){const a=D.useRef(null);D.useEffect(()=>{var d;(d=a.current)==null||d.scrollIntoView({behavior:"smooth",block:"end"})},[e,t,r]);const u=(n==="listening"||n==="processing")&&!!t,l=n==="processing"&&!!r,c=n==="processing"&&!r&&e.length>0,f=e.length===0&&!u&&!l;return k.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-3",children:[f?k.jsx(hC,{}):null,e.map((d,h)=>k.jsx(Nd,{role:d.role,text:d.text,isLatest:h===e.length-1},h)),u?k.jsx(Nd,{role:"user",text:t,streaming:!0}):null,l?k.jsx(Nd,{role:"assistant",text:r,streaming:!0}):null,c?k.jsx(pC,{}):null,k.jsx("div",{ref:a})]})}function yC({phase:e,locked:t,onStart:r,onStop:n}){const a=e==="listening",u=e==="processing",l=t||u,c=()=>{l||(a?n():r())},f="relative flex items-center justify-center w-20 h-20 rounded-full text-3xl transition-all duration-200 shadow-lg focus:outline-none focus:ring-4",d=a?"bg-red-500 text-white kiosk-pulse-recording focus:ring-red-500/30 hover:bg-red-600":u?"bg-amber-500 text-white animate-spin-slow focus:ring-amber-500/30 cursor-wait":l?"bg-gray-300 text-gray-500 cursor-not-allowed opacity-50":"bg-intel-blue text-white hover:bg-intel-blue-dark hover:scale-105 focus:ring-intel-blue/30 active:scale-95",h=t?"Ingestion in progress...":u?"Processing...":a?"Recording... (tap to stop)":"Tap to speak",v=a?"text-red-500":u?"text-amber-500":l?"text-gray-400":"text-intel-blue";return k.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[k.jsxs("button",{type:"button",className:`${f} ${d}`,onClick:c,disabled:l,"aria-pressed":a,"aria-label":a?"Stop recording":"Start recording",title:h,children:[u?k.jsxs("svg",{className:"w-8 h-8 animate-spin-slow",viewBox:"0 0 24 24",fill:"none",children:[k.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),k.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):a?k.jsx("svg",{className:"w-8 h-8",viewBox:"0 0 24 24",fill:"currentColor",children:k.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}):k.jsxs("svg",{className:"w-8 h-8",viewBox:"0 0 24 24",fill:"currentColor",children:[k.jsx("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),k.jsx("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"})]}),a&&k.jsxs("div",{className:"absolute -bottom-1 flex items-end space-x-0.5 h-3",children:[k.jsx("div",{className:"kiosk-bar w-0.5 bg-white rounded-full"}),k.jsx("div",{className:"kiosk-bar w-0.5 bg-white rounded-full"}),k.jsx("div",{className:"kiosk-bar w-0.5 bg-white rounded-full"}),k.jsx("div",{className:"kiosk-bar w-0.5 bg-white rounded-full"})]})]}),k.jsx("div",{className:`text-sm font-medium ${v} transition-colors duration-200`,children:h})]})}function mC({phase:e,playbackState:t}){const r=t==="playing"||t==="queued";let n="",a=null,u="text-intel-blue";if(r)n="Assistant speaking...",a=k.jsxs("div",{className:"flex items-end gap-0.5 h-5","aria-hidden":!0,children:[k.jsx("span",{className:"kiosk-bar w-1 h-5 bg-intel-blue rounded-sm"}),k.jsx("span",{className:"kiosk-bar w-1 h-5 bg-intel-blue rounded-sm"}),k.jsx("span",{className:"kiosk-bar w-1 h-5 bg-intel-blue rounded-sm"}),k.jsx("span",{className:"kiosk-bar w-1 h-5 bg-intel-blue rounded-sm"})]});else if(e==="processing")n="Thinking...",u="text-amber-500",a=k.jsxs("svg",{className:"w-4 h-4 animate-spin-slow",viewBox:"0 0 24 24",fill:"none",children:[k.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),k.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});else if(e==="listening")n="Listening...",u="text-red-500",a=k.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[k.jsx("circle",{cx:"12",cy:"12",r:"3",className:"animate-pulse"}),k.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.3"})]});else return null;return k.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-2 rounded-full bg-white border border-gray-200 shadow-sm ${u} transition-all duration-200`,children:[a,k.jsx("span",{className:"text-xs font-medium",children:n})]})}const tw=[{id:"asr",label:"ASR",icon:"🎙",bg:"bg-asr-light",border:"border-asr",textColor:"text-asr-dark",glowColor:"rgba(234,88,12,0.4)"},{id:"retrieval",label:"Retrieval",icon:"🔍",bg:"bg-ret-light",border:"border-ret",textColor:"text-ret-dark",glowColor:"rgba(202,138,4,0.4)"},{id:"llm",label:"LLM",icon:"🧠",bg:"bg-llm-light",border:"border-llm",textColor:"text-llm-dark",glowColor:"rgba(8,145,178,0.4)"},{id:"tts",label:"TTS",icon:"🔊",bg:"bg-tts-light",border:"border-tts",textColor:"text-tts-dark",glowColor:"rgba(219,39,119,0.4)"}];function gC(e){var f,d,h,v,m,x,S,w,b,P;const t=e.pipeline;if(t)return{asr:((f=t.asr)==null?void 0:f.ms)??null,retrieval:(h=(d=t.agent)==null?void 0:d.retrieval)!=null&&h.invoked?t.agent.retrieval.ms??null:null,llm:((v=t.agent)==null?void 0:v.ttft_ms)??null,tts:((m=t.tts)==null?void 0:m.ms)??null,retrievalInvoked:((S=(x=t.agent)==null?void 0:x.retrieval)==null?void 0:S.invoked)??!1};const r=((w=e.asr)==null?void 0:w.perf)??{},n=((b=e.rag)==null?void 0:b.perf)??{},a=n.retrieval??{},u=n.llm??{},l=((P=e.tts)==null?void 0:P.perf)??{},c=A=>typeof A=="number"?A:null;return{asr:c(r.last_ms),retrieval:c(a.last_ms),llm:c(u.last_ms),tts:c(l.last_ms),retrievalInvoked:!0}}function Id(e,t=!0){return!t||e===null?"—":e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)} s`}function bC(e){const t=String(e??"").toUpperCase();return t.includes("GPU")?{label:"GPU",cls:"bg-gpu-light text-gpu-dark border-gpu-muted"}:t.includes("NPU")?{label:"NPU",cls:"bg-npu-light text-npu-dark border-npu-muted"}:t.includes("CPU")?{label:"CPU",cls:"bg-cpu-light text-cpu-dark border-cpu-muted"}:null}function xC(e){return e==="listening"?"asr":e==="processing"?"llm":e==="speaking"?"tts":null}function wC({kpis:e,phase:t}){var h,v,m,x,S,w,b,P,A,j;const r=gC(e),n=e.pipeline,a={asr:r.asr,retrieval:r.retrieval,llm:r.llm,tts:r.tts},u={asr:!0,retrieval:r.retrievalInvoked,llm:!0,tts:!0},l={asr:((h=e.asr)==null?void 0:h.device)??((v=n==null?void 0:n.asr)==null?void 0:v.device),retrieval:(m=e.rag)==null?void 0:m.embedding_device,llm:((S=(x=n==null?void 0:n.agent)==null?void 0:x.llm)==null?void 0:S.device)??((w=e.rag)==null?void 0:w.llm_device),tts:((b=e.tts)==null?void 0:b.device)??((P=n==null?void 0:n.tts)==null?void 0:P.device)},c=xC(t),f=((A=n==null?void 0:n.wall)==null?void 0:A.turn_total_ms)??null,d=((j=n==null?void 0:n.wall)==null?void 0:j.time_to_first_audio_ms)??null;return k.jsxs("div",{className:"space-y-3",children:[k.jsxs("div",{className:"flex items-center justify-between",children:[k.jsx("h2",{className:"text-xs font-semibold uppercase tracking-widest text-gray-400",children:"AI Inference Pipeline"}),k.jsxs("div",{className:"flex items-center gap-2",children:[d!==null&&k.jsxs("span",{className:"rounded-full bg-green-50 px-2 py-0.5 text-[10px] font-semibold text-green-700 border border-green-200",title:"Time to first audio — perceived response latency",children:["TTFA ",Id(d)]}),f!==null&&k.jsxs("span",{className:"rounded-full bg-intel-blue/10 px-2.5 py-0.5 text-[11px] font-semibold text-intel-blue",title:"Measured wall-clock E2E (not summed)",children:["E2E ",Id(f)]})]})]}),k.jsxs("div",{className:"flex items-stretch gap-0",children:[k.jsxs("div",{className:"flex flex-col items-center justify-center",children:[k.jsx("div",{className:`flex h-12 w-12 flex-col items-center justify-center rounded-full border-2 bg-white shadow-sm transition-all duration-300 ${t==="listening"?"border-asr animate-stage-pulse shadow-asr/30 shadow-md":"border-gray-200"}`,children:k.jsx("span",{className:"text-lg",children:"🎤"})}),k.jsx("span",{className:"mt-1 text-[10px] text-gray-400",children:"Input"})]}),tw.map((T,_)=>{const O=c===T.id,C=a[T.id],M=u[T.id],$=bC(l[T.id]);return k.jsxs("div",{className:"flex flex-1 items-stretch",children:[k.jsx("div",{className:"flex items-center justify-center px-1",children:k.jsxs("svg",{width:"24",height:"12",viewBox:"0 0 24 12",className:"overflow-visible",children:[k.jsx("line",{x1:"0",y1:"6",x2:"18",y2:"6",stroke:O?"#0071c5":M?"#cbd5e1":"#e5e7eb",strokeWidth:O?2.5:1.5,strokeDasharray:O?"4 2":M?void 0:"3 3",style:O?{animation:"dash-flow 0.8s linear infinite"}:void 0}),k.jsx("polygon",{points:"18,2 24,6 18,10",fill:O?"#0071c5":M?"#cbd5e1":"#e5e7eb"})]})}),k.jsxs("div",{className:` + relative flex flex-1 flex-col items-center justify-between rounded-lg border p-2 transition-all duration-300 + ${M?T.bg:"bg-gray-50"} ${M?T.border:"border-gray-200"} + ${O?"animate-stage-pulse shadow-lg":"shadow-sm hover:shadow-md"} + ${M?"":"opacity-50"} + `,style:O?{boxShadow:`0 0 16px 2px ${T.glowColor}`}:void 0,title:T.id==="retrieval"&&!M?"Not invoked this turn (ordering path)":T.id==="llm"?"Time to first token (TTFT)":void 0,children:[$&&M&&k.jsx("span",{className:`absolute -right-1 -top-2 rounded-full border px-1.5 py-0 text-[9px] font-bold ${$.cls}`,children:$.label}),k.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[k.jsx("span",{className:"text-base leading-none",children:T.icon}),k.jsx("span",{className:`text-[10px] font-semibold ${M?T.textColor:"text-gray-400"}`,children:T.label})]}),k.jsx("div",{className:`mt-1 rounded-full px-1.5 py-0.5 text-[10px] font-mono font-semibold ${M?T.textColor:"text-gray-400"} bg-white/70`,style:{animation:C!==null?"number-tick 0.25s ease-out":void 0},children:Id(C,M)},String(C)),O&&k.jsx("span",{className:"absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rounded-full bg-intel-blue shadow-sm"})]}),_===tw.length-1&&k.jsx("div",{className:"flex items-center justify-center px-1",children:k.jsxs("svg",{width:"24",height:"12",viewBox:"0 0 24 12",children:[k.jsx("line",{x1:"0",y1:"6",x2:"18",y2:"6",stroke:"#cbd5e1",strokeWidth:"1.5"}),k.jsx("polygon",{points:"18,2 24,6 18,10",fill:"#cbd5e1"})]})})]},T.id)}),k.jsxs("div",{className:"flex flex-col items-center justify-center",children:[k.jsx("div",{className:`flex h-12 w-12 flex-col items-center justify-center rounded-full border-2 bg-white shadow-sm transition-all duration-300 ${t==="speaking"?"border-tts animate-stage-pulse shadow-tts/30 shadow-md":"border-gray-200"}`,children:k.jsx("span",{className:"text-lg",children:"🔊"})}),k.jsx("span",{className:"mt-1 text-[10px] text-gray-400",children:"Output"})]})]}),n&&k.jsx("p",{className:"text-[9px] text-gray-400 text-right",children:"LLM = time-to-first-token · E2E = measured wall-clock (TTS overlaps LLM)"})]})}const No=e=>e==null||e===""?"—":String(e),$d=e=>No(e).split("/").pop()??"—",So=e=>typeof e=="number"?e<1e3?`${Math.round(e)}`:`${(e/1e3).toFixed(2)}`:"—",_o=e=>typeof e=="number"?e<1e3?"ms":"s":"";function Ul({icon:e,title:t,value:r,unit:n,sub:a,accentCls:u,valueCls:l,updated:c}){return k.jsxs("div",{className:` + relative flex flex-col rounded-xl border bg-white p-4 transition-all duration-300 + ${u} + ${c?"animate-kpi-glow":""} + `,children:[k.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[k.jsx("span",{className:"text-xl leading-none",children:e}),k.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest text-gray-400",children:t})]}),k.jsxs("div",{className:"flex items-baseline gap-1",children:[k.jsx("span",{className:`text-4xl font-bold font-mono leading-none tracking-tight ${l}`,style:{animation:r!=="—"?"number-tick 0.25s ease-out":void 0},children:r},r),n&&k.jsx("span",{className:`text-base font-semibold ${l} opacity-70`,children:n})]}),k.jsx("p",{className:"mt-2 text-[11px] leading-snug text-gray-400",children:a})]})}function SC({kpis:e}){var w,b,P,A,j,T,_,O,C,M;const t=((w=e.asr)==null?void 0:w.perf)??{},r=((b=e.rag)==null?void 0:b.perf)??{},n=r.retrieval??{},a=r.llm??{},u=((P=e.tts)==null?void 0:P.perf)??{},l=[t.last_ms,n.last_ms,a.last_ms,u.last_ms].filter($=>typeof $=="number"),c=l.length>0?l.reduce(($,K)=>$+K,0):null,f=No((A=e.asr)==null?void 0:A.device).toUpperCase()||"—",d=No((j=e.rag)==null?void 0:j.llm_device).toUpperCase()||"—",h=No((T=e.tts)==null?void 0:T.device).toUpperCase()||"—",v=$d((_=e.asr)==null?void 0:_.model),m=$d((O=e.rag)==null?void 0:O.llm_model),x=$d((C=e.tts)==null?void 0:C.model),S=l.length>0;return k.jsxs("div",{className:"space-y-2",children:[k.jsx("h2",{className:"text-xs font-semibold uppercase tracking-widest text-gray-400",children:"Performance KPIs"}),k.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[k.jsx(Ul,{icon:"⚡",title:"E2E Latency",value:So(c),unit:_o(c),sub:"Full pipeline round-trip",accentCls:"border-intel-blue/40",valueCls:"text-intel-blue",updated:S}),k.jsx(Ul,{icon:"🎙",title:"ASR Speed",value:So(t.last_ms),unit:_o(t.last_ms),sub:`${v} · ${f}`,accentCls:"border-asr/40",valueCls:"text-asr",updated:typeof t.last_ms=="number"}),k.jsx(Ul,{icon:"🧠",title:"LLM Latency",value:So(a.last_ms),unit:_o(a.last_ms),sub:`${m} · ${d}`,accentCls:"border-llm/40",valueCls:"text-llm",updated:typeof a.last_ms=="number"}),k.jsx(Ul,{icon:"🔊",title:"TTS Speed",value:So(u.last_ms),unit:_o(u.last_ms),sub:`${x} · ${h}`,accentCls:"border-tts/40",valueCls:"text-tts",updated:typeof u.last_ms=="number"})]}),k.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[k.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-ret/30 bg-white px-3 py-2",children:[k.jsx("span",{className:"text-lg",children:"🔍"}),k.jsxs("div",{className:"min-w-0",children:[k.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:"Retrieval"}),k.jsxs("p",{className:"font-mono text-lg font-bold text-ret",children:[So(n.last_ms),k.jsx("span",{className:"ml-1 text-xs font-normal opacity-70",children:_o(n.last_ms)})]})]})]}),k.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-gpu/30 bg-white px-3 py-2",children:[k.jsx("span",{className:"text-lg",children:"📚"}),k.jsxs("div",{className:"min-w-0",children:[k.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:"Docs Indexed"}),k.jsx("p",{className:"font-mono text-lg font-bold text-gpu",children:No((M=e.rag)==null?void 0:M.document_count)})]})]})]})]})}function WA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t-1}return dp=t,dp}var pp,Nw;function BC(){if(Nw)return pp;Nw=1;var e=uc();function t(r,n){var a=this.__data__,u=e(a,r);return u<0?(++this.size,a.push([r,n])):a[u][1]=n,this}return pp=t,pp}var hp,Iw;function lc(){if(Iw)return hp;Iw=1;var e=$C(),t=RC(),r=DC(),n=LC(),a=BC();function u(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c0?1:-1},oi=function(t){return pi(t)&&t.indexOf("%")===t.length-1},se=function(t){return lM(t)&&!Ea(t)},sM=function(t){return Ce(t)},pt=function(t){return se(t)||pi(t)},cM=0,Au=function(t){var r=++cM;return"".concat(t||"").concat(r)},hi=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!se(t)&&!pi(t))return n;var u;if(oi(t)){var l=t.indexOf("%");u=r*parseFloat(t.slice(0,l))/100}else u=+t;return Ea(u)&&(u=n),a&&u>r&&(u=r),u},Mn=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},fM=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gM(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 By(e){"@babel/helpers - typeof";return By=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},By(e)}var l1={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"},en=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},s1=null,qp=null,cg=function e(t){if(t===s1&&Array.isArray(qp))return qp;var r=[];return D.Children.forEach(t,function(n){Ce(n)||(iM.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),qp=r,s1=t,r};function Pr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return en(a)}):n=[en(t)],cg(e).forEach(function(a){var u=sr(a,"type.displayName")||sr(a,"type.name");n.indexOf(u)!==-1&&r.push(a)}),r}function Xt(e,t){var r=Pr(e,t);return r&&r[0]}var c1=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!se(n)||n<=0||!se(a)||a<=0)},bM=["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"],xM=function(t){return t&&t.type&&pi(t.type)&&bM.indexOf(t.type)>=0},wM=function(t){return t&&By(t)==="object"&&"clipDot"in t},SM=function(t,r,n,a){var u,l=(u=Bp==null?void 0:Bp[a])!==null&&u!==void 0?u:[];return r.startsWith("data-")||!Ae(t)&&(a&&l.includes(r)||hM.includes(r))||n&&sg.includes(r)},ke=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(D.isValidElement(t)&&(a=t.props),!Aa(a))return null;var u={};return Object.keys(a).forEach(function(l){var c;SM((c=a)===null||c===void 0?void 0:c[l],l,r,n)&&(u[l]=a[l])}),u},qy=function e(t,r){if(t===r)return!0;var n=D.Children.count(t);if(n!==D.Children.count(r))return!1;if(n===0)return!0;if(n===1)return f1(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EM(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,a=e.viewBox,u=e.className,l=e.style,c=e.title,f=e.desc,d=AM(e,PM),h=a||{width:r,height:n,x:0,y:0},v=Ne("recharts-surface",u);return q.createElement("svg",zy({},ke(d,!0,"svg"),{className:v,width:r,height:n,style:l,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),q.createElement("title",null,c),q.createElement("desc",null,f),t)}var jM=["children","className"];function Uy(){return Uy=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 kM(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 Je=q.forwardRef(function(e,t){var r=e.children,n=e.className,a=TM(e,jM),u=Ne("recharts-layer",n);return q.createElement("g",Uy({className:u},ke(a,!0),{ref:t}),r)}),tn=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),u=2;uu?0:u+r),n=n>u?u:n,n<0&&(n+=u),u=r>n?0:n-r>>>0,r>>>=0;for(var l=Array(u);++a=u?r:e(r,n,a)}return Fp=t,Fp}var Up,v1;function ZA(){if(v1)return Up;v1=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,u="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+e+a+u+"]");function f(d){return c.test(d)}return Up=f,Up}var Wp,y1;function NM(){if(y1)return Wp;y1=1;function e(t){return t.split("")}return Wp=e,Wp}var Hp,m1;function IM(){if(m1)return Hp;m1=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,u="\\ufe0e\\ufe0f",l="["+e+"]",c="["+a+"]",f="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+f+")",h="[^"+e+"]",v="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",S=d+"?",w="["+u+"]?",b="(?:"+x+"(?:"+[h,v,m].join("|")+")"+w+S+")*",P=w+S+b,A="(?:"+[h+c+"?",c,v,m,l].join("|")+")",j=RegExp(f+"(?="+f+")|"+A+P,"g");function T(_){return _.match(j)||[]}return Hp=T,Hp}var Vp,g1;function $M(){if(g1)return Vp;g1=1;var e=NM(),t=ZA(),r=IM();function n(a){return t(a)?r(a):e(a)}return Vp=n,Vp}var Gp,b1;function RM(){if(b1)return Gp;b1=1;var e=MM(),t=ZA(),r=$M(),n=KA();function a(u){return function(l){l=n(l);var c=t(l)?r(l):void 0,f=c?c[0]:l.charAt(0),d=c?e(c,1).join(""):l.slice(1);return f[u]()+d}}return Gp=a,Gp}var Kp,x1;function DM(){if(x1)return Kp;x1=1;var e=RM(),t=e("toUpperCase");return Kp=t,Kp}var LM=DM();const fc=Fe(LM);function We(e){return function(){return e}}const JA=Math.cos,fs=Math.sin,Ar=Math.sqrt,ds=Math.PI,dc=2*ds,Wy=Math.PI,Hy=2*Wy,ii=1e-6,BM=Hy-ii;function eE(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return eE;const r=10**t;return function(n){this._+=n[0];for(let a=1,u=n.length;aii)if(!(Math.abs(v*f-d*h)>ii)||!u)this._append`L${this._x1=t},${this._y1=r}`;else{let x=n-l,S=a-c,w=f*f+d*d,b=x*x+S*S,P=Math.sqrt(w),A=Math.sqrt(m),j=u*Math.tan((Wy-Math.acos((w+m-b)/(2*P*A)))/2),T=j/A,_=j/P;Math.abs(T-1)>ii&&this._append`L${t+T*h},${r+T*v}`,this._append`A${u},${u},0,0,${+(v*x>h*S)},${this._x1=t+_*f},${this._y1=r+_*d}`}}arc(t,r,n,a,u,l){if(t=+t,r=+r,n=+n,l=!!l,n<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(a),f=n*Math.sin(a),d=t+c,h=r+f,v=1^l,m=l?a-u:u-a;this._x1===null?this._append`M${d},${h}`:(Math.abs(this._x1-d)>ii||Math.abs(this._y1-h)>ii)&&this._append`L${d},${h}`,n&&(m<0&&(m=m%Hy+Hy),m>BM?this._append`A${n},${n},0,1,${v},${t-c},${r-f}A${n},${n},0,1,${v},${this._x1=d},${this._y1=h}`:m>ii&&this._append`A${n},${n},0,${+(m>=Wy)},${v},${this._x1=t+n*Math.cos(u)},${this._y1=r+n*Math.sin(u)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function fg(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 zM(t)}function dg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function tE(e){this._context=e}tE.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 pc(e){return new tE(e)}function rE(e){return e[0]}function nE(e){return e[1]}function iE(e,t){var r=We(!0),n=null,a=pc,u=null,l=fg(c);e=typeof e=="function"?e:e===void 0?rE:We(e),t=typeof t=="function"?t:t===void 0?nE:We(t);function c(f){var d,h=(f=dg(f)).length,v,m=!1,x;for(n==null&&(u=a(x=l())),d=0;d<=h;++d)!(d=x;--S)c.point(j[S],T[S]);c.lineEnd(),c.areaEnd()}P&&(j[m]=+e(b,m,v),T[m]=+t(b,m,v),c.point(n?+n(b,m,v):j[m],r?+r(b,m,v):T[m]))}if(A)return c=null,A+""||null}function h(){return iE().defined(a).curve(l).context(u)}return d.x=function(v){return arguments.length?(e=typeof v=="function"?v:We(+v),n=null,d):e},d.x0=function(v){return arguments.length?(e=typeof v=="function"?v:We(+v),d):e},d.x1=function(v){return arguments.length?(n=v==null?null:typeof v=="function"?v:We(+v),d):n},d.y=function(v){return arguments.length?(t=typeof v=="function"?v:We(+v),r=null,d):t},d.y0=function(v){return arguments.length?(t=typeof v=="function"?v:We(+v),d):t},d.y1=function(v){return arguments.length?(r=v==null?null:typeof v=="function"?v:We(+v),d):r},d.lineX0=d.lineY0=function(){return h().x(e).y(t)},d.lineY1=function(){return h().x(e).y(r)},d.lineX1=function(){return h().x(n).y(t)},d.defined=function(v){return arguments.length?(a=typeof v=="function"?v:We(!!v),d):a},d.curve=function(v){return arguments.length?(l=v,u!=null&&(c=l(u)),d):l},d.context=function(v){return arguments.length?(v==null?u=c=null:c=l(u=v),d):u},d}class aE{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 FM(e){return new aE(e,!0)}function UM(e){return new aE(e,!1)}const pg={draw(e,t){const r=Ar(t/ds);e.moveTo(r,0),e.arc(0,0,r,0,dc)}},WM={draw(e,t){const r=Ar(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()}},oE=Ar(1/3),HM=oE*2,VM={draw(e,t){const r=Ar(t/HM),n=r*oE;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},GM={draw(e,t){const r=Ar(t),n=-r/2;e.rect(n,n,r,r)}},KM=.8908130915292852,uE=fs(ds/10)/fs(7*ds/10),XM=fs(dc/10)*uE,YM=-JA(dc/10)*uE,QM={draw(e,t){const r=Ar(t*KM),n=XM*r,a=YM*r;e.moveTo(0,-r),e.lineTo(n,a);for(let u=1;u<5;++u){const l=dc*u/5,c=JA(l),f=fs(l);e.lineTo(f*r,-c*r),e.lineTo(c*n-f*a,f*n+c*a)}e.closePath()}},Xp=Ar(3),ZM={draw(e,t){const r=-Ar(t/(Xp*3));e.moveTo(0,r*2),e.lineTo(-Xp*r,-r),e.lineTo(Xp*r,-r),e.closePath()}},ir=-.5,ar=Ar(3)/2,Vy=1/Ar(12),JM=(Vy/2+1)*3,eN={draw(e,t){const r=Ar(t/JM),n=r/2,a=r*Vy,u=n,l=r*Vy+r,c=-u,f=l;e.moveTo(n,a),e.lineTo(u,l),e.lineTo(c,f),e.lineTo(ir*n-ar*a,ar*n+ir*a),e.lineTo(ir*u-ar*l,ar*u+ir*l),e.lineTo(ir*c-ar*f,ar*c+ir*f),e.lineTo(ir*n+ar*a,ir*a-ar*n),e.lineTo(ir*u+ar*l,ir*l-ar*u),e.lineTo(ir*c+ar*f,ir*f-ar*c),e.closePath()}};function tN(e,t){let r=null,n=fg(a);e=typeof e=="function"?e:We(e||pg),t=typeof t=="function"?t:We(t===void 0?64:+t);function a(){let u;if(r||(r=u=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),u)return r=null,u+""||null}return a.type=function(u){return arguments.length?(e=typeof u=="function"?u:We(u),a):e},a.size=function(u){return arguments.length?(t=typeof u=="function"?u:We(+u),a):t},a.context=function(u){return arguments.length?(r=u??null,a):r},a}function ps(){}function hs(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 lE(e){this._context=e}lE.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:hs(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:hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function rN(e){return new lE(e)}function sE(e){this._context=e}sE.prototype={areaStart:ps,areaEnd:ps,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:hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function nN(e){return new sE(e)}function cE(e){this._context=e}cE.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:hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function iN(e){return new cE(e)}function fE(e){this._context=e}fE.prototype={areaStart:ps,areaEnd:ps,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 aN(e){return new fE(e)}function w1(e){return e<0?-1:1}function S1(e,t,r){var n=e._x1-e._x0,a=t-e._x1,u=(e._y1-e._y0)/(n||a<0&&-0),l=(r-e._y1)/(a||n<0&&-0),c=(u*a+l*n)/(n+a);return(w1(u)+w1(l))*Math.min(Math.abs(u),Math.abs(l),.5*Math.abs(c))||0}function _1(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Yp(e,t,r){var n=e._x0,a=e._y0,u=e._x1,l=e._y1,c=(u-n)/3;e._context.bezierCurveTo(n+c,a+c*t,u-c,l-c*r,u,l)}function vs(e){this._context=e}vs.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:Yp(this,this._t0,_1(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,Yp(this,_1(this,r=S1(this,e,t)),r);break;default:Yp(this,this._t0,r=S1(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function dE(e){this._context=new pE(e)}(dE.prototype=Object.create(vs.prototype)).point=function(e,t){vs.prototype.point.call(this,t,e)};function pE(e){this._context=e}pE.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,a,u){this._context.bezierCurveTo(t,e,n,r,u,a)}};function oN(e){return new vs(e)}function uN(e){return new dE(e)}function hE(e){this._context=e}hE.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=O1(e),a=O1(t),u=0,l=1;l=0;--t)a[t]=(l[t]-a[t+1])/u[t];for(u[r-1]=(e[r]+a[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 sN(e){return new hc(e,.5)}function cN(e){return new hc(e,0)}function fN(e){return new hc(e,1)}function na(e,t){if((l=e.length)>1)for(var r=1,n,a,u=e[t[0]],l,c=u.length;r=0;)r[t]=t;return r}function dN(e,t){return e[t]}function pN(e){const t=[];return t.key=e,t}function hN(){var e=We([]),t=Gy,r=na,n=dN;function a(u){var l=Array.from(e.apply(this,arguments),pN),c,f=l.length,d=-1,h;for(const v of u)for(c=0,++d;c0){for(var r,n,a=0,u=e[0].length,l;a0){for(var r=0,n=e[t[0]],a,u=n.length;r0)||!((u=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,u,l;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function _N(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 vE={symbolCircle:pg,symbolCross:WM,symbolDiamond:VM,symbolSquare:GM,symbolStar:QM,symbolTriangle:ZM,symbolWye:eN},ON=Math.PI/180,PN=function(t){var r="symbol".concat(fc(t));return vE[r]||pg},AN=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 a=18*ON;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),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}},EN=function(t,r){vE["symbol".concat(fc(t))]=r},hg=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,u=a===void 0?64:a,l=t.sizeType,c=l===void 0?"area":l,f=SN(t,gN),d=A1(A1({},f),{},{type:n,size:u,sizeType:c}),h=function(){var b=PN(n),P=tN().type(b).size(AN(u,c,n));return P()},v=d.className,m=d.cx,x=d.cy,S=ke(d,!0);return m===+m&&x===+x&&u===+u?q.createElement("path",Ky({},S,{className:Ne("recharts-symbols",v),transform:"translate(".concat(m,", ").concat(x,")"),d:h()})):null};hg.registerSymbol=EN;function ia(e){"@babel/helpers - typeof";return ia=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},ia(e)}function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var A=x.inactive?d:x.color;return q.createElement("li",Xy({className:b,style:v,key:"legend-item-".concat(S)},cs(n.props,x,S)),q.createElement(Fy,{width:l,height:l,viewBox:h,style:m},n.renderIcon(x)),q.createElement("span",{className:"recharts-legend-item-text",style:{color:A}},w?w(P,x,S):P))})}},{key:"render",value:function(){var n=this.props,a=n.payload,u=n.layout,l=n.align;if(!a||!a.length)return null;var c={padding:0,margin:0,textAlign:u==="horizontal"?l:"left"};return q.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(D.PureComponent);Uo(vg,"displayName","Legend");Uo(vg,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Qp,j1;function DN(){if(j1)return Qp;j1=1;var e=lc();function t(){this.__data__=new e,this.size=0}return Qp=t,Qp}var Zp,T1;function LN(){if(T1)return Zp;T1=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Zp=e,Zp}var Jp,k1;function BN(){if(k1)return Jp;k1=1;function e(t){return this.__data__.get(t)}return Jp=e,Jp}var eh,C1;function qN(){if(C1)return eh;C1=1;function e(t){return this.__data__.has(t)}return eh=e,eh}var th,M1;function zN(){if(M1)return th;M1=1;var e=lc(),t=ag(),r=og(),n=200;function a(u,l){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.lengthx))return!1;var w=v.get(l),b=v.get(c);if(w&&b)return w==c&&b==l;var P=-1,A=!0,j=f&a?new e:void 0;for(v.set(l,c),v.set(c,l);++P-1&&n%1==0&&n-1&&r%1==0&&r<=e}return _h=t,_h}var Oh,rS;function eI(){if(rS)return Oh;rS=1;var e=ln(),t=bg(),r=sn(),n="[object Arguments]",a="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",d="[object Map]",h="[object Number]",v="[object Object]",m="[object RegExp]",x="[object Set]",S="[object String]",w="[object WeakMap]",b="[object ArrayBuffer]",P="[object DataView]",A="[object Float32Array]",j="[object Float64Array]",T="[object Int8Array]",_="[object Int16Array]",O="[object Int32Array]",C="[object Uint8Array]",M="[object Uint8ClampedArray]",$="[object Uint16Array]",K="[object Uint32Array]",F={};F[A]=F[j]=F[T]=F[_]=F[O]=F[C]=F[M]=F[$]=F[K]=!0,F[n]=F[a]=F[b]=F[u]=F[P]=F[l]=F[c]=F[f]=F[d]=F[h]=F[v]=F[m]=F[x]=F[S]=F[w]=!1;function B(H){return r(H)&&t(H.length)&&!!F[e(H)]}return Oh=B,Oh}var Ph,nS;function PE(){if(nS)return Ph;nS=1;function e(t){return function(r){return t(r)}}return Ph=e,Ph}var $o={exports:{}};$o.exports;var iS;function tI(){return iS||(iS=1,(function(e,t){var r=HA(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,u=a&&a.exports===n,l=u&&r.process,c=(function(){try{var f=a&&a.require&&a.require("util").types;return f||l&&l.binding&&l.binding("util")}catch{}})();e.exports=c})($o,$o.exports)),$o.exports}var Ah,aS;function AE(){if(aS)return Ah;aS=1;var e=eI(),t=PE(),r=tI(),n=r&&r.isTypedArray,a=n?t(n):e;return Ah=a,Ah}var Eh,oS;function rI(){if(oS)return Eh;oS=1;var e=QN(),t=mg(),r=Ut(),n=OE(),a=gg(),u=AE(),l=Object.prototype,c=l.hasOwnProperty;function f(d,h){var v=r(d),m=!v&&t(d),x=!v&&!m&&n(d),S=!v&&!m&&!x&&u(d),w=v||m||x||S,b=w?e(d.length,String):[],P=b.length;for(var A in d)(h||c.call(d,A))&&!(w&&(A=="length"||x&&(A=="offset"||A=="parent")||S&&(A=="buffer"||A=="byteLength"||A=="byteOffset")||a(A,P)))&&b.push(A);return b}return Eh=f,Eh}var jh,uS;function nI(){if(uS)return jh;uS=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return jh=t,jh}var Th,lS;function EE(){if(lS)return Th;lS=1;function e(t,r){return function(n){return t(r(n))}}return Th=e,Th}var kh,sS;function iI(){if(sS)return kh;sS=1;var e=EE(),t=e(Object.keys,Object);return kh=t,kh}var Ch,cS;function aI(){if(cS)return Ch;cS=1;var e=nI(),t=iI(),r=Object.prototype,n=r.hasOwnProperty;function a(u){if(!e(u))return t(u);var l=[];for(var c in Object(u))n.call(u,c)&&c!="constructor"&&l.push(c);return l}return Ch=a,Ch}var Mh,fS;function Eu(){if(fS)return Mh;fS=1;var e=ng(),t=bg();function r(n){return n!=null&&t(n.length)&&!e(n)}return Mh=r,Mh}var Nh,dS;function vc(){if(dS)return Nh;dS=1;var e=rI(),t=aI(),r=Eu();function n(a){return r(a)?e(a):t(a)}return Nh=n,Nh}var Ih,pS;function oI(){if(pS)return Ih;pS=1;var e=GN(),t=YN(),r=vc();function n(a){return e(a,r,t)}return Ih=n,Ih}var $h,hS;function uI(){if(hS)return $h;hS=1;var e=oI(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(u,l,c,f,d,h){var v=c&t,m=e(u),x=m.length,S=e(l),w=S.length;if(x!=w&&!v)return!1;for(var b=x;b--;){var P=m[b];if(!(v?P in l:n.call(l,P)))return!1}var A=h.get(u),j=h.get(l);if(A&&j)return A==l&&j==u;var T=!0;h.set(u,l),h.set(l,u);for(var _=v;++b-1}return uv=t,uv}var lv,zS;function EI(){if(zS)return lv;zS=1;function e(t,r,n){for(var a=-1,u=t==null?0:t.length;++a=l){var P=d?null:a(f);if(P)return u(P);S=!1,m=n,b=new e}else b=d?[]:w;e:for(;++v=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function FI(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 UI(e){return e.value}function WI(e,t){if(q.isValidElement(e))return q.cloneElement(e,t);if(typeof e=="function")return q.createElement(e,t);t.ref;var r=zI(t,NI);return q.createElement(vg,r)}var XS=1,ea=(function(e){function t(){var r;II(this,t);for(var n=arguments.length,a=new Array(n),u=0;uXS||Math.abs(a.height-this.lastBoundingBox.height)>XS)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(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?Yr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,u=a.layout,l=a.align,c=a.verticalAlign,f=a.margin,d=a.chartWidth,h=a.chartHeight,v,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(l==="center"&&u==="vertical"){var x=this.getBBoxSnapshot();v={left:((d||0)-x.width)/2}}else v=l==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(c==="middle"){var S=this.getBBoxSnapshot();m={top:((h||0)-S.height)/2}}else m=c==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return Yr(Yr({},v),m)}},{key:"render",value:function(){var n=this,a=this.props,u=a.content,l=a.width,c=a.height,f=a.wrapperStyle,d=a.payloadUniqBy,h=a.payload,v=Yr(Yr({position:"absolute",width:l||"auto",height:c||"auto"},this.getDefaultPosition(f)),f);return q.createElement("div",{className:"recharts-legend-wrapper",style:v,ref:function(x){n.wrapperNode=x}},WI(u,Yr(Yr({},this.props),{},{payload:ME(h,d,UI)})))}}],[{key:"getWithHeight",value:function(n,a){var u=Yr(Yr({},this.defaultProps),n.props),l=u.layout;return l==="vertical"&&se(n.props.height)?{height:n.props.height}:l==="horizontal"?{width:n.props.width||a}:null}}])})(D.PureComponent);yc(ea,"displayName","Legend");yc(ea,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var pv,YS;function HI(){if(YS)return pv;YS=1;var e=Pu(),t=mg(),r=Ut(),n=e?e.isConcatSpreadable:void 0;function a(u){return r(u)||t(u)||!!(n&&u&&u[n])}return pv=a,pv}var hv,QS;function $E(){if(QS)return hv;QS=1;var e=_E(),t=HI();function r(n,a,u,l,c){var f=-1,d=n.length;for(u||(u=t),c||(c=[]);++f0&&u(h)?a>1?r(h,a-1,u,l,c):e(c,h):l||(c[c.length]=h)}return c}return hv=r,hv}var vv,ZS;function VI(){if(ZS)return vv;ZS=1;function e(t){return function(r,n,a){for(var u=-1,l=Object(r),c=a(r),f=c.length;f--;){var d=c[t?f:++u];if(n(l[d],d,l)===!1)break}return r}}return vv=e,vv}var yv,JS;function GI(){if(JS)return yv;JS=1;var e=VI(),t=e();return yv=t,yv}var mv,e_;function RE(){if(e_)return mv;e_=1;var e=GI(),t=vc();function r(n,a){return n&&e(n,a,t)}return mv=r,mv}var gv,t_;function KI(){if(t_)return gv;t_=1;var e=Eu();function t(r,n){return function(a,u){if(a==null)return a;if(!e(a))return r(a,u);for(var l=a.length,c=n?l:-1,f=Object(a);(n?c--:++cn||c&&f&&h&&!d&&!v||u&&f&&h||!a&&h||!l)return 1;if(!u&&!c&&!v&&r=d)return h;var v=a[u];return h*(v=="desc"?-1:1)}}return r.index-n.index}return _v=t,_v}var Ov,u_;function ZI(){if(u_)return Ov;u_=1;var e=ug(),t=lg(),r=Ln(),n=DE(),a=XI(),u=PE(),l=QI(),c=ja(),f=Ut();function d(h,v,m){v.length?v=e(v,function(w){return f(w)?function(b){return t(b,w.length===1?w[0]:w)}:w}):v=[c];var x=-1;v=e(v,u(r));var S=n(h,function(w,b,P){var A=e(v,function(j){return j(w)});return{criteria:A,index:++x,value:w}});return a(S,function(w,b){return l(w,b,m)})}return Ov=d,Ov}var Pv,l_;function JI(){if(l_)return Pv;l_=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Pv=e,Pv}var Av,s_;function e$(){if(s_)return Av;s_=1;var e=JI(),t=Math.max;function r(n,a,u){return a=t(a===void 0?n.length-1:a,0),function(){for(var l=arguments,c=-1,f=t(l.length-a,0),d=Array(f);++c0){if(++u>=e)return arguments[0]}else u=0;return a.apply(void 0,arguments)}}return kv=n,kv}var Cv,h_;function i$(){if(h_)return Cv;h_=1;var e=r$(),t=n$(),r=t(e);return Cv=r,Cv}var Mv,v_;function a$(){if(v_)return Mv;v_=1;var e=ja(),t=e$(),r=i$();function n(a,u){return r(t(a,u,e),a+"")}return Mv=n,Mv}var Nv,y_;function mc(){if(y_)return Nv;y_=1;var e=ig(),t=Eu(),r=gg(),n=Dn();function a(u,l,c){if(!n(c))return!1;var f=typeof l;return(f=="number"?t(c)&&r(l,c.length):f=="string"&&l in c)?e(c[l],u):!1}return Nv=a,Nv}var Iv,m_;function o$(){if(m_)return Iv;m_=1;var e=$E(),t=ZI(),r=a$(),n=mc(),a=r(function(u,l){if(u==null)return[];var c=l.length;return c>1&&n(u,l[0],l[1])?l=[]:c>2&&n(l[0],l[1],l[2])&&(l=[l[0]]),t(u,e(l,1),[])});return Iv=a,Iv}var u$=o$();const Sg=Fe(u$);function Wo(e){"@babel/helpers - typeof";return Wo=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},Wo(e)}function Zy(){return Zy=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(Oo,"-left"),se(r)&&t&&se(t.x)&&r=t.y),"".concat(Oo,"-top"),se(n)&&t&&se(t.y)&&nw?Math.max(h,f[n]):Math.max(v,f[n])}function S$(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 _$(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,u=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,d,h,v;return l.height>0&&l.width>0&&r?(h=x_({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:u,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),v=x_({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:u,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),d=S$({translateX:h,translateY:v,useTranslate3d:c})):d=x$,{cssProperties:d,cssClasses:w$({translateX:h,translateY:v,coordinate:r})}}function oa(e){"@babel/helpers - typeof";return oa=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},oa(e)}function w_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function S_(e){for(var t=1;t__||Math.abs(n.height-this.state.lastBoundingBox.height)>__)&&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,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,u=a.active,l=a.allowEscapeViewBox,c=a.animationDuration,f=a.animationEasing,d=a.children,h=a.coordinate,v=a.hasPayload,m=a.isAnimationActive,x=a.offset,S=a.position,w=a.reverseDirection,b=a.useTranslate3d,P=a.viewBox,A=a.wrapperStyle,j=_$({allowEscapeViewBox:l,coordinate:h,offsetTopLeft:x,position:S,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:P}),T=j.cssClasses,_=j.cssProperties,O=S_(S_({transition:m&&u?"transform ".concat(c,"ms ").concat(f):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&u&&v?"visible":"hidden",position:"absolute",top:0,left:0},A);return q.createElement("div",{tabIndex:-1,className:T,style:O,ref:function(M){n.wrapperNode=M}},d)}}])})(D.PureComponent),N$=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Ta={isSsr:N$()};function ua(e){"@babel/helpers - typeof";return ua=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},ua(e)}function O_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function P_(e){for(var t=1;t0;return q.createElement(M$,{allowEscapeViewBox:l,animationDuration:c,animationEasing:f,isAnimationActive:m,active:u,coordinate:h,hasPayload:O,offset:x,position:b,reverseDirection:P,useTranslate3d:A,viewBox:j,wrapperStyle:T},U$(d,P_(P_({},this.props),{},{payload:_})))}}])})(D.PureComponent);_g(Ir,"displayName","Tooltip");_g(Ir,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Ta.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 Rv,A_;function W$(){if(A_)return Rv;A_=1;var e=zr(),t=function(){return e.Date.now()};return Rv=t,Rv}var Dv,E_;function H$(){if(E_)return Dv;E_=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Dv=t,Dv}var Lv,j_;function V$(){if(j_)return Lv;j_=1;var e=H$(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Lv=r,Lv}var Bv,T_;function UE(){if(T_)return Bv;T_=1;var e=V$(),t=Dn(),r=Pa(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function f(d){if(typeof d=="number")return d;if(r(d))return n;if(t(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=t(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=e(d);var v=u.test(d);return v||l.test(d)?c(d.slice(2),v?2:8):a.test(d)?n:+d}return Bv=f,Bv}var qv,k_;function G$(){if(k_)return qv;k_=1;var e=Dn(),t=W$(),r=UE(),n="Expected a function",a=Math.max,u=Math.min;function l(c,f,d){var h,v,m,x,S,w,b=0,P=!1,A=!1,j=!0;if(typeof c!="function")throw new TypeError(n);f=r(f)||0,e(d)&&(P=!!d.leading,A="maxWait"in d,m=A?a(r(d.maxWait)||0,f):m,j="trailing"in d?!!d.trailing:j);function T(H){var Y=h,X=v;return h=v=void 0,b=H,x=c.apply(X,Y),x}function _(H){return b=H,S=setTimeout(M,f),P?T(H):x}function O(H){var Y=H-w,X=H-b,J=f-Y;return A?u(J,m-X):J}function C(H){var Y=H-w,X=H-b;return w===void 0||Y>=f||Y<0||A&&X>=m}function M(){var H=t();if(C(H))return $(H);S=setTimeout(M,O(H))}function $(H){return S=void 0,j&&h?T(H):(h=v=void 0,x)}function K(){S!==void 0&&clearTimeout(S),b=0,h=w=v=S=void 0}function F(){return S===void 0?x:$(t())}function B(){var H=t(),Y=C(H);if(h=arguments,v=this,w=H,Y){if(S===void 0)return _(w);if(A)return clearTimeout(S),S=setTimeout(M,f),T(w)}return S===void 0&&(S=setTimeout(M,f)),x}return B.cancel=K,B.flush=F,B}return qv=l,qv}var zv,C_;function K$(){if(C_)return zv;C_=1;var e=G$(),t=Dn(),r="Expected a function";function n(a,u,l){var c=!0,f=!0;if(typeof a!="function")throw new TypeError(r);return t(l)&&(c="leading"in l?!!l.leading:c,f="trailing"in l?!!l.trailing:f),e(a,u,{leading:c,maxWait:u,trailing:f})}return zv=n,zv}var X$=K$();const WE=Fe(X$);function Vo(e){"@babel/helpers - typeof";return Vo=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},Vo(e)}function M_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Vl(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(H=WE(H,w,{trailing:!0,leading:!1}));var Y=new ResizeObserver(H),X=_.current.getBoundingClientRect(),J=X.width,te=X.height;return F(J,te),Y.observe(_.current),function(){Y.disconnect()}},[F,w]);var B=D.useMemo(function(){var H=$.containerWidth,Y=$.containerHeight;if(H<0||Y<0)return null;tn(oi(l)||oi(f),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,l,f),tn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var X=oi(l)?H:l,J=oi(f)?Y:f;r&&r>0&&(X?J=X/r:J&&(X=J*r),m&&J>m&&(J=m)),tn(X>0||J>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.`,X,J,l,f,h,v,r);var te=!Array.isArray(x)&&en(x.type).endsWith("Chart");return q.Children.map(x,function(G){return q.isValidElement(G)?D.cloneElement(G,Vl({width:X,height:J},te?{style:Vl({height:"100%",width:"100%",maxHeight:J,maxWidth:X},G.props.style)}:{})):G})},[r,x,f,m,v,h,$,l]);return q.createElement("div",{id:b?"".concat(b):void 0,className:Ne("recharts-responsive-container",P),style:Vl(Vl({},T),{},{width:l,height:f,minWidth:h,minHeight:v,maxHeight:m}),ref:_},B)}),HE=function(t){return null};HE.displayName="Cell";function Go(e){"@babel/helpers - typeof";return Go=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},Go(e)}function I_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rm(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ta.isSsr)return{width:0,height:0};var n=cR(r),a=JSON.stringify({text:t,copyStyle:n});if(Gi.widthCache[a])return Gi.widthCache[a];try{var u=document.getElementById($_);u||(u=document.createElement("span"),u.setAttribute("id",$_),u.setAttribute("aria-hidden","true"),document.body.appendChild(u));var l=rm(rm({},sR),n);Object.assign(u.style,l),u.textContent="".concat(t);var c=u.getBoundingClientRect(),f={width:c.width,height:c.height};return Gi.widthCache[a]=f,++Gi.cacheCount>lR&&(Gi.cacheCount=0,Gi.widthCache={}),f}catch{return{width:0,height:0}}},fR=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Ko(e){"@babel/helpers - typeof";return Ko=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},Ko(e)}function xs(e,t){return vR(e)||hR(e,t)||pR(e,t)||dR()}function dR(){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 pR(e,t){if(e){if(typeof e=="string")return R_(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 R_(e,t)}}function R_(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 TR(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 F_(e,t){return NR(e)||MR(e,t)||CR(e,t)||kR()}function kR(){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 CR(e,t){if(e){if(typeof e=="string")return U_(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 U_(e,t)}}function U_(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 X.reduce(function(J,te){var G=te.word,Z=te.width,W=J[J.length-1];if(W&&(a==null||u||W.width+Z+nte.width?J:te})};if(!h)return x;for(var w="…",b=function(X){var J=v.slice(0,X),te=XE({breakAll:d,style:f,children:J+w}).wordsWithComputedWidth,G=m(te),Z=G.length>l||S(G).width>Number(a);return[Z,G]},P=0,A=v.length-1,j=0,T;P<=A&&j<=v.length-1;){var _=Math.floor((P+A)/2),O=_-1,C=b(O),M=F_(C,2),$=M[0],K=M[1],F=b(_),B=F_(F,1),H=B[0];if(!$&&!H&&(P=_+1),$&&H&&(A=_-1),!$&&H){T=K;break}j++}return T||x},W_=function(t){var r=Ce(t)?[]:t.toString().split(KE);return[{words:r}]},$R=function(t){var r=t.width,n=t.scaleToFit,a=t.children,u=t.style,l=t.breakAll,c=t.maxLines;if((r||n)&&!Ta.isSsr){var f,d,h=XE({breakAll:l,children:a,style:u});if(h){var v=h.wordsWithComputedWidth,m=h.spaceWidth;f=v,d=m}else return W_(a);return IR({breakAll:l,children:a,maxLines:c,style:u},f,d,r,n)}return W_(a)},H_="#808080",ws=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,u=a===void 0?0:a,l=t.lineHeight,c=l===void 0?"1em":l,f=t.capHeight,d=f===void 0?"0.71em":f,h=t.scaleToFit,v=h===void 0?!1:h,m=t.textAnchor,x=m===void 0?"start":m,S=t.verticalAnchor,w=S===void 0?"end":S,b=t.fill,P=b===void 0?H_:b,A=z_(t,ER),j=D.useMemo(function(){return $R({breakAll:A.breakAll,children:A.children,maxLines:A.maxLines,scaleToFit:v,style:A.style,width:A.width})},[A.breakAll,A.children,A.maxLines,v,A.style,A.width]),T=A.dx,_=A.dy,O=A.angle,C=A.className,M=A.breakAll,$=z_(A,jR);if(!pt(n)||!pt(u))return null;var K=n+(se(T)?T:0),F=u+(se(_)?_:0),B;switch(w){case"start":B=Fv("calc(".concat(d,")"));break;case"middle":B=Fv("calc(".concat((j.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:B=Fv("calc(".concat(j.length-1," * -").concat(c,")"));break}var H=[];if(v){var Y=j[0].width,X=A.width;H.push("scale(".concat((se(X)?X/Y:1)/Y,")"))}return O&&H.push("rotate(".concat(O,", ").concat(K,", ").concat(F,")")),H.length&&($.transform=H.join(" ")),q.createElement("text",nm({},ke($,!0),{x:K,y:F,className:Ne("recharts-text",C),textAnchor:x,fill:P.includes("url")?H_:P}),j.map(function(J,te){var G=J.words.join(M?"":" ");return q.createElement("tspan",{x:K,dy:te===0?B:c,key:"".concat(G,"-").concat(te)},G)}))};function $n(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function RR(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Og(e){let t,r,n;e.length!==2?(t=$n,r=(c,f)=>$n(e(c),f),n=(c,f)=>e(c)-f):(t=e===$n||e===RR?e:DR,r=e,n=e);function a(c,f,d=0,h=c.length){if(d>>1;r(c[v],f)<0?d=v+1:h=v}while(d>>1;r(c[v],f)<=0?d=v+1:h=v}while(dd&&n(c[v-1],f)>-n(c[v],f)?v-1:v}return{left:a,center:l,right:u}}function DR(){return 0}function YE(e){return e===null?NaN:+e}function*LR(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const BR=Og($n),ju=BR.right;Og(YE).center;class V_ extends Map{constructor(t,r=FR){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(G_(this,t))}has(t){return super.has(G_(this,t))}set(t,r){return super.set(qR(this,t),r)}delete(t){return super.delete(zR(this,t))}}function G_({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function qR({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function zR({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function FR(e){return e!==null&&typeof e=="object"?e.valueOf():e}function UR(e=$n){if(e===$n)return QE;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 QE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const WR=Math.sqrt(50),HR=Math.sqrt(10),VR=Math.sqrt(2);function Ss(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),u=n/Math.pow(10,a),l=u>=WR?10:u>=HR?5:u>=VR?2:1;let c,f,d;return a<0?(d=Math.pow(10,-a)/l,c=Math.round(e*d),f=Math.round(t*d),c/dt&&--f,d=-d):(d=Math.pow(10,a)*l,c=Math.round(e/d),f=Math.round(t/d),c*dt&&--f),f0))return[];if(e===t)return[e];const n=t=a))return[];const c=u-a+1,f=new Array(c);if(n)if(l<0)for(let d=0;d=n)&&(r=n);return r}function X_(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function ZE(e,t,r=0,n=1/0,a){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(a=a===void 0?QE:UR(a);n>r;){if(n-r>600){const f=n-r+1,d=t-r+1,h=Math.log(f),v=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*v*(f-v)/f)*(d-f/2<0?-1:1),x=Math.max(r,Math.floor(t-d*v/f+m)),S=Math.min(n,Math.floor(t+(f-d)*v/f+m));ZE(e,t,x,S,a)}const u=e[t];let l=r,c=n;for(Po(e,r,t),a(e[n],u)>0&&Po(e,r,n);l0;)--c}a(e[r],u)===0?Po(e,r,c):(++c,Po(e,c,n)),c<=t&&(r=c+1),t<=c&&(n=c-1)}return e}function Po(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function GR(e,t,r){if(e=Float64Array.from(LR(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return X_(e);if(t>=1)return K_(e);var n,a=(n-1)*t,u=Math.floor(a),l=K_(ZE(e,u).subarray(0,u+1)),c=X_(e.subarray(u+1));return l+(c-l)*(a-u)}}function KR(e,t,r=YE){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,a=(n-1)*t,u=Math.floor(a),l=+r(e[u],u,e),c=+r(e[u+1],u+1,e);return l+(c-l)*(a-u)}}function XR(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,u=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Kl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Kl(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=QR.exec(e))?new Ft(t[1],t[2],t[3],1):(t=ZR.exec(e))?new Ft(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=JR.exec(e))?Kl(t[1],t[2],t[3],t[4]):(t=eD.exec(e))?Kl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=tD.exec(e))?rO(t[1],t[2]/100,t[3]/100,1):(t=rD.exec(e))?rO(t[1],t[2]/100,t[3]/100,t[4]):Y_.hasOwnProperty(e)?J_(Y_[e]):e==="transparent"?new Ft(NaN,NaN,NaN,0):null}function J_(e){return new Ft(e>>16&255,e>>8&255,e&255,1)}function Kl(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ft(e,t,r,n)}function aD(e){return e instanceof Tu||(e=Zo(e)),e?(e=e.rgb(),new Ft(e.r,e.g,e.b,e.opacity)):new Ft}function lm(e,t,r,n){return arguments.length===1?aD(e):new Ft(e,t,r,n??1)}function Ft(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Ag(Ft,lm,ej(Tu,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new Ft(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new Ft(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ft(fi(this.r),fi(this.g),fi(this.b),Os(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:eO,formatHex:eO,formatHex8:oD,formatRgb:tO,toString:tO}));function eO(){return`#${ui(this.r)}${ui(this.g)}${ui(this.b)}`}function oD(){return`#${ui(this.r)}${ui(this.g)}${ui(this.b)}${ui((isNaN(this.opacity)?1:this.opacity)*255)}`}function tO(){const e=Os(this.opacity);return`${e===1?"rgb(":"rgba("}${fi(this.r)}, ${fi(this.g)}, ${fi(this.b)}${e===1?")":`, ${e})`}`}function Os(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ui(e){return e=fi(e),(e<16?"0":"")+e.toString(16)}function rO(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new _r(e,t,r,n)}function tj(e){if(e instanceof _r)return new _r(e.h,e.s,e.l,e.opacity);if(e instanceof Tu||(e=Zo(e)),!e)return new _r;if(e instanceof _r)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),u=Math.max(t,r,n),l=NaN,c=u-a,f=(u+a)/2;return c?(t===u?l=(r-n)/c+(r0&&f<1?0:l,new _r(l,c,f,e.opacity)}function uD(e,t,r,n){return arguments.length===1?tj(e):new _r(e,t,r,n??1)}function _r(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Ag(_r,uD,ej(Tu,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new _r(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Yo:Math.pow(Yo,e),new _r(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,a=2*r-n;return new Ft(Uv(e>=240?e-240:e+120,a,n),Uv(e,a,n),Uv(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new _r(nO(this.h),Xl(this.s),Xl(this.l),Os(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=Os(this.opacity);return`${e===1?"hsl(":"hsla("}${nO(this.h)}, ${Xl(this.s)*100}%, ${Xl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nO(e){return e=(e||0)%360,e<0?e+360:e}function Xl(e){return Math.max(0,Math.min(1,e||0))}function Uv(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 Eg=e=>()=>e;function lD(e,t){return function(r){return e+r*t}}function sD(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 cD(e){return(e=+e)==1?rj:function(t,r){return r-t?sD(t,r,e):Eg(isNaN(t)?r:t)}}function rj(e,t){var r=t-e;return r?lD(e,r):Eg(isNaN(e)?t:e)}const iO=(function e(t){var r=cD(t);function n(a,u){var l=r((a=lm(a)).r,(u=lm(u)).r),c=r(a.g,u.g),f=r(a.b,u.b),d=rj(a.opacity,u.opacity);return function(h){return a.r=l(h),a.g=c(h),a.b=f(h),a.opacity=d(h),a+""}}return n.gamma=e,n})(1);function fD(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(u){for(a=0;ar&&(u=t.slice(r,u),c[l]?c[l]+=u:c[++l]=u),(n=n[0])===(a=a[0])?c[l]?c[l]+=a:c[++l]=a:(c[++l]=null,f.push({i:l,x:Ps(n,a)})),r=Wv.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function SD(e,t,r){var n=e[0],a=e[1],u=t[0],l=t[1];return a2?_D:SD,f=d=null,v}function v(m){return m==null||isNaN(m=+m)?u:(f||(f=c(e.map(n),t,r)))(n(l(m)))}return v.invert=function(m){return l(a((d||(d=c(t,e.map(n),Ps)))(m)))},v.domain=function(m){return arguments.length?(e=Array.from(m,As),h()):e.slice()},v.range=function(m){return arguments.length?(t=Array.from(m),h()):t.slice()},v.rangeRound=function(m){return t=Array.from(m),r=jg,h()},v.clamp=function(m){return arguments.length?(l=m?!0:It,h()):l!==It},v.interpolate=function(m){return arguments.length?(r=m,h()):r},v.unknown=function(m){return arguments.length?(u=m,v):u},function(m,x){return n=m,a=x,h()}}function Tg(){return gc()(It,It)}function OD(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Es(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 la(e){return e=Es(Math.abs(e)),e?e[1]:NaN}function PD(e,t){return function(r,n){for(var a=r.length,u=[],l=0,c=e[0],f=0;a>0&&c>0&&(f+c+1>n&&(c=Math.max(1,n-f)),u.push(r.substring(a-=c,a+c)),!((f+=c+1)>n));)c=e[l=(l+1)%e.length];return u.reverse().join(t)}}function AD(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var ED=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Jo(e){if(!(t=ED.exec(e)))throw new Error("invalid format: "+e);var t;return new kg({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]})}Jo.prototype=kg.prototype;function kg(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+""}kg.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 jD(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var js;function TD(e,t){var r=Es(e,t);if(!r)return js=void 0,e.toPrecision(t);var n=r[0],a=r[1],u=a-(js=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,l=n.length;return u===l?n:u>l?n+new Array(u-l+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+new Array(1-u).join("0")+Es(e,Math.max(0,t+u-1))[0]}function oO(e,t){var r=Es(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const uO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:OD,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)=>oO(e*100,t),r:oO,s:TD,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lO(e){return e}var sO=Array.prototype.map,cO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function kD(e){var t=e.grouping===void 0||e.thousands===void 0?lO:PD(sO.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",u=e.numerals===void 0?lO:AD(sO.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function d(v,m){v=Jo(v);var x=v.fill,S=v.align,w=v.sign,b=v.symbol,P=v.zero,A=v.width,j=v.comma,T=v.precision,_=v.trim,O=v.type;O==="n"?(j=!0,O="g"):uO[O]||(T===void 0&&(T=12),_=!0,O="g"),(P||x==="0"&&S==="=")&&(P=!0,x="0",S="=");var C=(m&&m.prefix!==void 0?m.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),M=(b==="$"?n:/[%p]/.test(O)?l:"")+(m&&m.suffix!==void 0?m.suffix:""),$=uO[O],K=/[defgprs%]/.test(O);T=T===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function F(B){var H=C,Y=M,X,J,te;if(O==="c")Y=$(B)+Y,B="";else{B=+B;var G=B<0||1/B<0;if(B=isNaN(B)?f:$(Math.abs(B),T),_&&(B=jD(B)),G&&+B==0&&w!=="+"&&(G=!1),H=(G?w==="("?w:c:w==="-"||w==="("?"":w)+H,Y=(O==="s"&&!isNaN(B)&&js!==void 0?cO[8+js/3]:"")+Y+(G&&w==="("?")":""),K){for(X=-1,J=B.length;++Xte||te>57){Y=(te===46?a+B.slice(X+1):B.slice(X))+Y,B=B.slice(0,X);break}}}j&&!P&&(B=t(B,1/0));var Z=H.length+B.length+Y.length,W=Z>1)+H+B+Y+W.slice(Z);break;default:B=W+H+B+Y;break}return u(B)}return F.toString=function(){return v+""},F}function h(v,m){var x=Math.max(-8,Math.min(8,Math.floor(la(m)/3)))*3,S=Math.pow(10,-x),w=d((v=Jo(v),v.type="f",v),{suffix:cO[8+x/3]});return function(b){return w(S*b)}}return{format:d,formatPrefix:h}}var Yl,Cg,nj;CD({thousands:",",grouping:[3],currency:["$",""]});function CD(e){return Yl=kD(e),Cg=Yl.format,nj=Yl.formatPrefix,Yl}function MD(e){return Math.max(0,-la(Math.abs(e)))}function ND(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(la(t)/3)))*3-la(Math.abs(e)))}function ID(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,la(t)-la(e))+1}function ij(e,t,r,n){var a=om(e,t,r),u;switch(n=Jo(n??",f"),n.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(u=ND(a,l))&&(n.precision=u),nj(n,l)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(u=ID(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=u-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(u=MD(a))&&(n.precision=u-(n.type==="%")*2);break}}return Cg(n)}function Bn(e){var t=e.domain;return e.ticks=function(r){var n=t();return im(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return ij(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,u=n.length-1,l=n[a],c=n[u],f,d,h=10;for(c0;){if(d=am(l,c,r),d===f)return n[a]=l,n[u]=c,t(n);if(d>0)l=Math.floor(l/d)*d,c=Math.ceil(c/d)*d;else if(d<0)l=Math.ceil(l*d)/d,c=Math.floor(c*d)/d;else break;f=d}return e},e}function Ts(){var e=Tg();return e.copy=function(){return ku(e,Ts())},fr.apply(e,arguments),Bn(e)}function aj(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,As),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return aj(e).unknown(t)},e=arguments.length?Array.from(e,As):[0,1],Bn(r)}function oj(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],u=e[n],l;return uMath.pow(e,t)}function BD(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 pO(e){return(t,r)=>-e(-t,r)}function Mg(e){const t=e(fO,dO),r=t.domain;let n=10,a,u;function l(){return a=BD(n),u=LD(n),r()[0]<0?(a=pO(a),u=pO(u),e($D,RD)):e(fO,dO),t}return t.base=function(c){return arguments.length?(n=+c,l()):n},t.domain=function(c){return arguments.length?(r(c),l()):r()},t.ticks=c=>{const f=r();let d=f[0],h=f[f.length-1];const v=h0){for(;m<=x;++m)for(S=1;Sh)break;P.push(w)}}else for(;m<=x;++m)for(S=n-1;S>=1;--S)if(w=m>0?S/u(-m):S*u(m),!(wh)break;P.push(w)}P.length*2{if(c==null&&(c=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Jo(f)).precision==null&&(f.trim=!0),f=Cg(f)),c===1/0)return f;const d=Math.max(1,n*c/t.ticks().length);return h=>{let v=h/u(Math.round(a(h)));return v*nr(oj(r(),{floor:c=>u(Math.floor(a(c))),ceil:c=>u(Math.ceil(a(c)))})),t}function uj(){const e=Mg(gc()).domain([1,10]);return e.copy=()=>ku(e,uj()).base(e.base()),fr.apply(e,arguments),e}function hO(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function vO(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ng(e){var t=1,r=e(hO(t),vO(t));return r.constant=function(n){return arguments.length?e(hO(t=+n),vO(t)):t},Bn(r)}function lj(){var e=Ng(gc());return e.copy=function(){return ku(e,lj()).constant(e.constant())},fr.apply(e,arguments)}function yO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function qD(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zD(e){return e<0?-e*e:e*e}function Ig(e){var t=e(It,It),r=1;function n(){return r===1?e(It,It):r===.5?e(qD,zD):e(yO(r),yO(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Bn(t)}function $g(){var e=Ig(gc());return e.copy=function(){return ku(e,$g()).exponent(e.exponent())},fr.apply(e,arguments),e}function FD(){return $g.apply(null,arguments).exponent(.5)}function mO(e){return Math.sign(e)*e*e}function UD(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function sj(){var e=Tg(),t=[0,1],r=!1,n;function a(u){var l=UD(e(u));return isNaN(l)?n:r?Math.round(l):l}return a.invert=function(u){return e.invert(mO(u))},a.domain=function(u){return arguments.length?(e.domain(u),a):e.domain()},a.range=function(u){return arguments.length?(e.range((t=Array.from(u,As)).map(mO)),a):t.slice()},a.rangeRound=function(u){return a.range(u).round(!0)},a.round=function(u){return arguments.length?(r=!!u,a):r},a.clamp=function(u){return arguments.length?(e.clamp(u),a):e.clamp()},a.unknown=function(u){return arguments.length?(n=u,a):n},a.copy=function(){return sj(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},fr.apply(a,arguments),Bn(a)}function cj(){var e=[],t=[],r=[],n;function a(){var l=0,c=Math.max(1,t.length);for(r=new Array(c-1);++l0?r[c-1]:e[0],c=r?[n[r-1],t]:[n[d-1],n[d]]},l.unknown=function(f){return arguments.length&&(u=f),l},l.thresholds=function(){return n.slice()},l.copy=function(){return fj().domain([e,t]).range(a).unknown(u)},fr.apply(Bn(l),arguments)}function dj(){var e=[.5],t=[0,1],r,n=1;function a(u){return u!=null&&u<=u?t[ju(e,u,0,n)]:r}return a.domain=function(u){return arguments.length?(e=Array.from(u),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(u){return arguments.length?(t=Array.from(u),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(u){var l=t.indexOf(u);return[e[l-1],e[l]]},a.unknown=function(u){return arguments.length?(r=u,a):r},a.copy=function(){return dj().domain(e).range(t).unknown(r)},fr.apply(a,arguments)}const Hv=new Date,Vv=new Date;function ht(e,t,r,n){function a(u){return e(u=arguments.length===0?new Date:new Date(+u)),u}return a.floor=u=>(e(u=new Date(+u)),u),a.ceil=u=>(e(u=new Date(u-1)),t(u,1),e(u),u),a.round=u=>{const l=a(u),c=a.ceil(u);return u-l(t(u=new Date(+u),l==null?1:Math.floor(l)),u),a.range=(u,l,c)=>{const f=[];if(u=a.ceil(u),c=c==null?1:Math.floor(c),!(u0))return f;let d;do f.push(d=new Date(+u)),t(u,c),e(u);while(dht(l=>{if(l>=l)for(;e(l),!u(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!u(l););else for(;--c>=0;)for(;t(l,1),!u(l););}),r&&(a.count=(u,l)=>(Hv.setTime(+u),Vv.setTime(+l),e(Hv),e(Vv),Math.floor(r(Hv,Vv))),a.every=u=>(u=Math.floor(u),!isFinite(u)||!(u>0)?null:u>1?a.filter(n?l=>n(l)%u===0:l=>a.count(0,l)%u===0):a)),a}const ks=ht(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ks.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?ht(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ks);ks.range;const Qr=1e3,lr=Qr*60,Zr=lr*60,nn=Zr*24,Rg=nn*7,gO=nn*30,Gv=nn*365,li=ht(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Qr)},(e,t)=>(t-e)/Qr,e=>e.getUTCSeconds());li.range;const Dg=ht(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Qr)},(e,t)=>{e.setTime(+e+t*lr)},(e,t)=>(t-e)/lr,e=>e.getMinutes());Dg.range;const Lg=ht(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*lr)},(e,t)=>(t-e)/lr,e=>e.getUTCMinutes());Lg.range;const Bg=ht(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Qr-e.getMinutes()*lr)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getHours());Bg.range;const qg=ht(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCHours());qg.range;const Cu=ht(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*lr)/nn,e=>e.getDate()-1);Cu.range;const bc=ht(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/nn,e=>e.getUTCDate()-1);bc.range;const pj=ht(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/nn,e=>Math.floor(e/nn));pj.range;function bi(e){return ht(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())*lr)/Rg)}const xc=bi(0),Cs=bi(1),WD=bi(2),HD=bi(3),sa=bi(4),VD=bi(5),GD=bi(6);xc.range;Cs.range;WD.range;HD.range;sa.range;VD.range;GD.range;function xi(e){return ht(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)/Rg)}const wc=xi(0),Ms=xi(1),KD=xi(2),XD=xi(3),ca=xi(4),YD=xi(5),QD=xi(6);wc.range;Ms.range;KD.range;XD.range;ca.range;YD.range;QD.range;const zg=ht(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());zg.range;const Fg=ht(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());Fg.range;const an=ht(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());an.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ht(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)});an.range;const on=ht(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());on.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:ht(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)});on.range;function hj(e,t,r,n,a,u){const l=[[li,1,Qr],[li,5,5*Qr],[li,15,15*Qr],[li,30,30*Qr],[u,1,lr],[u,5,5*lr],[u,15,15*lr],[u,30,30*lr],[a,1,Zr],[a,3,3*Zr],[a,6,6*Zr],[a,12,12*Zr],[n,1,nn],[n,2,2*nn],[r,1,Rg],[t,1,gO],[t,3,3*gO],[e,1,Gv]];function c(d,h,v){const m=hb).right(l,m);if(x===l.length)return e.every(om(d/Gv,h/Gv,v));if(x===0)return ks.every(Math.max(om(d,h,v),1));const[S,w]=l[m/l[x-1][2]53)return null;"w"in ie||(ie.w=1),"Z"in ie?(Te=Xv(Ao(ie.y,0,1)),et=Te.getUTCDay(),Te=et>4||et===0?Ms.ceil(Te):Ms(Te),Te=bc.offset(Te,(ie.V-1)*7),ie.y=Te.getUTCFullYear(),ie.m=Te.getUTCMonth(),ie.d=Te.getUTCDate()+(ie.w+6)%7):(Te=Kv(Ao(ie.y,0,1)),et=Te.getDay(),Te=et>4||et===0?Cs.ceil(Te):Cs(Te),Te=Cu.offset(Te,(ie.V-1)*7),ie.y=Te.getFullYear(),ie.m=Te.getMonth(),ie.d=Te.getDate()+(ie.w+6)%7)}else("W"in ie||"U"in ie)&&("w"in ie||(ie.w="u"in ie?ie.u%7:"W"in ie?1:0),et="Z"in ie?Xv(Ao(ie.y,0,1)).getUTCDay():Kv(Ao(ie.y,0,1)).getDay(),ie.m=0,ie.d="W"in ie?(ie.w+6)%7+ie.W*7-(et+5)%7:ie.w+ie.U*7-(et+6)%7);return"Z"in ie?(ie.H+=ie.Z/100|0,ie.M+=ie.Z%100,Xv(ie)):Kv(ie)}}function M(ue,be,Pe,ie){for(var qe=0,Te=be.length,et=Pe.length,tt,vt;qe=et)return-1;if(tt=be.charCodeAt(qe++),tt===37){if(tt=be.charAt(qe++),vt=_[tt in bO?be.charAt(qe++):tt],!vt||(ie=vt(ue,Pe,ie))<0)return-1}else if(tt!=Pe.charCodeAt(ie++))return-1}return ie}function $(ue,be,Pe){var ie=d.exec(be.slice(Pe));return ie?(ue.p=h.get(ie[0].toLowerCase()),Pe+ie[0].length):-1}function K(ue,be,Pe){var ie=x.exec(be.slice(Pe));return ie?(ue.w=S.get(ie[0].toLowerCase()),Pe+ie[0].length):-1}function F(ue,be,Pe){var ie=v.exec(be.slice(Pe));return ie?(ue.w=m.get(ie[0].toLowerCase()),Pe+ie[0].length):-1}function B(ue,be,Pe){var ie=P.exec(be.slice(Pe));return ie?(ue.m=A.get(ie[0].toLowerCase()),Pe+ie[0].length):-1}function H(ue,be,Pe){var ie=w.exec(be.slice(Pe));return ie?(ue.m=b.get(ie[0].toLowerCase()),Pe+ie[0].length):-1}function Y(ue,be,Pe){return M(ue,t,be,Pe)}function X(ue,be,Pe){return M(ue,r,be,Pe)}function J(ue,be,Pe){return M(ue,n,be,Pe)}function te(ue){return l[ue.getDay()]}function G(ue){return u[ue.getDay()]}function Z(ue){return f[ue.getMonth()]}function W(ue){return c[ue.getMonth()]}function I(ue){return a[+(ue.getHours()>=12)]}function z(ue){return 1+~~(ue.getMonth()/3)}function oe(ue){return l[ue.getUTCDay()]}function ce(ue){return u[ue.getUTCDay()]}function ve(ue){return f[ue.getUTCMonth()]}function ge(ue){return c[ue.getUTCMonth()]}function Ee(ue){return a[+(ue.getUTCHours()>=12)]}function Se(ue){return 1+~~(ue.getUTCMonth()/3)}return{format:function(ue){var be=O(ue+="",j);return be.toString=function(){return ue},be},parse:function(ue){var be=C(ue+="",!1);return be.toString=function(){return ue},be},utcFormat:function(ue){var be=O(ue+="",T);return be.toString=function(){return ue},be},utcParse:function(ue){var be=C(ue+="",!0);return be.toString=function(){return ue},be}}}var bO={"-":"",_:" ",0:"0"},xt=/^\s*\d+/,nL=/^%/,iL=/[\\^$*+?|[\]().{}]/g;function $e(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",u=a.length;return n+(u[t.toLowerCase(),r]))}function oL(e,t,r){var n=xt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function uL(e,t,r){var n=xt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function lL(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function sL(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function cL(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function xO(e,t,r){var n=xt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function wO(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function fL(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 dL(e,t,r){var n=xt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function pL(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function SO(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function hL(e,t,r){var n=xt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function _O(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function vL(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function yL(e,t,r){var n=xt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function mL(e,t,r){var n=xt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function gL(e,t,r){var n=xt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function bL(e,t,r){var n=nL.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function xL(e,t,r){var n=xt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function wL(e,t,r){var n=xt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function OO(e,t){return $e(e.getDate(),t,2)}function SL(e,t){return $e(e.getHours(),t,2)}function _L(e,t){return $e(e.getHours()%12||12,t,2)}function OL(e,t){return $e(1+Cu.count(an(e),e),t,3)}function vj(e,t){return $e(e.getMilliseconds(),t,3)}function PL(e,t){return vj(e,t)+"000"}function AL(e,t){return $e(e.getMonth()+1,t,2)}function EL(e,t){return $e(e.getMinutes(),t,2)}function jL(e,t){return $e(e.getSeconds(),t,2)}function TL(e){var t=e.getDay();return t===0?7:t}function kL(e,t){return $e(xc.count(an(e)-1,e),t,2)}function yj(e){var t=e.getDay();return t>=4||t===0?sa(e):sa.ceil(e)}function CL(e,t){return e=yj(e),$e(sa.count(an(e),e)+(an(e).getDay()===4),t,2)}function ML(e){return e.getDay()}function NL(e,t){return $e(Cs.count(an(e)-1,e),t,2)}function IL(e,t){return $e(e.getFullYear()%100,t,2)}function $L(e,t){return e=yj(e),$e(e.getFullYear()%100,t,2)}function RL(e,t){return $e(e.getFullYear()%1e4,t,4)}function DL(e,t){var r=e.getDay();return e=r>=4||r===0?sa(e):sa.ceil(e),$e(e.getFullYear()%1e4,t,4)}function LL(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$e(t/60|0,"0",2)+$e(t%60,"0",2)}function PO(e,t){return $e(e.getUTCDate(),t,2)}function BL(e,t){return $e(e.getUTCHours(),t,2)}function qL(e,t){return $e(e.getUTCHours()%12||12,t,2)}function zL(e,t){return $e(1+bc.count(on(e),e),t,3)}function mj(e,t){return $e(e.getUTCMilliseconds(),t,3)}function FL(e,t){return mj(e,t)+"000"}function UL(e,t){return $e(e.getUTCMonth()+1,t,2)}function WL(e,t){return $e(e.getUTCMinutes(),t,2)}function HL(e,t){return $e(e.getUTCSeconds(),t,2)}function VL(e){var t=e.getUTCDay();return t===0?7:t}function GL(e,t){return $e(wc.count(on(e)-1,e),t,2)}function gj(e){var t=e.getUTCDay();return t>=4||t===0?ca(e):ca.ceil(e)}function KL(e,t){return e=gj(e),$e(ca.count(on(e),e)+(on(e).getUTCDay()===4),t,2)}function XL(e){return e.getUTCDay()}function YL(e,t){return $e(Ms.count(on(e)-1,e),t,2)}function QL(e,t){return $e(e.getUTCFullYear()%100,t,2)}function ZL(e,t){return e=gj(e),$e(e.getUTCFullYear()%100,t,2)}function JL(e,t){return $e(e.getUTCFullYear()%1e4,t,4)}function e3(e,t){var r=e.getUTCDay();return e=r>=4||r===0?ca(e):ca.ceil(e),$e(e.getUTCFullYear()%1e4,t,4)}function t3(){return"+0000"}function AO(){return"%"}function EO(e){return+e}function jO(e){return Math.floor(+e/1e3)}var Ki,bj,xj;r3({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 r3(e){return Ki=rL(e),bj=Ki.format,Ki.parse,xj=Ki.utcFormat,Ki.utcParse,Ki}function n3(e){return new Date(e)}function i3(e){return e instanceof Date?+e:+new Date(+e)}function Ug(e,t,r,n,a,u,l,c,f,d){var h=Tg(),v=h.invert,m=h.domain,x=d(".%L"),S=d(":%S"),w=d("%I:%M"),b=d("%I %p"),P=d("%a %d"),A=d("%b %d"),j=d("%B"),T=d("%Y");function _(O){return(f(O)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,u)=>GR(e,u/n))},r.copy=function(){return Oj(t).domain(e)},cn.apply(r,arguments)}function _c(){var e=0,t=.5,r=1,n=1,a,u,l,c,f,d=It,h,v=!1,m;function x(w){return isNaN(w=+w)?m:(w=.5+((w=+h(w))-u)*(n*wr}return Qv=e,Qv}var Zv,MO;function c3(){if(MO)return Zv;MO=1;var e=jj(),t=s3(),r=ja();function n(a){return a&&a.length?e(a,r,t):void 0}return Zv=n,Zv}var f3=c3();const Nn=Fe(f3);var Jv,NO;function d3(){if(NO)return Jv;NO=1;function e(t,r){return te.e^u.s<0?1:-1;for(n=u.d.length,a=e.d.length,t=0,r=ne.d[t]^u.s<0?1:-1;return n===a?0:n>a^u.s<0?1:-1};pe.decimalPlaces=pe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ge;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};pe.dividedBy=pe.div=function(e){return rn(this,new this.constructor(e))};pe.dividedToIntegerBy=pe.idiv=function(e){var t=this,r=t.constructor;return ze(rn(t,new r(e),0,1),r.precision)};pe.equals=pe.eq=function(e){return!this.cmp(e)};pe.exponent=function(){return lt(this)};pe.greaterThan=pe.gt=function(e){return this.cmp(e)>0};pe.greaterThanOrEqualTo=pe.gte=function(e){return this.cmp(e)>=0};pe.isInteger=pe.isint=function(){return this.e>this.d.length-2};pe.isNegative=pe.isneg=function(){return this.s<0};pe.isPositive=pe.ispos=function(){return this.s>0};pe.isZero=function(){return this.s===0};pe.lessThan=pe.lt=function(e){return this.cmp(e)<0};pe.lessThanOrEqualTo=pe.lte=function(e){return this.cmp(e)<1};pe.logarithm=pe.log=function(e){var t,r=this,n=r.constructor,a=n.precision,u=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Yt))throw Error(cr+"NaN");if(r.s<1)throw Error(cr+(r.s?"NaN":"-Infinity"));return r.eq(Yt)?new n(0):(Xe=!1,t=rn(tu(r,u),tu(e,u),u),Xe=!0,ze(t,a))};pe.minus=pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Mj(t,e):kj(t,(e.s=-e.s,e))};pe.modulo=pe.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(cr+"NaN");return r.s?(Xe=!1,t=rn(r,e,0,1).times(e),Xe=!0,r.minus(t)):ze(new n(r),a)};pe.naturalExponential=pe.exp=function(){return Cj(this)};pe.naturalLogarithm=pe.ln=function(){return tu(this)};pe.negated=pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};pe.plus=pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kj(t,e):Mj(t,(e.s=-e.s,e))};pe.precision=pe.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(di+e);if(t=lt(a)+1,n=a.d.length-1,r=n*Ge+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};pe.squareRoot=pe.sqrt=function(){var e,t,r,n,a,u,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(cr+"NaN")}for(e=lt(c),Xe=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=Rr(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Ma((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(a.toString()),r=f.precision,a=l=r+3;;)if(u=n,n=u.plus(rn(c,u,l+2)).times(.5),Rr(u.d).slice(0,l)===(t=Rr(n.d)).slice(0,l)){if(t=t.slice(l-3,l+1),a==l&&t=="4999"){if(ze(u,r+1,0),u.times(u).eq(c)){n=u;break}}else if(t!="9999")break;l+=4}return Xe=!0,ze(n,r)};pe.times=pe.mul=function(e){var t,r,n,a,u,l,c,f,d,h=this,v=h.constructor,m=h.d,x=(e=new v(e)).d;if(!h.s||!e.s)return new v(0);for(e.s*=h.s,r=h.e+e.e,f=m.length,d=x.length,f=0;){for(t=0,a=f+n;a>n;)c=u[a]+x[n]*m[a-n-1]+t,u[a--]=c%bt|0,t=c/bt|0;u[a]=(u[a]+t)%bt|0}for(;!u[--l];)u.pop();return t?++r:u.shift(),e.d=u,e.e=r,Xe?ze(e,v.precision):e};pe.toDecimalPlaces=pe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(qr(e,0,Ca),t===void 0?t=n.rounding:qr(t,0,8),ze(r,e+lt(r)+1,t))};pe.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=vi(n,!0):(qr(e,0,Ca),t===void 0?t=a.rounding:qr(t,0,8),n=ze(new a(n),e+1,t),r=vi(n,!0,e+1)),r};pe.toFixed=function(e,t){var r,n,a=this,u=a.constructor;return e===void 0?vi(a):(qr(e,0,Ca),t===void 0?t=u.rounding:qr(t,0,8),n=ze(new u(a),e+lt(a)+1,t),r=vi(n.abs(),!1,e+lt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};pe.toInteger=pe.toint=function(){var e=this,t=e.constructor;return ze(new t(e),lt(e)+1,t.rounding)};pe.toNumber=function(){return+this};pe.toPower=pe.pow=function(e){var t,r,n,a,u,l,c=this,f=c.constructor,d=12,h=+(e=new f(e));if(!e.s)return new f(Yt);if(c=new f(c),!c.s){if(e.s<1)throw Error(cr+"Infinity");return c}if(c.eq(Yt))return c;if(n=f.precision,e.eq(Yt))return ze(c,n);if(t=e.e,r=e.d.length-1,l=t>=r,u=c.s,l){if((r=h<0?-h:h)<=Tj){for(a=new f(Yt),t=Math.ceil(n/Ge+4),Xe=!1;r%2&&(a=a.times(c),BO(a.d,t)),r=Ma(r/2),r!==0;)c=c.times(c),BO(c.d,t);return Xe=!0,e.s<0?new f(Yt).div(a):ze(a,n)}}else if(u<0)throw Error(cr+"NaN");return u=u<0&&e.d[Math.max(t,r)]&1?-1:1,c.s=1,Xe=!1,a=e.times(tu(c,n+d)),Xe=!0,a=Cj(a),a.s=u,a};pe.toPrecision=function(e,t){var r,n,a=this,u=a.constructor;return e===void 0?(r=lt(a),n=vi(a,r<=u.toExpNeg||r>=u.toExpPos)):(qr(e,1,Ca),t===void 0?t=u.rounding:qr(t,0,8),a=ze(new u(a),e,t),r=lt(a),n=vi(a,e<=r||r<=u.toExpNeg,e)),n};pe.toSignificantDigits=pe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(qr(e,1,Ca),t===void 0?t=n.rounding:qr(t,0,8)),ze(new n(r),e,t)};pe.toString=pe.valueOf=pe.val=pe.toJSON=pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=lt(e),r=e.constructor;return vi(e,t<=r.toExpNeg||t>=r.toExpPos)};function kj(e,t){var r,n,a,u,l,c,f,d,h=e.constructor,v=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Xe?ze(t,v):t;if(f=e.d,d=t.d,l=e.e,a=t.e,f=f.slice(),u=l-a,u){for(u<0?(n=f,u=-u,c=d.length):(n=d,a=l,c=f.length),l=Math.ceil(v/Ge),c=l>c?l+1:c+1,u>c&&(u=c,n.length=1),n.reverse();u--;)n.push(0);n.reverse()}for(c=f.length,u=d.length,c-u<0&&(u=c,n=d,d=f,f=n),r=0;u;)r=(f[--u]=f[u]+d[u]+r)/bt|0,f[u]%=bt;for(r&&(f.unshift(r),++a),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=a,Xe?ze(t,v):t}function qr(e,t,r){if(e!==~~e||er)throw Error(di+e)}function Rr(e){var t,r,n,a=e.length-1,u="",l=e[0];if(a>0){for(u+=l,t=1;tl?1:-1;else for(c=f=0;ca[c]?1:-1;break}return f}function r(n,a,u){for(var l=0;u--;)n[u]-=l,l=n[u]1;)n.shift()}return function(n,a,u,l){var c,f,d,h,v,m,x,S,w,b,P,A,j,T,_,O,C,M,$=n.constructor,K=n.s==a.s?1:-1,F=n.d,B=a.d;if(!n.s)return new $(n);if(!a.s)throw Error(cr+"Division by zero");for(f=n.e-a.e,C=B.length,_=F.length,x=new $(K),S=x.d=[],d=0;B[d]==(F[d]||0);)++d;if(B[d]>(F[d]||0)&&--f,u==null?A=u=$.precision:l?A=u+(lt(n)-lt(a))+1:A=u,A<0)return new $(0);if(A=A/Ge+2|0,d=0,C==1)for(h=0,B=B[0],A++;(d<_||h)&&A--;d++)j=h*bt+(F[d]||0),S[d]=j/B|0,h=j%B|0;else{for(h=bt/(B[0]+1)|0,h>1&&(B=e(B,h),F=e(F,h),C=B.length,_=F.length),T=C,w=F.slice(0,C),b=w.length;b=bt/2&&++O;do h=0,c=t(B,w,C,b),c<0?(P=w[0],C!=b&&(P=P*bt+(w[1]||0)),h=P/O|0,h>1?(h>=bt&&(h=bt-1),v=e(B,h),m=v.length,b=w.length,c=t(v,w,m,b),c==1&&(h--,r(v,C16)throw Error(Vg+lt(e));if(!e.s)return new h(Yt);for(Xe=!1,c=v,l=new h(.03125);e.abs().gte(.1);)e=e.times(l),d+=5;for(n=Math.log(ai(2,d))/Math.LN10*2+5|0,c+=n,r=a=u=new h(Yt),h.precision=c;;){if(a=ze(a.times(e),c),r=r.times(++f),l=u.plus(rn(a,r,c)),Rr(l.d).slice(0,c)===Rr(u.d).slice(0,c)){for(;d--;)u=ze(u.times(u),c);return h.precision=v,t==null?(Xe=!0,ze(u,v)):u}u=l}}function lt(e){for(var t=e.e*Ge,r=e.d[0];r>=10;r/=10)t++;return t}function iy(e,t,r){if(t>e.LN10.sd())throw Xe=!0,r&&(e.precision=r),Error(cr+"LN10 precision limit exceeded");return ze(new e(e.LN10),t)}function Cn(e){for(var t="";e--;)t+="0";return t}function tu(e,t){var r,n,a,u,l,c,f,d,h,v=1,m=10,x=e,S=x.d,w=x.constructor,b=w.precision;if(x.s<1)throw Error(cr+(x.s?"NaN":"-Infinity"));if(x.eq(Yt))return new w(0);if(t==null?(Xe=!1,d=b):d=t,x.eq(10))return t==null&&(Xe=!0),iy(w,d);if(d+=m,w.precision=d,r=Rr(S),n=r.charAt(0),u=lt(x),Math.abs(u)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)x=x.times(e),r=Rr(x.d),n=r.charAt(0),v++;u=lt(x),n>1?(x=new w("0."+r),u++):x=new w(n+"."+r.slice(1))}else return f=iy(w,d+2,b).times(u+""),x=tu(new w(n+"."+r.slice(1)),d-m).plus(f),w.precision=b,t==null?(Xe=!0,ze(x,b)):x;for(c=l=x=rn(x.minus(Yt),x.plus(Yt),d),h=ze(x.times(x),d),a=3;;){if(l=ze(l.times(h),d),f=c.plus(rn(l,new w(a),d)),Rr(f.d).slice(0,d)===Rr(c.d).slice(0,d))return c=c.times(2),u!==0&&(c=c.plus(iy(w,d+2,b).times(u+""))),c=rn(c,new w(v),d),w.precision=b,t==null?(Xe=!0,ze(c,b)):c;c=f,a+=2}}function LO(e,t){var r,n,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Ma(r/Ge),e.d=[],n=(r+1)%Ge,r<0&&(n+=Ge),nNs||e.e<-Ns))throw Error(Vg+r)}else e.s=0,e.e=0,e.d=[0];return e}function ze(e,t,r){var n,a,u,l,c,f,d,h,v=e.d;for(l=1,u=v[0];u>=10;u/=10)l++;if(n=t-l,n<0)n+=Ge,a=t,d=v[h=0];else{if(h=Math.ceil((n+1)/Ge),u=v.length,h>=u)return e;for(d=u=v[h],l=1;u>=10;u/=10)l++;n%=Ge,a=n-Ge+l}if(r!==void 0&&(u=ai(10,l-a-1),c=d/u%10|0,f=t<0||v[h+1]!==void 0||d%u,f=r<4?(c||f)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||f||r==6&&(n>0?a>0?d/ai(10,l-a):0:v[h-1])%10&1||r==(e.s<0?8:7))),t<1||!v[0])return f?(u=lt(e),v.length=1,t=t-u-1,v[0]=ai(10,(Ge-t%Ge)%Ge),e.e=Ma(-t/Ge)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(n==0?(v.length=h,u=1,h--):(v.length=h+1,u=ai(10,Ge-n),v[h]=a>0?(d/ai(10,l-a)%ai(10,a)|0)*u:0),f)for(;;)if(h==0){(v[0]+=u)==bt&&(v[0]=1,++e.e);break}else{if(v[h]+=u,v[h]!=bt)break;v[h--]=0,u=1}for(n=v.length;v[--n]===0;)v.pop();if(Xe&&(e.e>Ns||e.e<-Ns))throw Error(Vg+lt(e));return e}function Mj(e,t){var r,n,a,u,l,c,f,d,h,v,m=e.constructor,x=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Xe?ze(t,x):t;if(f=e.d,v=t.d,n=t.e,d=e.e,f=f.slice(),l=d-n,l){for(h=l<0,h?(r=f,l=-l,c=v.length):(r=v,n=d,c=f.length),a=Math.max(Math.ceil(x/Ge),c)+2,l>a&&(l=a,r.length=1),r.reverse(),a=l;a--;)r.push(0);r.reverse()}else{for(a=f.length,c=v.length,h=a0;--a)f[c++]=0;for(a=v.length;a>l;){if(f[--a]0?u=u.charAt(0)+"."+u.slice(1)+Cn(n):l>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(a<0?"e":"e+")+a):a<0?(u="0."+Cn(-a-1)+u,r&&(n=r-l)>0&&(u+=Cn(n))):a>=l?(u+=Cn(a+1-l),r&&(n=r-a-1)>0&&(u=u+"."+Cn(n))):((n=a+1)0&&(a+1===l&&(u+="."),u+=Cn(n))),e.s<0?"-"+u:u}function BO(e,t){if(e.length>t)return e.length=t,!0}function Nj(e){var t,r,n;function a(u){var l=this;if(!(l instanceof a))return new a(u);if(l.constructor=a,u instanceof a){l.s=u.s,l.e=u.e,l.d=(u=u.d)?u.slice():u;return}if(typeof u=="number"){if(u*0!==0)throw Error(di+u);if(u>0)l.s=1;else if(u<0)u=-u,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(u===~~u&&u<1e7){l.e=0,l.d=[u];return}return LO(l,u.toString())}else if(typeof u!="string")throw Error(di+u);if(u.charCodeAt(0)===45?(u=u.slice(1),l.s=-1):l.s=1,S3.test(u))LO(l,u);else throw Error(di+u)}if(a.prototype=pe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=Nj,a.config=a.set=_3,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(di+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(di+r+": "+n);return this}var Gg=Nj(w3);Yt=new Gg(1);const Be=Gg;function O3(e){return j3(e)||E3(e)||A3(e)||P3()}function P3(){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 A3(e,t){if(e){if(typeof e=="string")return fm(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 fm(e,t)}}function E3(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function j3(e){if(Array.isArray(e))return fm(e)}function fm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-l,qO(function(){for(var c=arguments.length,f=new Array(c),d=0;de.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,u=void 0;try{for(var l=e[Symbol.iterator](),c;!(n=(c=l.next()).done)&&(r.push(c.value),!(t&&r.length===t));n=!0);}catch(f){a=!0,u=f}finally{try{!n&&l.return!=null&&l.return()}finally{if(a)throw u}}return r}}function U3(e){if(Array.isArray(e))return e}function Lj(e){var t=ru(e,2),r=t[0],n=t[1],a=r,u=n;return r>n&&(a=n,u=r),[a,u]}function Bj(e,t,r){if(e.lte(0))return new Be(0);var n=Ac.getDigitCount(e.toNumber()),a=new Be(10).pow(n),u=e.div(a),l=n!==1?.05:.1,c=new Be(Math.ceil(u.div(l).toNumber())).add(r).mul(l),f=c.mul(a);return t?f:new Be(Math.ceil(f))}function W3(e,t,r){var n=1,a=new Be(e);if(!a.isint()&&r){var u=Math.abs(e);u<1?(n=new Be(10).pow(Ac.getDigitCount(e)-1),a=new Be(Math.floor(a.div(n).toNumber())).mul(n)):u>1&&(a=new Be(Math.floor(e)))}else e===0?a=new Be(Math.floor((t-1)/2)):r||(a=new Be(Math.floor(e)));var l=Math.floor((t-1)/2),c=M3(C3(function(f){return a.add(new Be(f-l).mul(n)).toNumber()}),dm);return c(0,t)}function qj(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Be(0),tickMin:new Be(0),tickMax:new Be(0)};var u=Bj(new Be(t).sub(e).div(r-1),n,a),l;e<=0&&t>=0?l=new Be(0):(l=new Be(e).add(t).div(2),l=l.sub(new Be(l).mod(u)));var c=Math.ceil(l.sub(e).div(u).toNumber()),f=Math.ceil(new Be(t).sub(l).div(u).toNumber()),d=c+f+1;return d>r?qj(e,t,r,n,a+1):(d0?f+(r-d):f,c=t>0?c:c+(r-d)),{step:u,tickMin:l.sub(new Be(c).mul(u)),tickMax:l.add(new Be(f).mul(u))})}function H3(e){var t=ru(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(a,2),c=Lj([r,n]),f=ru(c,2),d=f[0],h=f[1];if(d===-1/0||h===1/0){var v=h===1/0?[d].concat(hm(dm(0,a-1).map(function(){return 1/0}))):[].concat(hm(dm(0,a-1).map(function(){return-1/0})),[h]);return r>n?pm(v):v}if(d===h)return W3(d,a,u);var m=qj(d,h,l,u),x=m.step,S=m.tickMin,w=m.tickMax,b=Ac.rangeStep(S,w.add(new Be(.1).mul(x)),x);return r>n?pm(b):b}function V3(e,t){var r=ru(e,2),n=r[0],a=r[1],u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Lj([n,a]),c=ru(l,2),f=c[0],d=c[1];if(f===-1/0||d===1/0)return[n,a];if(f===d)return[f];var h=Math.max(t,2),v=Bj(new Be(d).sub(f).div(h-1),u,0),m=[].concat(hm(Ac.rangeStep(new Be(f),new Be(d).sub(new Be(.99).mul(v)),v)),[d]);return n>a?pm(m):m}var G3=Rj(H3),K3=Rj(V3),X3="Invariant failed";function yi(e,t){throw new Error(X3)}var Y3=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function fa(e){"@babel/helpers - typeof";return fa=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},fa(e)}function Is(){return Is=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 n4(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 i4(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a4(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]:[],a=arguments.length>2?arguments[2]:void 0,u=arguments.length>3?arguments[3]:void 0,l=-1,c=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(c<=1)return 0;if(u&&u.axisType==="angleAxis"&&Math.abs(Math.abs(u.range[1]-u.range[0])-360)<=1e-6)for(var f=u.range,d=0;d0?a[d-1].coordinate:a[c-1].coordinate,v=a[d].coordinate,m=d>=c-1?a[0].coordinate:a[d+1].coordinate,x=void 0;if(Or(v-h)!==Or(m-v)){var S=[];if(Or(m-v)===Or(f[1]-f[0])){x=m;var w=v+f[1]-f[0];S[0]=Math.min(w,(w+h)/2),S[1]=Math.max(w,(w+h)/2)}else{x=h;var b=m+f[1]-f[0];S[0]=Math.min(v,(b+v)/2),S[1]=Math.max(v,(b+v)/2)}var P=[Math.min(v,(x+v)/2),Math.max(v,(x+v)/2)];if(t>P[0]&&t<=P[1]||t>=S[0]&&t<=S[1]){l=a[d].index;break}}else{var A=Math.min(h,m),j=Math.max(h,m);if(t>(A+v)/2&&t<=(j+v)/2){l=a[d].index;break}}}else for(var T=0;T0&&T(n[T].coordinate+n[T-1].coordinate)/2&&t<=(n[T].coordinate+n[T+1].coordinate)/2||T===c-1&&t>(n[T].coordinate+n[T-1].coordinate)/2){l=n[T].index;break}return l},Kg=function(t){var r,n=t,a=n.type.displayName,u=(r=t.type)!==null&&r!==void 0&&r.defaultProps?nt(nt({},t.type.defaultProps),t.props):t.props,l=u.stroke,c=u.fill,f;switch(a){case"Line":f=l;break;case"Area":case"Radar":f=l&&l!=="none"?l:c;break;default:f=c;break}return f},S4=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,u=a===void 0?{}:a;if(!u)return{};for(var l={},c=Object.keys(u),f=0,d=c.length;f=0});if(P&&P.length){var A=P[0].type.defaultProps,j=A!==void 0?nt(nt({},A),P[0].props):P[0].props,T=j.barSize,_=j[b];l[_]||(l[_]=[]);var O=Ce(T)?r:T;l[_].push({item:P[0],stackList:P.slice(1),barSize:Ce(O)?void 0:hi(O,n,0)})}}return l},_4=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,u=t.sizeList,l=u===void 0?[]:u,c=t.maxBarSize,f=l.length;if(f<1)return null;var d=hi(r,a,0,!0),h,v=[];if(l[0].barSize===+l[0].barSize){var m=!1,x=a/f,S=l.reduce(function(T,_){return T+_.barSize||0},0);S+=(f-1)*d,S>=a&&(S-=(f-1)*d,d=0),S>=a&&x>0&&(m=!0,x*=.9,S=f*x);var w=(a-S)/2>>0,b={offset:w-d,size:0};h=l.reduce(function(T,_){var O={item:_.item,position:{offset:b.offset+b.size+d,size:m?x:_.barSize}},C=[].concat(UO(T),[O]);return b=C[C.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(M){C.push({item:M,position:b})}),C},v)}else{var P=hi(n,a,0,!0);a-2*P-(f-1)*d<=0&&(d=0);var A=(a-2*P-(f-1)*d)/f;A>1&&(A>>=0);var j=c===+c?Math.min(A,c):A;h=l.reduce(function(T,_,O){var C=[].concat(UO(T),[{item:_.item,position:{offset:P+(A+d)*O+(A-j)/2,size:j}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(M){C.push({item:M,position:C[C.length-1].position})}),C},v)}return h},O4=function(t,r,n,a){var u=n.children,l=n.width,c=n.margin,f=l-(c.left||0)-(c.right||0),d=Wj({children:u,legendWidth:f});if(d){var h=a||{},v=h.width,m=h.height,x=d.align,S=d.verticalAlign,w=d.layout;if((w==="vertical"||w==="horizontal"&&S==="middle")&&x!=="center"&&se(t[x]))return nt(nt({},t),{},ra({},x,t[x]+(v||0)));if((w==="horizontal"||w==="vertical"&&x==="center")&&S!=="middle"&&se(t[S]))return nt(nt({},t),{},ra({},S,t[S]+(m||0)))}return t},P4=function(t,r,n){return Ce(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Hj=function(t,r,n,a,u){var l=r.props.children,c=Pr(l,Ec).filter(function(d){return P4(a,u,d.props.direction)});if(c&&c.length){var f=c.map(function(d){return d.props.dataKey});return t.reduce(function(d,h){var v=Qt(h,n);if(Ce(v))return d;var m=Array.isArray(v)?[Oc(v),Nn(v)]:[v,v],x=f.reduce(function(S,w){var b=Qt(h,w,0),P=m[0]-Math.abs(Array.isArray(b)?b[0]:b),A=m[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(P,S[0]),Math.max(A,S[1])]},[1/0,-1/0]);return[Math.min(x[0],d[0]),Math.max(x[1],d[1])]},[1/0,-1/0])}return null},A4=function(t,r,n,a,u){var l=r.map(function(c){return Hj(t,c,n,u,a)}).filter(function(c){return!Ce(c)});return l&&l.length?l.reduce(function(c,f){return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]):null},Vj=function(t,r,n,a,u){var l=r.map(function(f){var d=f.props.dataKey;return n==="number"&&d&&Hj(t,f,d,a)||Bo(t,d,n,u)});if(n==="number")return l.reduce(function(f,d){return[Math.min(f[0],d[0]),Math.max(f[1],d[1])]},[1/0,-1/0]);var c={};return l.reduce(function(f,d){for(var h=0,v=d.length;h=2?Or(c[0]-c[1])*2*d:d,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(v){var m=u?u.indexOf(v):v;return{coordinate:a(m)+d,value:v,offset:d}});return h.filter(function(v){return!Ea(v.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(v,m){return{coordinate:a(v)+d,value:v,index:m,offset:d}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(v){return{coordinate:a(v)+d,value:v,offset:d}}):a.domain().map(function(v,m){return{coordinate:a(v)+d,value:u?u[v]:v,index:m,offset:d}})},ay=new WeakMap,Ql=function(t,r){if(typeof r!="function")return t;ay.has(t)||ay.set(t,new WeakMap);var n=ay.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},E4=function(t,r,n){var a=t.scale,u=t.type,l=t.layout,c=t.axisType;if(a==="auto")return l==="radial"&&c==="radiusAxis"?{scale:Xo(),realScaleType:"band"}:l==="radial"&&c==="angleAxis"?{scale:Ts(),realScaleType:"linear"}:u==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Lo(),realScaleType:"point"}:u==="category"?{scale:Xo(),realScaleType:"band"}:{scale:Ts(),realScaleType:"linear"};if(pi(a)){var f="scale".concat(fc(a));return{scale:(TO[f]||Lo)(),realScaleType:TO[f]?f:"point"}}return Ae(a)?{scale:a}:{scale:Lo(),realScaleType:"point"}},HO=1e-4,j4=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),u=Math.min(a[0],a[1])-HO,l=Math.max(a[0],a[1])+HO,c=t(r[0]),f=t(r[n-1]);(cl||fl)&&t.domain([r[0],r[n-1]])}},T4=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(u[1]=a),u[0]>a&&(u[0]=a),u[1]=0?(t[c][n][0]=u,t[c][n][1]=u+f,u=t[c][n][1]):(t[c][n][0]=l,t[c][n][1]=l+f,l=t[c][n][1])}},M4=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[l][n][0]=u,t[l][n][1]=u+c,u=t[l][n][1]):(t[l][n][0]=0,t[l][n][1]=0)}},N4={sign:C4,expand:vN,none:na,silhouette:yN,wiggle:mN,positive:M4},I4=function(t,r,n){var a=r.map(function(c){return c.props.dataKey}),u=N4[n],l=hN().keys(a).value(function(c,f){return+Qt(c,f,0)}).order(Gy).offset(u);return l(t)},$4=function(t,r,n,a,u,l){if(!t)return null;var c=l?r.reverse():r,f={},d=c.reduce(function(v,m){var x,S=(x=m.type)!==null&&x!==void 0&&x.defaultProps?nt(nt({},m.type.defaultProps),m.props):m.props,w=S.stackId,b=S.hide;if(b)return v;var P=S[n],A=v[P]||{hasStack:!1,stackGroups:{}};if(pt(w)){var j=A.stackGroups[w]||{numericAxisId:n,cateAxisId:a,items:[]};j.items.push(m),A.hasStack=!0,A.stackGroups[w]=j}else A.stackGroups[Au("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[m]};return nt(nt({},v),{},ra({},P,A))},f),h={};return Object.keys(d).reduce(function(v,m){var x=d[m];if(x.hasStack){var S={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(w,b){var P=x.stackGroups[b];return nt(nt({},w),{},ra({},b,{numericAxisId:n,cateAxisId:a,items:P.items,stackedData:I4(t,P.items,u)}))},S)}return nt(nt({},v),{},ra({},m,x))},h)},R4=function(t,r){var n=r.realScaleType,a=r.type,u=r.tickCount,l=r.originalDomain,c=r.allowDecimals,f=n||r.scale;if(f!=="auto"&&f!=="linear")return null;if(u&&a==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var d=t.domain();if(!d.length)return null;var h=G3(d,u,c);return t.domain([Oc(h),Nn(h)]),{niceTicks:h}}if(u&&a==="number"){var v=t.domain(),m=K3(v,u,c);return{niceTicks:m}}return null};function VO(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,u=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ce(a[t.dataKey])){var c=ls(r,"value",a[t.dataKey]);if(c)return c.coordinate+n/2}return r[u]?r[u].coordinate+n/2:null}var f=Qt(a,Ce(l)?t.dataKey:l);return Ce(f)?null:t.scale(f)}var GO=function(t){var r=t.axis,n=t.ticks,a=t.offset,u=t.bandSize,l=t.entry,c=t.index;if(r.type==="category")return n[c]?n[c].coordinate+a:null;var f=Qt(l,r.dataKey,r.domain[c]);return Ce(f)?null:r.scale(f)-u/2+a},D4=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),u=Math.max(n[0],n[1]);return a<=0&&u>=0?0:u<0?u:a}return n[0]},L4=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?nt(nt({},t.type.defaultProps),t.props):t.props,u=a.stackId;if(pt(u)){var l=r[u];if(l){var c=l.items.indexOf(t);return c>=0?l.stackedData[c]:null}}return null},B4=function(t){return t.reduce(function(r,n){return[Oc(n.concat([r[0]]).filter(se)),Nn(n.concat([r[1]]).filter(se))]},[1/0,-1/0])},Xj=function(t,r,n){return Object.keys(t).reduce(function(a,u){var l=t[u],c=l.stackedData,f=c.reduce(function(d,h){var v=B4(h.slice(r,n+1));return[Math.min(d[0],v[0]),Math.max(d[1],v[1])]},[1/0,-1/0]);return[Math.min(f[0],a[0]),Math.max(f[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},KO=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,XO=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gm=function(t,r,n){if(Ae(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(se(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(KO.test(t[0])){var u=+KO.exec(t[0])[1];a[0]=r[0]-u}else Ae(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(se(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(XO.test(t[1])){var l=+XO.exec(t[1])[1];a[1]=r[1]+l}else Ae(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Rs=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var u=Sg(r,function(v){return v.coordinate}),l=1/0,c=1,f=u.length;cl&&(d=2*Math.PI-d),{radius:c,angle:U4(d),angleInRadian:d}},V4=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),u=Math.floor(n/360),l=Math.min(a,u);return{startAngle:r-l*360,endAngle:n-l*360}},G4=function(t,r){var n=r.startAngle,a=r.endAngle,u=Math.floor(n/360),l=Math.floor(a/360),c=Math.min(u,l);return t+c*360},JO=function(t,r){var n=t.x,a=t.y,u=H4({x:n,y:a},r),l=u.radius,c=u.angle,f=r.innerRadius,d=r.outerRadius;if(ld)return!1;if(l===0)return!0;var h=V4(r),v=h.startAngle,m=h.endAngle,x=c,S;if(v<=m){for(;x>m;)x-=360;for(;x=v&&x<=m}else{for(;x>v;)x-=360;for(;x=m&&x<=v}return S?ZO(ZO({},r),{},{radius:l,angle:G4(x,r)}):null};function ou(e){"@babel/helpers - typeof";return ou=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},ou(e)}var K4=["offset"];function X4(e){return J4(e)||Z4(e)||Q4(e)||Y4()}function Y4(){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 Q4(e,t){if(e){if(typeof e=="string")return bm(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 bm(e,t)}}function Z4(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function J4(e){if(Array.isArray(e))return bm(e)}function bm(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 tB(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 eP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function dt(e){for(var t=1;t=0?1:-1,j,T;a==="insideStart"?(j=x+A*l,T=w):a==="insideEnd"?(j=S-A*l,T=!w):a==="end"&&(j=S+A*l,T=w),T=P<=0?T:!T;var _=Ot(d,h,b,j),O=Ot(d,h,b,j+(T?1:-1)*359),C="M".concat(_.x,",").concat(_.y,` + A`).concat(b,",").concat(b,",0,1,").concat(T?0:1,`, + `).concat(O.x,",").concat(O.y),M=Ce(t.id)?Au("recharts-radial-line-"):t.id;return q.createElement("text",uu({},n,{dominantBaseline:"central",className:Ne("recharts-radial-bar-label",c)}),q.createElement("defs",null,q.createElement("path",{id:M,d:C})),q.createElement("textPath",{xlinkHref:"#".concat(M)},r))},lB=function(t){var r=t.viewBox,n=t.offset,a=t.position,u=r,l=u.cx,c=u.cy,f=u.innerRadius,d=u.outerRadius,h=u.startAngle,v=u.endAngle,m=(h+v)/2;if(a==="outside"){var x=Ot(l,c,d+n,m),S=x.x,w=x.y;return{x:S,y:w,textAnchor:S>=l?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"end"};var b=(f+d)/2,P=Ot(l,c,b,m),A=P.x,j=P.y;return{x:A,y:j,textAnchor:"middle",verticalAnchor:"middle"}},sB=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,u=t.position,l=r,c=l.x,f=l.y,d=l.width,h=l.height,v=h>=0?1:-1,m=v*a,x=v>0?"end":"start",S=v>0?"start":"end",w=d>=0?1:-1,b=w*a,P=w>0?"end":"start",A=w>0?"start":"end";if(u==="top"){var j={x:c+d/2,y:f-v*a,textAnchor:"middle",verticalAnchor:x};return dt(dt({},j),n?{height:Math.max(f-n.y,0),width:d}:{})}if(u==="bottom"){var T={x:c+d/2,y:f+h+m,textAnchor:"middle",verticalAnchor:S};return dt(dt({},T),n?{height:Math.max(n.y+n.height-(f+h),0),width:d}:{})}if(u==="left"){var _={x:c-b,y:f+h/2,textAnchor:P,verticalAnchor:"middle"};return dt(dt({},_),n?{width:Math.max(_.x-n.x,0),height:h}:{})}if(u==="right"){var O={x:c+d+b,y:f+h/2,textAnchor:A,verticalAnchor:"middle"};return dt(dt({},O),n?{width:Math.max(n.x+n.width-O.x,0),height:h}:{})}var C=n?{width:d,height:h}:{};return u==="insideLeft"?dt({x:c+b,y:f+h/2,textAnchor:A,verticalAnchor:"middle"},C):u==="insideRight"?dt({x:c+d-b,y:f+h/2,textAnchor:P,verticalAnchor:"middle"},C):u==="insideTop"?dt({x:c+d/2,y:f+m,textAnchor:"middle",verticalAnchor:S},C):u==="insideBottom"?dt({x:c+d/2,y:f+h-m,textAnchor:"middle",verticalAnchor:x},C):u==="insideTopLeft"?dt({x:c+b,y:f+m,textAnchor:A,verticalAnchor:S},C):u==="insideTopRight"?dt({x:c+d-b,y:f+m,textAnchor:P,verticalAnchor:S},C):u==="insideBottomLeft"?dt({x:c+b,y:f+h-m,textAnchor:A,verticalAnchor:x},C):u==="insideBottomRight"?dt({x:c+d-b,y:f+h-m,textAnchor:P,verticalAnchor:x},C):Aa(u)&&(se(u.x)||oi(u.x))&&(se(u.y)||oi(u.y))?dt({x:c+hi(u.x,d),y:f+hi(u.y,h),textAnchor:"end",verticalAnchor:"end"},C):dt({x:c+d/2,y:f+h/2,textAnchor:"middle",verticalAnchor:"middle"},C)},cB=function(t){return"cx"in t&&se(t.cx)};function kt(e){var t=e.offset,r=t===void 0?5:t,n=eB(e,K4),a=dt({offset:r},n),u=a.viewBox,l=a.position,c=a.value,f=a.children,d=a.content,h=a.className,v=h===void 0?"":h,m=a.textBreakAll;if(!u||Ce(c)&&Ce(f)&&!D.isValidElement(d)&&!Ae(d))return null;if(D.isValidElement(d))return D.cloneElement(d,a);var x;if(Ae(d)){if(x=D.createElement(d,a),D.isValidElement(x))return x}else x=aB(a);var S=cB(u),w=ke(a,!0);if(S&&(l==="insideStart"||l==="insideEnd"||l==="end"))return uB(a,x,w);var b=S?lB(a):sB(a);return q.createElement(ws,uu({className:Ne("recharts-label",v)},w,b,{breakAll:m}),x)}kt.displayName="Label";var Qj=function(t){var r=t.cx,n=t.cy,a=t.angle,u=t.startAngle,l=t.endAngle,c=t.r,f=t.radius,d=t.innerRadius,h=t.outerRadius,v=t.x,m=t.y,x=t.top,S=t.left,w=t.width,b=t.height,P=t.clockWise,A=t.labelViewBox;if(A)return A;if(se(w)&&se(b)){if(se(v)&&se(m))return{x:v,y:m,width:w,height:b};if(se(x)&&se(S))return{x,y:S,width:w,height:b}}return se(v)&&se(m)?{x:v,y:m,width:0,height:0}:se(r)&&se(n)?{cx:r,cy:n,startAngle:u||a||0,endAngle:l||a||0,innerRadius:d||0,outerRadius:h||f||c||0,clockWise:P}:t.viewBox?t.viewBox:{}},fB=function(t,r){return t?t===!0?q.createElement(kt,{key:"label-implicit",viewBox:r}):pt(t)?q.createElement(kt,{key:"label-implicit",viewBox:r,value:t}):D.isValidElement(t)?t.type===kt?D.cloneElement(t,{key:"label-implicit",viewBox:r}):q.createElement(kt,{key:"label-implicit",content:t,viewBox:r}):Ae(t)?q.createElement(kt,{key:"label-implicit",content:t,viewBox:r}):Aa(t)?q.createElement(kt,uu({viewBox:r},t,{key:"label-implicit"})):null:null},dB=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 a=t.children,u=Qj(t),l=Pr(a,kt).map(function(f,d){return D.cloneElement(f,{viewBox:r||u,key:"label-".concat(d)})});if(!n)return l;var c=fB(t.label,r||u);return[c].concat(X4(l))};kt.parseViewBox=Qj;kt.renderCallByParent=dB;var oy,tP;function pB(){if(tP)return oy;tP=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return oy=e,oy}var hB=pB();const vB=Fe(hB);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)}var yB=["valueAccessor"],mB=["data","dataKey","clockWise","id","textBreakAll"];function gB(e){return SB(e)||wB(e)||xB(e)||bB()}function bB(){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 xB(e,t){if(e){if(typeof e=="string")return xm(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 xm(e,t)}}function wB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function SB(e){if(Array.isArray(e))return xm(e)}function xm(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 AB(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 EB=function(t){return Array.isArray(t.value)?vB(t.value):t.value};function Rn(e){var t=e.valueAccessor,r=t===void 0?EB:t,n=iP(e,yB),a=n.data,u=n.dataKey,l=n.clockWise,c=n.id,f=n.textBreakAll,d=iP(n,mB);return!a||!a.length?null:q.createElement(Je,{className:"recharts-label-list"},a.map(function(h,v){var m=Ce(u)?r(h,v):Qt(h&&h.payload,u),x=Ce(c)?{}:{id:"".concat(c,"-").concat(v)};return q.createElement(kt,Ls({},ke(h,!0),d,x,{parentViewBox:h.parentViewBox,value:m,textBreakAll:f,viewBox:kt.parseViewBox(Ce(l)?h:nP(nP({},h),{},{clockWise:l})),key:"label-".concat(v),index:v}))}))}Rn.displayName="LabelList";function jB(e,t){return e?e===!0?q.createElement(Rn,{key:"labelList-implicit",data:t}):q.isValidElement(e)||Ae(e)?q.createElement(Rn,{key:"labelList-implicit",data:t,content:e}):Aa(e)?q.createElement(Rn,Ls({data:t},e,{key:"labelList-implicit"})):null:null}function TB(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,a=Pr(n,Rn).map(function(l,c){return D.cloneElement(l,{data:t,key:"labelList-".concat(c)})});if(!r)return a;var u=jB(e.label,t);return[u].concat(gB(a))}Rn.renderCallByParent=TB;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 wm(){return wm=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(l>d),`, + `).concat(v.x,",").concat(v.y,` + `);if(a>0){var x=Ot(r,n,a,l),S=Ot(r,n,a,d);m+="L ".concat(S.x,",").concat(S.y,` + A `).concat(a,",").concat(a,`,0, + `).concat(+(Math.abs(f)>180),",").concat(+(l<=d),`, + `).concat(x.x,",").concat(x.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},IB=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,u=t.outerRadius,l=t.cornerRadius,c=t.forceCornerRadius,f=t.cornerIsExternal,d=t.startAngle,h=t.endAngle,v=Or(h-d),m=Zl({cx:r,cy:n,radius:u,angle:d,sign:v,cornerRadius:l,cornerIsExternal:f}),x=m.circleTangency,S=m.lineTangency,w=m.theta,b=Zl({cx:r,cy:n,radius:u,angle:h,sign:-v,cornerRadius:l,cornerIsExternal:f}),P=b.circleTangency,A=b.lineTangency,j=b.theta,T=f?Math.abs(d-h):Math.abs(d-h)-w-j;if(T<0)return c?"M ".concat(S.x,",").concat(S.y,` + a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0 + a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0 + `):Zj({cx:r,cy:n,innerRadius:a,outerRadius:u,startAngle:d,endAngle:h});var _="M ".concat(S.x,",").concat(S.y,` + A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(x.x,",").concat(x.y,` + A`).concat(u,",").concat(u,",0,").concat(+(T>180),",").concat(+(v<0),",").concat(P.x,",").concat(P.y,` + A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(A.x,",").concat(A.y,` + `);if(a>0){var O=Zl({cx:r,cy:n,radius:a,angle:d,sign:v,isExternal:!0,cornerRadius:l,cornerIsExternal:f}),C=O.circleTangency,M=O.lineTangency,$=O.theta,K=Zl({cx:r,cy:n,radius:a,angle:h,sign:-v,isExternal:!0,cornerRadius:l,cornerIsExternal:f}),F=K.circleTangency,B=K.lineTangency,H=K.theta,Y=f?Math.abs(d-h):Math.abs(d-h)-$-H;if(Y<0&&l===0)return"".concat(_,"L").concat(r,",").concat(n,"Z");_+="L".concat(B.x,",").concat(B.y,` + A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(F.x,",").concat(F.y,` + A`).concat(a,",").concat(a,",0,").concat(+(Y>180),",").concat(+(v>0),",").concat(C.x,",").concat(C.y,` + A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(M.x,",").concat(M.y,"Z")}else _+="L".concat(r,",").concat(n,"Z");return _},$B={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Jj=function(t){var r=oP(oP({},$B),t),n=r.cx,a=r.cy,u=r.innerRadius,l=r.outerRadius,c=r.cornerRadius,f=r.forceCornerRadius,d=r.cornerIsExternal,h=r.startAngle,v=r.endAngle,m=r.className;if(l0&&Math.abs(h-v)<360?b=IB({cx:n,cy:a,innerRadius:u,outerRadius:l,cornerRadius:Math.min(w,S/2),forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v}):b=Zj({cx:n,cy:a,innerRadius:u,outerRadius:l,startAngle:h,endAngle:v}),q.createElement("path",wm({},ke(r,!0),{className:x,d:b,role:"img"}))};function cu(e){"@babel/helpers - typeof";return cu=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},cu(e)}function Sm(){return Sm=Object.assign?Object.assign.bind():function(e){for(var t=1;tGB.call(e,t));function wi(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const YB="__v",QB="__o",ZB="_owner",{getOwnPropertyDescriptor:hP,keys:vP}=Object;function JB(e,t){return e.byteLength===t.byteLength&&Bs(new Uint8Array(e),new Uint8Array(t))}function eq(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 tq(e,t){return e.byteLength===t.byteLength&&Bs(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function rq(e,t){return wi(e.getTime(),t.getTime())}function nq(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function iq(e,t){return e===t}function yP(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),u=e.entries();let l,c,f=0;for(;(l=u.next())&&!l.done;){const d=t.entries();let h=!1,v=0;for(;(c=d.next())&&!c.done;){if(a[v]){v++;continue}const m=l.value,x=c.value;if(r.equals(m[0],x[0],f,v,e,t,r)&&r.equals(m[1],x[1],m[0],x[0],e,t,r)){h=a[v]=!0;break}v++}if(!h)return!1;f++}return!0}const aq=wi;function oq(e,t,r){const n=vP(e);let a=n.length;if(vP(t).length!==a)return!1;for(;a-- >0;)if(!eT(e,t,r,n[a]))return!1;return!0}function Co(e,t,r){const n=pP(e);let a=n.length;if(pP(t).length!==a)return!1;let u,l,c;for(;a-- >0;)if(u=n[a],!eT(e,t,r,u)||(l=hP(e,u),c=hP(t,u),(l||c)&&(!l||!c||l.configurable!==c.configurable||l.enumerable!==c.enumerable||l.writable!==c.writable)))return!1;return!0}function uq(e,t){return wi(e.valueOf(),t.valueOf())}function lq(e,t){return e.source===t.source&&e.flags===t.flags}function mP(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),u=e.values();let l,c;for(;(l=u.next())&&!l.done;){const f=t.values();let d=!1,h=0;for(;(c=f.next())&&!c.done;){if(!a[h]&&r.equals(l.value,c.value,l.value,c.value,e,t,r)){d=a[h]=!0;break}h++}if(!d)return!1}return!0}function Bs(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 sq(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 eT(e,t,r,n){return(n===ZB||n===QB||n===YB)&&(e.$$typeof||t.$$typeof)?!0:XB(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const cq="[object ArrayBuffer]",fq="[object Arguments]",dq="[object Boolean]",pq="[object DataView]",hq="[object Date]",vq="[object Error]",yq="[object Map]",mq="[object Number]",gq="[object Object]",bq="[object RegExp]",xq="[object Set]",wq="[object String]",Sq={"[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},_q="[object URL]",Oq=Object.prototype.toString;function Pq({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:u,areMapsEqual:l,areNumbersEqual:c,areObjectsEqual:f,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:v,areTypedArraysEqual:m,areUrlsEqual:x,unknownTagComparators:S}){return function(b,P,A){if(b===P)return!0;if(b==null||P==null)return!1;const j=typeof b;if(j!==typeof P)return!1;if(j!=="object")return j==="number"?c(b,P,A):j==="function"?u(b,P,A):!1;const T=b.constructor;if(T!==P.constructor)return!1;if(T===Object)return f(b,P,A);if(Array.isArray(b))return t(b,P,A);if(T===Date)return n(b,P,A);if(T===RegExp)return h(b,P,A);if(T===Map)return l(b,P,A);if(T===Set)return v(b,P,A);const _=Oq.call(b);if(_===hq)return n(b,P,A);if(_===bq)return h(b,P,A);if(_===yq)return l(b,P,A);if(_===xq)return v(b,P,A);if(_===gq)return typeof b.then!="function"&&typeof P.then!="function"&&f(b,P,A);if(_===_q)return x(b,P,A);if(_===vq)return a(b,P,A);if(_===fq)return f(b,P,A);if(Sq[_])return m(b,P,A);if(_===cq)return e(b,P,A);if(_===pq)return r(b,P,A);if(_===dq||_===mq||_===wq)return d(b,P,A);if(S){let O=S[_];if(!O){const C=KB(b);C&&(O=S[C])}if(O)return O(b,P,A)}return!1}}function Aq({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:JB,areArraysEqual:r?Co:eq,areDataViewsEqual:tq,areDatesEqual:rq,areErrorsEqual:nq,areFunctionsEqual:iq,areMapsEqual:r?cy(yP,Co):yP,areNumbersEqual:aq,areObjectsEqual:r?Co:oq,arePrimitiveWrappersEqual:uq,areRegExpsEqual:lq,areSetsEqual:r?cy(mP,Co):mP,areTypedArraysEqual:r?cy(Bs,Co):Bs,areUrlsEqual:sq,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=es(n.areArraysEqual),u=es(n.areMapsEqual),l=es(n.areObjectsEqual),c=es(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:u,areObjectsEqual:l,areSetsEqual:c})}return n}function Eq(e){return function(t,r,n,a,u,l,c){return e(t,r,c)}}function jq({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(c,f){const{cache:d=e?new WeakMap:void 0,meta:h}=r();return t(c,f,{cache:d,equals:n,meta:h,strict:a})};if(e)return function(c,f){return t(c,f,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const u={cache:void 0,equals:n,meta:void 0,strict:a};return function(c,f){return t(c,f,u)}}const Tq=zn();zn({strict:!0});zn({circular:!0});zn({circular:!0,strict:!0});zn({createInternalComparator:()=>wi});zn({strict:!0,createInternalComparator:()=>wi});zn({circular:!0,createInternalComparator:()=>wi});zn({circular:!0,createInternalComparator:()=>wi,strict:!0});function zn(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,u=Aq(e),l=Pq(u),c=r?r(l):Eq(l);return jq({circular:t,comparator:l,createState:n,equals:c,strict:a})}function kq(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function gP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(u){r<0&&(r=u),u-r>t?(e(u),r=-1):kq(a)};requestAnimationFrame(n)}function _m(e){"@babel/helpers - typeof";return _m=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},_m(e)}function Cq(e){return $q(e)||Iq(e)||Nq(e)||Mq()}function Mq(){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 Nq(e,t){if(e){if(typeof e=="string")return bP(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 bP(e,t)}}function bP(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:P<0?0:P},w=function(P){for(var A=P>1?1:P,j=A,T=0;T<8;++T){var _=v(j)-A,O=x(j);if(Math.abs(_-A)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,u=a===void 0?8:a,l=t.dt,c=l===void 0?17:l,f=function(h,v,m){var x=-(h-v)*n,S=m*u,w=m+(x-S)*c/1e3,b=m*c/1e3+h;return Math.abs(b-v)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 d5(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,u;for(u=0;u=0)&&(r[a]=e[a]);return r}function fy(e){return y5(e)||v5(e)||h5(e)||p5()}function p5(){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 h5(e,t){if(e){if(typeof e=="string")return jm(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 jm(e,t)}}function v5(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function y5(e){if(Array.isArray(e))return jm(e)}function jm(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 Fs(e){return Fs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fs(e)}var un=(function(e){w5(r,e);var t=S5(r);function r(n,a){var u;m5(this,r),u=t.call(this,n,a);var l=u.props,c=l.isActive,f=l.attributeName,d=l.from,h=l.to,v=l.steps,m=l.children,x=l.duration;if(u.handleStyleChange=u.handleStyleChange.bind(Cm(u)),u.changeStyle=u.changeStyle.bind(Cm(u)),!c||x<=0)return u.state={style:{}},typeof m=="function"&&(u.state={style:h}),km(u);if(v&&v.length)u.state={style:v[0].style};else if(d){if(typeof m=="function")return u.state={style:d},km(u);u.state={style:f?Ro({},f,d):d}}else u.state={style:{}};return u}return b5(r,[{key:"componentDidMount",value:function(){var a=this.props,u=a.isActive,l=a.canBegin;this.mounted=!0,!(!u||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var u=this.props,l=u.isActive,c=u.canBegin,f=u.attributeName,d=u.shouldReAnimate,h=u.to,v=u.from,m=this.state.style;if(c){if(!l){var x={style:f?Ro({},f,h):h};this.state&&m&&(f&&m[f]!==h||!f&&m!==h)&&this.setState(x);return}if(!(Tq(a.to,h)&&a.canBegin&&a.isActive)){var S=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=S||d?v:a.to;if(this.state&&m){var b={style:f?Ro({},f,w):w};(f&&m[f]!==w||!f&&m!==w)&&this.setState(b)}this.runAnimation(wr(wr({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var u=this,l=a.from,c=a.to,f=a.duration,d=a.easing,h=a.begin,v=a.onAnimationEnd,m=a.onAnimationStart,x=s5(l,c,Zq(d),f,this.changeStyle),S=function(){u.stopJSAnimation=x()};this.manager.start([m,h,S,f,v])}},{key:"runStepAnimation",value:function(a){var u=this,l=a.steps,c=a.begin,f=a.onAnimationStart,d=l[0],h=d.style,v=d.duration,m=v===void 0?0:v,x=function(w,b,P){if(P===0)return w;var A=b.duration,j=b.easing,T=j===void 0?"ease":j,_=b.style,O=b.properties,C=b.onAnimationEnd,M=P>0?l[P-1]:b,$=O||Object.keys(_);if(typeof T=="function"||T==="spring")return[].concat(fy(w),[u.runJSAnimation.bind(u,{from:M.style,to:_,duration:A,easing:T}),A]);var K=SP($,A,T),F=wr(wr(wr({},M.style),_),{},{transition:K});return[].concat(fy(w),[F,A,C]).filter(qq)};return this.manager.start([f].concat(fy(l.reduce(x,[h,Math.max(m,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Rq());var u=a.begin,l=a.duration,c=a.attributeName,f=a.to,d=a.easing,h=a.onAnimationStart,v=a.onAnimationEnd,m=a.steps,x=a.children,S=this.manager;if(this.unSubscribe=S.subscribe(this.handleStyleChange),typeof d=="function"||typeof x=="function"||d==="spring"){this.runJSAnimation(a);return}if(m.length>1){this.runStepAnimation(a);return}var w=c?Ro({},c,f):f,b=SP(Object.keys(w),l,d);S.start([h,u,wr(wr({},w),{},{transition:b}),l,v])}},{key:"render",value:function(){var a=this.props,u=a.children;a.begin;var l=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var f=f5(a,c5),d=D.Children.count(u),h=this.state.style;if(typeof u=="function")return u(h);if(!c||d===0||l<=0)return u;var v=function(x){var S=x.props,w=S.style,b=w===void 0?{}:w,P=S.className,A=D.cloneElement(x,wr(wr({},f),{},{style:wr(wr({},b),h),className:P}));return A};return d===1?v(D.Children.only(u)):q.createElement("div",null,D.Children.map(u,function(m){return v(m)}))}}]),r})(D.PureComponent);un.displayName="Animate";un.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};un.propTypes={from:De.oneOfType([De.object,De.string]),to:De.oneOfType([De.object,De.string]),attributeName:De.string,duration:De.number,begin:De.number,easing:De.oneOfType([De.string,De.func]),steps:De.arrayOf(De.shape({duration:De.number.isRequired,style:De.object.isRequired,easing:De.oneOfType([De.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),De.func]),properties:De.arrayOf("string"),onAnimationEnd:De.func})),children:De.oneOfType([De.node,De.func]),isActive:De.bool,canBegin:De.bool,onAnimationEnd:De.func,shouldReAnimate:De.bool,onAnimationStart:De.func,onAnimationReStart:De.func};function pu(e){"@babel/helpers - typeof";return pu=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},pu(e)}function Us(){return Us=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,f=n>=0?1:-1,d=a>=0&&n>=0||a<0&&n<0?1:0,h;if(l>0&&u instanceof Array){for(var v=[0,0,0,0],m=0,x=4;ml?l:u[m];h="M".concat(t,",").concat(r+c*v[0]),v[0]>0&&(h+="A ".concat(v[0],",").concat(v[0],",0,0,").concat(d,",").concat(t+f*v[0],",").concat(r)),h+="L ".concat(t+n-f*v[1],",").concat(r),v[1]>0&&(h+="A ".concat(v[1],",").concat(v[1],",0,0,").concat(d,`, + `).concat(t+n,",").concat(r+c*v[1])),h+="L ".concat(t+n,",").concat(r+a-c*v[2]),v[2]>0&&(h+="A ".concat(v[2],",").concat(v[2],",0,0,").concat(d,`, + `).concat(t+n-f*v[2],",").concat(r+a)),h+="L ".concat(t+f*v[3],",").concat(r+a),v[3]>0&&(h+="A ".concat(v[3],",").concat(v[3],",0,0,").concat(d,`, + `).concat(t,",").concat(r+a-c*v[3])),h+="Z"}else if(l>0&&u===+u&&u>0){var S=Math.min(l,u);h="M ".concat(t,",").concat(r+c*S,` + A `).concat(S,",").concat(S,",0,0,").concat(d,",").concat(t+f*S,",").concat(r,` + L `).concat(t+n-f*S,",").concat(r,` + A `).concat(S,",").concat(S,",0,0,").concat(d,",").concat(t+n,",").concat(r+c*S,` + L `).concat(t+n,",").concat(r+a-c*S,` + A `).concat(S,",").concat(S,",0,0,").concat(d,",").concat(t+n-f*S,",").concat(r+a,` + L `).concat(t+f*S,",").concat(r+a,` + A `).concat(S,",").concat(S,",0,0,").concat(d,",").concat(t,",").concat(r+a-c*S," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return h},M5=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,u=r.x,l=r.y,c=r.width,f=r.height;if(Math.abs(c)>0&&Math.abs(f)>0){var d=Math.min(u,u+c),h=Math.max(u,u+c),v=Math.min(l,l+f),m=Math.max(l,l+f);return n>=d&&n<=h&&a>=v&&a<=m}return!1},N5={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Xg=function(t){var r=kP(kP({},N5),t),n=D.useRef(),a=D.useState(-1),u=O5(a,2),l=u[0],c=u[1];D.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var T=n.current.getTotalLength();T&&c(T)}catch{}},[]);var f=r.x,d=r.y,h=r.width,v=r.height,m=r.radius,x=r.className,S=r.animationEasing,w=r.animationDuration,b=r.animationBegin,P=r.isAnimationActive,A=r.isUpdateAnimationActive;if(f!==+f||d!==+d||h!==+h||v!==+v||h===0||v===0)return null;var j=Ne("recharts-rectangle",x);return A?q.createElement(un,{canBegin:l>0,from:{width:h,height:v,x:f,y:d},to:{width:h,height:v,x:f,y:d},duration:w,animationEasing:S,isActive:A},function(T){var _=T.width,O=T.height,C=T.x,M=T.y;return q.createElement(un,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:w,isActive:P,easing:S},q.createElement("path",Us({},ke(r,!0),{className:j,d:CP(C,M,_,O,m),ref:n})))}):q.createElement("path",Us({},ke(r,!0),{className:j,d:CP(f,d,h,v,m)}))};function Mm(){return Mm=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 q5(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 z5=function(t,r,n,a,u,l){return"M".concat(t,",").concat(u,"v").concat(a,"M").concat(l,",").concat(r,"h").concat(n)},F5=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,u=a===void 0?0:a,l=t.top,c=l===void 0?0:l,f=t.left,d=f===void 0?0:f,h=t.width,v=h===void 0?0:h,m=t.height,x=m===void 0?0:m,S=t.className,w=B5(t,I5),b=$5({x:n,y:u,top:c,left:d,width:v,height:x},w);return!se(n)||!se(u)||!se(v)||!se(x)||!se(c)||!se(d)?null:q.createElement("path",Nm({},ke(b,!0),{className:Ne("recharts-cross",S),d:z5(n,u,v,x,c,d)}))},dy,NP;function U5(){if(NP)return dy;NP=1;var e=EE(),t=e(Object.getPrototypeOf,Object);return dy=t,dy}var py,IP;function W5(){if(IP)return py;IP=1;var e=ln(),t=U5(),r=sn(),n="[object Object]",a=Function.prototype,u=Object.prototype,l=a.toString,c=u.hasOwnProperty,f=l.call(Object);function d(h){if(!r(h)||e(h)!=n)return!1;var v=t(h);if(v===null)return!0;var m=c.call(v,"constructor")&&v.constructor;return typeof m=="function"&&m instanceof m&&l.call(m)==f}return py=d,py}var H5=W5();const V5=Fe(H5);var hy,$P;function G5(){if($P)return hy;$P=1;var e=ln(),t=sn(),r="[object Boolean]";function n(a){return a===!0||a===!1||t(a)&&e(a)==r}return hy=n,hy}var K5=G5();const X5=Fe(K5);function vu(e){"@babel/helpers - typeof";return vu=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},vu(e)}function Ws(){return Ws=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:m,x:f,y:d},to:{upperWidth:h,lowerWidth:v,height:m,x:f,y:d},duration:w,animationEasing:S,isActive:P},function(j){var T=j.upperWidth,_=j.lowerWidth,O=j.height,C=j.x,M=j.y;return q.createElement(un,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:w,easing:S},q.createElement("path",Ws({},ke(r,!0),{className:A,d:BP(C,M,T,_,O),ref:n})))}):q.createElement("g",null,q.createElement("path",Ws({},ke(r,!0),{className:A,d:BP(f,d,h,v,m)})))},oz=["option","shapeType","propTransformer","activeClassName","isActive"];function yu(e){"@babel/helpers - typeof";return yu=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},yu(e)}function uz(e,t){if(e==null)return{};var r=lz(e,t),n,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function lz(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 qP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Hs(e){for(var t=1;t0&&n.handleDrag(a.changedTouches[0])}),Kt(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,u=a.endIndex,l=a.onDragEnd,c=a.startIndex;l==null||l({endIndex:u,startIndex:c})}),n.detachDragEndListener()}),Kt(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Kt(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Kt(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Kt(n,"handleSlideDragStart",function(a){var u=YP(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:u.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return Rz(t,e),Mz(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,u=n.endX,l=this.state.scaleValues,c=this.props,f=c.gap,d=c.data,h=d.length-1,v=Math.min(a,u),m=Math.max(a,u),x=t.getIndexInRange(l,v),S=t.getIndexInRange(l,m);return{startIndex:x-x%f,endIndex:S===h?h:S-S%f}}},{key:"getTextOfTick",value:function(n){var a=this.props,u=a.data,l=a.tickFormatter,c=a.dataKey,f=Qt(u[n],c,n);return Ae(l)?l(f,n):f}},{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 a=this.state,u=a.slideMoveStartX,l=a.startX,c=a.endX,f=this.props,d=f.x,h=f.width,v=f.travellerWidth,m=f.startIndex,x=f.endIndex,S=f.onChange,w=n.pageX-u;w>0?w=Math.min(w,d+h-v-c,d+h-v-l):w<0&&(w=Math.max(w,d-l,d-c));var b=this.getIndex({startX:l+w,endX:c+w});(b.startIndex!==m||b.endIndex!==x)&&S&&S(b),this.setState({startX:l+w,endX:c+w,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var u=YP(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:u.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,u=a.brushMoveStartX,l=a.movingTravellerId,c=a.endX,f=a.startX,d=this.state[l],h=this.props,v=h.x,m=h.width,x=h.travellerWidth,S=h.onChange,w=h.gap,b=h.data,P={startX:this.state.startX,endX:this.state.endX},A=n.pageX-u;A>0?A=Math.min(A,v+m-x-d):A<0&&(A=Math.max(A,v-d)),P[l]=d+A;var j=this.getIndex(P),T=j.startIndex,_=j.endIndex,O=function(){var M=b.length-1;return l==="startX"&&(c>f?T%w===0:_%w===0)||cf?_%w===0:T%w===0)||c>f&&_===M};this.setState(Kt(Kt({},l,d+A),"brushMoveStartX",n.pageX),function(){S&&O()&&S(j)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var u=this,l=this.state,c=l.scaleValues,f=l.startX,d=l.endX,h=this.state[a],v=c.indexOf(h);if(v!==-1){var m=v+n;if(!(m===-1||m>=c.length)){var x=c[m];a==="startX"&&x>=d||a==="endX"&&x<=f||this.setState(Kt({},a,x),function(){u.props.onChange(u.getIndex({startX:u.state.startX,endX:u.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,u=n.y,l=n.width,c=n.height,f=n.fill,d=n.stroke;return q.createElement("rect",{stroke:d,fill:f,x:a,y:u,width:l,height:c})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,u=n.y,l=n.width,c=n.height,f=n.data,d=n.children,h=n.padding,v=D.Children.only(d);return v?q.cloneElement(v,{x:a,y:u,width:l,height:c,margin:h,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(n,a){var u,l,c=this,f=this.props,d=f.y,h=f.travellerWidth,v=f.height,m=f.traveller,x=f.ariaLabel,S=f.data,w=f.startIndex,b=f.endIndex,P=Math.max(n,this.props.x),A=by(by({},ke(this.props,!1)),{},{x:P,y:d,width:h,height:v}),j=x||"Min value: ".concat((u=S[w])===null||u===void 0?void 0:u.name,", Max value: ").concat((l=S[b])===null||l===void 0?void 0:l.name);return q.createElement(Je,{tabIndex:0,role:"slider","aria-label":j,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),c.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,A))}},{key:"renderSlide",value:function(n,a){var u=this.props,l=u.y,c=u.height,f=u.stroke,d=u.travellerWidth,h=Math.min(n,a)+d,v=Math.max(Math.abs(a-n)-d,0);return q.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:h,y:l,width:v,height:c})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,u=n.endIndex,l=n.y,c=n.height,f=n.travellerWidth,d=n.stroke,h=this.state,v=h.startX,m=h.endX,x=5,S={pointerEvents:"none",fill:d};return q.createElement(Je,{className:"recharts-brush-texts"},q.createElement(ws,Gs({textAnchor:"end",verticalAnchor:"middle",x:Math.min(v,m)-x,y:l+c/2},S),this.getTextOfTick(a)),q.createElement(ws,Gs({textAnchor:"start",verticalAnchor:"middle",x:Math.max(v,m)+f+x,y:l+c/2},S),this.getTextOfTick(u)))}},{key:"render",value:function(){var n=this.props,a=n.data,u=n.className,l=n.children,c=n.x,f=n.y,d=n.width,h=n.height,v=n.alwaysShowText,m=this.state,x=m.startX,S=m.endX,w=m.isTextActive,b=m.isSlideMoving,P=m.isTravellerMoving,A=m.isTravellerFocused;if(!a||!a.length||!se(c)||!se(f)||!se(d)||!se(h)||d<=0||h<=0)return null;var j=Ne("recharts-brush",u),T=q.Children.count(l)===1,_=kz("userSelect","none");return q.createElement(Je,{className:j,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),T&&this.renderPanorama(),this.renderSlide(x,S),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(S,"endX"),(w||b||P||A||v)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,u=n.y,l=n.width,c=n.height,f=n.stroke,d=Math.floor(u+c/2)-1;return q.createElement(q.Fragment,null,q.createElement("rect",{x:a,y:u,width:l,height:c,fill:f,stroke:"none"}),q.createElement("line",{x1:a+1,y1:d,x2:a+l-1,y2:d,fill:"none",stroke:"#fff"}),q.createElement("line",{x1:a+1,y1:d+2,x2:a+l-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var u;return q.isValidElement(n)?u=q.cloneElement(n,a):Ae(n)?u=n(a):u=t.renderDefaultTraveller(a),u}},{key:"getDerivedStateFromProps",value:function(n,a){var u=n.data,l=n.width,c=n.x,f=n.travellerWidth,d=n.updateId,h=n.startIndex,v=n.endIndex;if(u!==a.prevData||d!==a.prevUpdateId)return by({prevData:u,prevTravellerWidth:f,prevUpdateId:d,prevX:c,prevWidth:l},u&&u.length?Lz({data:u,width:l,x:c,travellerWidth:f,startIndex:h,endIndex:v}):{scale:null,scaleValues:null});if(a.scale&&(l!==a.prevWidth||c!==a.prevX||f!==a.prevTravellerWidth)){a.scale.range([c,c+l-f]);var m=a.scale.domain().map(function(x){return a.scale(x)});return{prevData:u,prevTravellerWidth:f,prevUpdateId:d,prevX:c,prevWidth:l,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,a){for(var u=n.length,l=0,c=u-1;c-l>1;){var f=Math.floor((l+c)/2);n[f]>a?c=f:l=f}return a>=n[c]?c:l}}])})(D.PureComponent);Kt(ha,"displayName","Brush");Kt(ha,"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 xy,QP;function Bz(){if(QP)return xy;QP=1;var e=wg();function t(r,n){var a;return e(r,function(u,l,c){return a=n(u,l,c),!a}),!!a}return xy=t,xy}var wy,ZP;function qz(){if(ZP)return wy;ZP=1;var e=xE(),t=Ln(),r=Bz(),n=Ut(),a=mc();function u(l,c,f){var d=n(l)?e:r;return f&&a(l,c,f)&&(c=void 0),d(l,t(c,3))}return wy=u,wy}var zz=qz();const Fz=Fe(zz);var Br=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},Sy,JP;function Uz(){if(JP)return Sy;JP=1;var e=LE();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Sy=t,Sy}var _y,eA;function Wz(){if(eA)return _y;eA=1;var e=Uz(),t=RE(),r=Ln();function n(a,u){var l={};return u=r(u,3),t(a,function(c,f,d){e(l,f,u(c,f,d))}),l}return _y=n,_y}var Hz=Wz();const Vz=Fe(Hz);var Oy,tA;function Gz(){if(tA)return Oy;tA=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function r8(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 n8(e,t){var r=e.x,n=e.y,a=t8(e,Qz),u="".concat(r),l=parseInt(u,10),c="".concat(n),f=parseInt(c,10),d="".concat(t.height||a.height),h=parseInt(d,10),v="".concat(t.width||a.width),m=parseInt(v,10);return Mo(Mo(Mo(Mo(Mo({},t),a),l?{x:l}:{}),f?{y:f}:{}),{},{height:h,width:m,name:t.name,radius:t.radius})}function aA(e){return q.createElement(vz,$m({shapeType:"rectangle",propTransformer:n8,activeClassName:"recharts-active-bar"},e))}var i8=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var u=se(n)||sM(n);return u?t(n,a):(u||yi(),r)}},a8=["value","background"],dT;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 o8(e,t){if(e==null)return{};var r=u8(e,t),n,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function u8(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 Xs(){return Xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(X)0&&Math.abs(Y)0&&(H=Math.min((ce||0)-(Y[ve-1]||0),H))}),Number.isFinite(H)){var X=H/B,J=w.layout==="vertical"?n.height:n.width;if(w.padding==="gap"&&(C=X*J/2),w.padding==="no-gap"){var te=hi(t.barCategoryGap,X*J),G=X*J/2;C=G-te-(G-te)/J*te}}}a==="xAxis"?M=[n.left+(j.left||0)+(C||0),n.left+n.width-(j.right||0)-(C||0)]:a==="yAxis"?M=f==="horizontal"?[n.top+n.height-(j.bottom||0),n.top+(j.top||0)]:[n.top+(j.top||0)+(C||0),n.top+n.height-(j.bottom||0)-(C||0)]:M=w.range,_&&(M=[M[1],M[0]]);var Z=E4(w,u,m),W=Z.scale,I=Z.realScaleType;W.domain(P).range(M),j4(W);var z=R4(W,Sr(Sr({},w),{},{realScaleType:I}));a==="xAxis"?(F=b==="top"&&!T||b==="bottom"&&T,$=n.left,K=v[O]-F*w.height):a==="yAxis"&&(F=b==="left"&&!T||b==="right"&&T,$=v[O]-F*w.width,K=n.top);var oe=Sr(Sr(Sr({},w),z),{},{realScaleType:I,x:$,y:K,scale:W,width:a==="xAxis"?n.width:w.width,height:a==="yAxis"?n.height:w.height});return oe.bandSize=Rs(oe,z),!w.hide&&a==="xAxis"?v[O]+=(F?-1:1)*oe.height:w.hide||(v[O]+=(F?-1:1)*oe.width),Sr(Sr({},x),{},kc({},S,oe))},{})},yT=function(t,r){var n=t.x,a=t.y,u=r.x,l=r.y;return{x:Math.min(n,u),y:Math.min(a,l),width:Math.abs(u-n),height:Math.abs(l-a)}},b8=function(t){var r=t.x1,n=t.y1,a=t.x2,u=t.y2;return yT({x:r,y:n},{x:a,y:u})},mT=(function(){function e(t){v8(this,e),this.scale=t}return y8(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]:{},a=n.bandAware,u=n.position;if(r!==void 0){if(u)switch(u){case"start":return this.scale(r);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(r)+c}default:return this.scale(r)}if(a){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+f}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],u=n[n.length-1];return a<=u?r>=a&&r<=u:r>=u&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])})();kc(mT,"EPS",1e-4);var Qg=function(t){var r=Object.keys(t).reduce(function(n,a){return Sr(Sr({},n),{},kc({},a,mT.create(t[a])))},{});return Sr(Sr({},r),{},{apply:function(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=u.bandAware,c=u.position;return Vz(a,function(f,d){return r[d].apply(f,{bandAware:l,position:c})})},isInRange:function(a){return fT(a,function(u,l){return r[l].isInRange(u)})}})};function x8(e){return(e%180+180)%180}var w8=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,u=x8(a),l=u*Math.PI/180,c=Math.atan(n/r),f=l>c&&l-1?f[d?u[h]:h]:void 0}}return Ey=n,Ey}var jy,fA;function _8(){if(fA)return jy;fA=1;var e=uT();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return jy=t,jy}var Ty,dA;function O8(){if(dA)return Ty;dA=1;var e=CE(),t=Ln(),r=_8(),n=Math.max;function a(u,l,c){var f=u==null?0:u.length;if(!f)return-1;var d=c==null?0:r(c);return d<0&&(d=n(f+d,0)),e(u,t(l,3),d)}return Ty=a,Ty}var ky,pA;function P8(){if(pA)return ky;pA=1;var e=S8(),t=O8(),r=e(t);return ky=r,ky}var A8=P8();const E8=Fe(A8);var j8=GA();const T8=Fe(j8);var k8=T8(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("")}),Zg=D.createContext(void 0),Jg=D.createContext(void 0),gT=D.createContext(void 0),bT=D.createContext({}),xT=D.createContext(void 0),wT=D.createContext(0),ST=D.createContext(0),hA=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,u=r.offset,l=t.clipPathId,c=t.children,f=t.width,d=t.height,h=k8(u);return q.createElement(Zg.Provider,{value:n},q.createElement(Jg.Provider,{value:a},q.createElement(bT.Provider,{value:u},q.createElement(gT.Provider,{value:h},q.createElement(xT.Provider,{value:l},q.createElement(wT.Provider,{value:d},q.createElement(ST.Provider,{value:f},c)))))))},C8=function(){return D.useContext(xT)},_T=function(t){var r=D.useContext(Zg);r==null&&yi();var n=r[t];return n==null&&yi(),n},M8=function(){var t=D.useContext(Zg);return Mn(t)},N8=function(){var t=D.useContext(Jg),r=E8(t,function(n){return fT(n.domain,Number.isFinite)});return r||Mn(t)},OT=function(t){var r=D.useContext(Jg);r==null&&yi();var n=r[t];return n==null&&yi(),n},I8=function(){var t=D.useContext(gT);return t},$8=function(){return D.useContext(bT)},e0=function(){return D.useContext(ST)},t0=function(){return D.useContext(wT)};function ya(e){"@babel/helpers - typeof";return ya=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},ya(e)}function R8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function D8(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var u=r();return e*(t-e*u/2-n)>=0&&e*(t+e*u/2-a)<=0}function gF(e,t){return CT(e,t+1)}function bF(e,t,r,n,a){for(var u=(n||[]).slice(),l=t.start,c=t.end,f=0,d=1,h=l,v=function(){var S=n==null?void 0:n[f];if(S===void 0)return{v:CT(n,d)};var w=f,b,P=function(){return b===void 0&&(b=r(S,w)),b},A=S.coordinate,j=f===0||ec(e,A,P,h,c);j||(f=0,h=l,d+=1),j&&(h=A+e*(P()/2+a),f+=d)},m;d<=u.length;)if(m=v(),m)return m.v;return[]}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 SA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Tt(e){for(var t=1;t0?x.coordinate-b*e:x.coordinate})}else u[m]=x=Tt(Tt({},x),{},{tickCoord:x.coordinate});var P=ec(e,x.tickCoord,w,c,f);P&&(f=x.tickCoord-e*(w()/2+a),u[m]=Tt(Tt({},x),{},{isShow:!0}))},h=l-1;h>=0;h--)d(h);return u}function OF(e,t,r,n,a,u){var l=(n||[]).slice(),c=l.length,f=t.start,d=t.end;if(u){var h=n[c-1],v=r(h,c-1),m=e*(h.coordinate+e*v/2-d);l[c-1]=h=Tt(Tt({},h),{},{tickCoord:m>0?h.coordinate-m*e:h.coordinate});var x=ec(e,h.tickCoord,function(){return v},f,d);x&&(d=h.tickCoord-e*(v/2+a),l[c-1]=Tt(Tt({},h),{},{isShow:!0}))}for(var S=u?c-1:c,w=function(A){var j=l[A],T,_=function(){return T===void 0&&(T=r(j,A)),T};if(A===0){var O=e*(j.coordinate-e*_()/2-f);l[A]=j=Tt(Tt({},j),{},{tickCoord:O<0?j.coordinate-O*e:j.coordinate})}else l[A]=j=Tt(Tt({},j),{},{tickCoord:j.coordinate});var C=ec(e,j.tickCoord,_,f,d);C&&(f=j.tickCoord+e*(_()/2+a),l[A]=Tt(Tt({},j),{},{isShow:!0}))},b=0;b=2?Or(a[1].coordinate-a[0].coordinate):1,P=mF(u,b,x);return f==="equidistantPreserveStart"?bF(b,P,w,a,l):(f==="preserveStart"||f==="preserveStartEnd"?m=OF(b,P,w,a,l,f==="preserveStartEnd"):m=_F(b,P,w,a,l),m.filter(function(A){return A.isShow}))}var PF=["viewBox"],AF=["viewBox"],EF=["ticks"];function ba(e){"@babel/helpers - typeof";return ba=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},ba(e)}function Qi(){return Qi=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 jF(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 TF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OA(e,t){for(var r=0;r0?f(this.props):f(x)),l<=0||c<=0||!S||!S.length?null:q.createElement(Je,{className:Ne("recharts-cartesian-axis",d),ref:function(b){n.layerReference=b}},u&&this.renderAxisLine(),this.renderTicks(S,this.state.fontSize,this.state.letterSpacing),kt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,u){var l,c=Ne(a.className,"recharts-cartesian-axis-tick-value");return q.isValidElement(n)?l=q.cloneElement(n,ft(ft({},a),{},{className:c})):Ae(n)?l=n(ft(ft({},a),{},{className:c})):l=q.createElement(ws,Qi({},a,{className:"recharts-cartesian-axis-tick-value"}),u),l}}])})(D.Component);i0(Na,"displayName","CartesianAxis");i0(Na,"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 RF=["x1","y1","x2","y2","key"],DF=["offset"];function mi(e){"@babel/helpers - typeof";return mi=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},mi(e)}function PA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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 zF(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 FF=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,u=t.y,l=t.width,c=t.height,f=t.ry;return q.createElement("rect",{x:a,y:u,ry:f,width:l,height:c,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function IT(e,t){var r;if(q.isValidElement(e))r=q.cloneElement(e,t);else if(Ae(e))r=e(t);else{var n=t.x1,a=t.y1,u=t.x2,l=t.y2,c=t.key,f=AA(t,RF),d=ke(f,!1);d.offset;var h=AA(d,DF);r=q.createElement("line",si({},h,{x1:n,y1:a,x2:u,y2:l,fill:"none",key:c}))}return r}function UF(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,u=e.horizontalPoints;if(!a||!u||!u.length)return null;var l=u.map(function(c,f){var d=Ct(Ct({},e),{},{x1:t,y1:c,x2:t+r,y2:c,key:"line-".concat(f),index:f});return IT(a,d)});return q.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function WF(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,u=e.verticalPoints;if(!a||!u||!u.length)return null;var l=u.map(function(c,f){var d=Ct(Ct({},e),{},{x1:c,y1:t,x2:c,y2:t+r,key:"line-".concat(f),index:f});return IT(a,d)});return q.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function HF(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,u=e.width,l=e.height,c=e.horizontalPoints,f=e.horizontal,d=f===void 0?!0:f;if(!d||!t||!t.length)return null;var h=c.map(function(m){return Math.round(m+a-a)}).sort(function(m,x){return m-x});a!==h[0]&&h.unshift(0);var v=h.map(function(m,x){var S=!h[x+1],w=S?a+l-m:h[x+1]-m;if(w<=0)return null;var b=x%t.length;return q.createElement("rect",{key:"react-".concat(x),y:m,x:n,height:w,width:u,stroke:"none",fill:t[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return q.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function VF(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,u=e.x,l=e.y,c=e.width,f=e.height,d=e.verticalPoints;if(!r||!n||!n.length)return null;var h=d.map(function(m){return Math.round(m+u-u)}).sort(function(m,x){return m-x});u!==h[0]&&h.unshift(0);var v=h.map(function(m,x){var S=!h[x+1],w=S?u+c-m:h[x+1]-m;if(w<=0)return null;var b=x%n.length;return q.createElement("rect",{key:"react-".concat(x),x:m,y:l,width:w,height:f,stroke:"none",fill:n[b],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return q.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var GF=function(t,r){var n=t.xAxis,a=t.width,u=t.height,l=t.offset;return Kj(n0(Ct(Ct(Ct({},Na.defaultProps),n),{},{ticks:Jr(n,!0),viewBox:{x:0,y:0,width:a,height:u}})),l.left,l.left+l.width,r)},KF=function(t,r){var n=t.yAxis,a=t.width,u=t.height,l=t.offset;return Kj(n0(Ct(Ct(Ct({},Na.defaultProps),n),{},{ticks:Jr(n,!0),viewBox:{x:0,y:0,width:a,height:u}})),l.top,l.top+l.height,r)},Xi={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function $T(e){var t,r,n,a,u,l,c=e0(),f=t0(),d=$8(),h=Ct(Ct({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Xi.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Xi.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Xi.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Xi.horizontalFill,vertical:(u=e.vertical)!==null&&u!==void 0?u:Xi.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:Xi.verticalFill,x:se(e.x)?e.x:d.left,y:se(e.y)?e.y:d.top,width:se(e.width)?e.width:d.width,height:se(e.height)?e.height:d.height}),v=h.x,m=h.y,x=h.width,S=h.height,w=h.syncWithTicks,b=h.horizontalValues,P=h.verticalValues,A=M8(),j=N8();if(!se(x)||x<=0||!se(S)||S<=0||!se(v)||v!==+v||!se(m)||m!==+m)return null;var T=h.verticalCoordinatesGenerator||GF,_=h.horizontalCoordinatesGenerator||KF,O=h.horizontalPoints,C=h.verticalPoints;if((!O||!O.length)&&Ae(_)){var M=b&&b.length,$=_({yAxis:j?Ct(Ct({},j),{},{ticks:M?b:j.ticks}):void 0,width:c,height:f,offset:d},M?!0:w);tn(Array.isArray($),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(mi($),"]")),Array.isArray($)&&(O=$)}if((!C||!C.length)&&Ae(T)){var K=P&&P.length,F=T({xAxis:A?Ct(Ct({},A),{},{ticks:K?P:A.ticks}):void 0,width:c,height:f,offset:d},K?!0:w);tn(Array.isArray(F),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(mi(F),"]")),Array.isArray(F)&&(C=F)}return q.createElement("g",{className:"recharts-cartesian-grid"},q.createElement(FF,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),q.createElement(UF,si({},h,{offset:d,horizontalPoints:O,xAxis:A,yAxis:j})),q.createElement(WF,si({},h,{offset:d,verticalPoints:C,xAxis:A,yAxis:j})),q.createElement(HF,si({},h,{horizontalPoints:O})),q.createElement(VF,si({},h,{verticalPoints:C})))}$T.displayName="CartesianGrid";var XF=["layout","type","stroke","connectNulls","isRange","ref"],YF=["key"],RT;function xa(e){"@babel/helpers - typeof";return xa=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},xa(e)}function DT(e,t){if(e==null)return{};var r=QF(e,t),n,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(a=0;a=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}function ci(){return ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!eu(h,l)||!eu(v,c))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(l,c,n,a)}},{key:"render",value:function(){var n,a=this.props,u=a.hide,l=a.dot,c=a.points,f=a.className,d=a.top,h=a.left,v=a.xAxis,m=a.yAxis,x=a.width,S=a.height,w=a.isAnimationActive,b=a.id;if(u||!c||!c.length)return null;var P=this.state.isAnimationFinished,A=c.length===1,j=Ne("recharts-area",f),T=v&&v.allowDataOverflow,_=m&&m.allowDataOverflow,O=T||_,C=Ce(b)?this.id:b,M=(n=ke(l,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},$=M.r,K=$===void 0?3:$,F=M.strokeWidth,B=F===void 0?2:F,H=wM(l)?l:{},Y=H.clipDot,X=Y===void 0?!0:Y,J=K*2+B;return q.createElement(Je,{className:j},T||_?q.createElement("defs",null,q.createElement("clipPath",{id:"clipPath-".concat(C)},q.createElement("rect",{x:T?h:h-x/2,y:_?d:d-S/2,width:T?x:x*2,height:_?S:S*2})),!X&&q.createElement("clipPath",{id:"clipPath-dots-".concat(C)},q.createElement("rect",{x:h-J/2,y:d-J/2,width:x+J,height:S+J}))):null,A?null:this.renderArea(O,C),(l||A)&&this.renderDots(O,X,C),(!w||P)&&Rn.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])})(D.PureComponent);RT=Fn;Dr(Fn,"displayName","Area");Dr(Fn,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Ta.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Dr(Fn,"getBaseValue",function(e,t,r,n){var a=e.layout,u=e.baseValue,l=t.props.baseValue,c=l??u;if(se(c)&&typeof c=="number")return c;var f=a==="horizontal"?n:r,d=f.scale.domain();if(f.type==="number"){var h=Math.max(d[0],d[1]),v=Math.min(d[0],d[1]);return c==="dataMin"?v:c==="dataMax"||h<0?h:Math.max(Math.min(d[0],d[1]),0)}return c==="dataMin"?d[0]:c==="dataMax"?d[1]:d[0]});Dr(Fn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,u=e.xAxisTicks,l=e.yAxisTicks,c=e.bandSize,f=e.dataKey,d=e.stackedData,h=e.dataStartIndex,v=e.displayedData,m=e.offset,x=t.layout,S=d&&d.length,w=RT.getBaseValue(t,r,n,a),b=x==="horizontal",P=!1,A=v.map(function(T,_){var O;S?O=d[h+_]:(O=Qt(T,f),Array.isArray(O)?P=!0:O=[w,O]);var C=O[1]==null||S&&Qt(T,f)==null;return b?{x:VO({axis:n,ticks:u,bandSize:c,entry:T,index:_}),y:C?null:a.scale(O[1]),value:O,payload:T}:{x:C?null:n.scale(O[1]),y:VO({axis:a,ticks:l,bandSize:c,entry:T,index:_}),value:O,payload:T}}),j;return S||P?j=A.map(function(T){var _=Array.isArray(T.value)?T.value[0]:null;return b?{x:T.x,y:_!=null&&T.y!=null?a.scale(_):null}:{x:_!=null?n.scale(_):null,y:T.y}}):j=b?a.scale(w):n.scale(w),kn({points:A,baseLine:j,layout:x,isRange:P},m)});Dr(Fn,"renderDotItem",function(e,t){var r;if(q.isValidElement(e))r=q.cloneElement(e,t);else if(Ae(e))r=e(t);else{var n=Ne("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,u=DT(t,YF);r=q.createElement(Yg,ci({},u,{key:a,className:n}))}return r});function wa(e){"@babel/helpers - typeof";return wa=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},wa(e)}function a6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o6(e,t){for(var r=0;re.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 G6(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 K6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X6(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?l:t&&t.length&&se(a)&&se(u)?t.slice(a,u+1):[]};function ZT(e){return e==="number"?[0,"auto"]:void 0}var Jm=function(t,r,n,a){var u=t.graphicalItems,l=t.tooltipAxis,c=Dc(r,t);return n<0||!u||!u.length||n>=c.length?null:u.reduce(function(f,d){var h,v=(h=d.props.data)!==null&&h!==void 0?h:r;v&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(v=v.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(l.dataKey&&!l.allowDuplicatedCategory){var x=v===void 0?c:v;m=ls(x,l.dataKey,a)}else m=v&&v[n]||c[n];return m?[].concat(Oa(f),[Yj(d,m)]):f},[])},$A=function(t,r,n,a){var u=a||{x:t.chartX,y:t.chartY},l=uU(u,n),c=t.orderedTooltipTicks,f=t.tooltipAxis,d=t.tooltipTicks,h=w4(l,c,d,f);if(h>=0&&d){var v=d[h]&&d[h].value,m=Jm(t,r,h,v),x=lU(n,c,h,u);return{activeTooltipIndex:h,activeLabel:v,activePayload:m,activeCoordinate:x}}return null},sU=function(t,r){var n=r.axes,a=r.graphicalItems,u=r.axisType,l=r.axisIdKey,c=r.stackGroups,f=r.dataStartIndex,d=r.dataEndIndex,h=t.layout,v=t.children,m=t.stackOffset,x=Gj(h,u);return n.reduce(function(S,w){var b,P=w.type.defaultProps!==void 0?ee(ee({},w.type.defaultProps),w.props):w.props,A=P.type,j=P.dataKey,T=P.allowDataOverflow,_=P.allowDuplicatedCategory,O=P.scale,C=P.ticks,M=P.includeHidden,$=P[l];if(S[$])return S;var K=Dc(t.data,{graphicalItems:a.filter(function(z){var oe,ce=l in z.props?z.props[l]:(oe=z.type.defaultProps)===null||oe===void 0?void 0:oe[l];return ce===$}),dataStartIndex:f,dataEndIndex:d}),F=K.length,B,H,Y;$6(P.domain,T,A)&&(B=gm(P.domain,null,T),x&&(A==="number"||O!=="auto")&&(Y=Bo(K,j,"category")));var X=ZT(A);if(!B||B.length===0){var J,te=(J=P.domain)!==null&&J!==void 0?J:X;if(j){if(B=Bo(K,j,A),A==="category"&&x){var G=fM(B);_&&G?(H=B,B=Vs(0,F)):_||(B=YO(te,B,w).reduce(function(z,oe){return z.indexOf(oe)>=0?z:[].concat(Oa(z),[oe])},[]))}else if(A==="category")_?B=B.filter(function(z){return z!==""&&!Ce(z)}):B=YO(te,B,w).reduce(function(z,oe){return z.indexOf(oe)>=0||oe===""||Ce(oe)?z:[].concat(Oa(z),[oe])},[]);else if(A==="number"){var Z=A4(K,a.filter(function(z){var oe,ce,ve=l in z.props?z.props[l]:(oe=z.type.defaultProps)===null||oe===void 0?void 0:oe[l],ge="hide"in z.props?z.props.hide:(ce=z.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return ve===$&&(M||!ge)}),j,u,h);Z&&(B=Z)}x&&(A==="number"||O!=="auto")&&(Y=Bo(K,j,"category"))}else x?B=Vs(0,F):c&&c[$]&&c[$].hasStack&&A==="number"?B=m==="expand"?[0,1]:Xj(c[$].stackGroups,f,d):B=Vj(K,a.filter(function(z){var oe=l in z.props?z.props[l]:z.type.defaultProps[l],ce="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return oe===$&&(M||!ce)}),A,h,!0);if(A==="number")B=Ym(v,B,$,u,C),te&&(B=gm(te,B,T));else if(A==="category"&&te){var W=te,I=B.every(function(z){return W.indexOf(z)>=0});I&&(B=W)}}return ee(ee({},S),{},_e({},$,ee(ee({},P),{},{axisType:u,domain:B,categoricalDomain:Y,duplicateDomain:H,originalDomain:(b=P.domain)!==null&&b!==void 0?b:X,isCategorical:x,layout:h})))},{})},cU=function(t,r){var n=r.graphicalItems,a=r.Axis,u=r.axisType,l=r.axisIdKey,c=r.stackGroups,f=r.dataStartIndex,d=r.dataEndIndex,h=t.layout,v=t.children,m=Dc(t.data,{graphicalItems:n,dataStartIndex:f,dataEndIndex:d}),x=m.length,S=Gj(h,u),w=-1;return n.reduce(function(b,P){var A=P.type.defaultProps!==void 0?ee(ee({},P.type.defaultProps),P.props):P.props,j=A[l],T=ZT("number");if(!b[j]){w++;var _;return S?_=Vs(0,x):c&&c[j]&&c[j].hasStack?(_=Xj(c[j].stackGroups,f,d),_=Ym(v,_,j,u)):(_=gm(T,Vj(m,n.filter(function(O){var C,M,$=l in O.props?O.props[l]:(C=O.type.defaultProps)===null||C===void 0?void 0:C[l],K="hide"in O.props?O.props.hide:(M=O.type.defaultProps)===null||M===void 0?void 0:M.hide;return $===j&&!K}),"number",h),a.defaultProps.allowDataOverflow),_=Ym(v,_,j,u)),ee(ee({},b),{},_e({},j,ee(ee({axisType:u},a.defaultProps),{},{hide:!0,orientation:sr(aU,"".concat(u,".").concat(w%2),null),domain:_,originalDomain:T,isCategorical:S,layout:h})))}return b},{})},fU=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,u=r.AxisComp,l=r.graphicalItems,c=r.stackGroups,f=r.dataStartIndex,d=r.dataEndIndex,h=t.children,v="".concat(a,"Id"),m=Pr(h,u),x={};return m&&m.length?x=sU(t,{axes:m,graphicalItems:l,axisType:a,axisIdKey:v,stackGroups:c,dataStartIndex:f,dataEndIndex:d}):l&&l.length&&(x=cU(t,{Axis:u,graphicalItems:l,axisType:a,axisIdKey:v,stackGroups:c,dataStartIndex:f,dataEndIndex:d})),x},dU=function(t){var r=Mn(t),n=Jr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:Sg(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Rs(r,n)}},RA=function(t){var r=t.children,n=t.defaultShowTooltip,a=Xt(r,ha),u=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(u=a.props.startIndex),a.props.endIndex>=0&&(l=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:u,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!n}},pU=function(t){return!t||!t.length?!1:t.some(function(r){var n=en(r&&r.type);return n&&n.indexOf("Bar")>=0})},DA=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"}},hU=function(t,r){var n=t.props,a=t.graphicalItems,u=t.xAxisMap,l=u===void 0?{}:u,c=t.yAxisMap,f=c===void 0?{}:c,d=n.width,h=n.height,v=n.children,m=n.margin||{},x=Xt(v,ha),S=Xt(v,ea),w=Object.keys(f).reduce(function(_,O){var C=f[O],M=C.orientation;return!C.mirror&&!C.hide?ee(ee({},_),{},_e({},M,_[M]+C.width)):_},{left:m.left||0,right:m.right||0}),b=Object.keys(l).reduce(function(_,O){var C=l[O],M=C.orientation;return!C.mirror&&!C.hide?ee(ee({},_),{},_e({},M,sr(_,"".concat(M))+C.height)):_},{top:m.top||0,bottom:m.bottom||0}),P=ee(ee({},b),w),A=P.bottom;x&&(P.bottom+=x.props.height||ha.defaultProps.height),S&&r&&(P=O4(P,a,n,r));var j=d-P.left-P.right,T=h-P.top-P.bottom;return ee(ee({brushBottom:A},P),{},{width:Math.max(j,0),height:Math.max(T,0)})},vU=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},yU=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,u=a===void 0?"axis":a,l=t.validateTooltipEventTypes,c=l===void 0?["axis"]:l,f=t.axisComponents,d=t.legendContent,h=t.formatAxisMap,v=t.defaultProps,m=function(P,A){var j=A.graphicalItems,T=A.stackGroups,_=A.offset,O=A.updateId,C=A.dataStartIndex,M=A.dataEndIndex,$=P.barSize,K=P.layout,F=P.barGap,B=P.barCategoryGap,H=P.maxBarSize,Y=DA(K),X=Y.numericAxisName,J=Y.cateAxisName,te=pU(j),G=[];return j.forEach(function(Z,W){var I=Dc(P.data,{graphicalItems:[Z],dataStartIndex:C,dataEndIndex:M}),z=Z.type.defaultProps!==void 0?ee(ee({},Z.type.defaultProps),Z.props):Z.props,oe=z.dataKey,ce=z.maxBarSize,ve=z["".concat(X,"Id")],ge=z["".concat(J,"Id")],Ee={},Se=f.reduce(function($t,pr){var Si=A["".concat(pr.axisType,"Map")],Ia=z["".concat(pr.axisType,"Id")];Si&&Si[Ia]||pr.axisType==="zAxis"||yi();var $a=Si[Ia];return ee(ee({},$t),{},_e(_e({},pr.axisType,$a),"".concat(pr.axisType,"Ticks"),Jr($a)))},Ee),ue=Se[J],be=Se["".concat(J,"Ticks")],Pe=T&&T[ve]&&T[ve].hasStack&&L4(Z,T[ve].stackGroups),ie=en(Z.type).indexOf("Bar")>=0,qe=Rs(ue,be),Te=[],et=te&&S4({barSize:$,stackGroups:T,totalSize:vU(Se,J)});if(ie){var tt,vt,dr=Ce(ce)?H:ce,Er=(tt=(vt=Rs(ue,be,!0))!==null&&vt!==void 0?vt:dr)!==null&&tt!==void 0?tt:0;Te=_4({barGap:F,barCategoryGap:B,bandSize:Er!==qe?Er:qe,sizeList:et[ge],maxBarSize:dr}),Er!==qe&&(Te=Te.map(function($t){return ee(ee({},$t),{},{position:ee(ee({},$t.position),{},{offset:$t.position.offset-Er/2})})}))}var jr=Z&&Z.type&&Z.type.getComposedData;jr&&G.push({props:ee(ee({},jr(ee(ee({},Se),{},{displayedData:I,props:P,dataKey:oe,item:Z,bandSize:qe,barPosition:Te,offset:_,stackedData:Pe,layout:K,dataStartIndex:C,dataEndIndex:M}))),{},_e(_e(_e({key:Z.key||"item-".concat(W)},X,Se[X]),J,Se[J]),"animationId",O)),childIndex:OM(Z,P.children),item:Z})}),G},x=function(P,A){var j=P.props,T=P.dataStartIndex,_=P.dataEndIndex,O=P.updateId;if(!c1({props:j}))return null;var C=j.children,M=j.layout,$=j.stackOffset,K=j.data,F=j.reverseStackOrder,B=DA(M),H=B.numericAxisName,Y=B.cateAxisName,X=Pr(C,n),J=$4(K,X,"".concat(H,"Id"),"".concat(Y,"Id"),$,F),te=f.reduce(function(z,oe){var ce="".concat(oe.axisType,"Map");return ee(ee({},z),{},_e({},ce,fU(j,ee(ee({},oe),{},{graphicalItems:X,stackGroups:oe.axisType===H&&J,dataStartIndex:T,dataEndIndex:_}))))},{}),G=hU(ee(ee({},te),{},{props:j,graphicalItems:X}),A==null?void 0:A.legendBBox);Object.keys(te).forEach(function(z){te[z]=h(j,te[z],G,z.replace("Map",""),r)});var Z=te["".concat(Y,"Map")],W=dU(Z),I=m(j,ee(ee({},te),{},{dataStartIndex:T,dataEndIndex:_,updateId:O,graphicalItems:X,stackGroups:J,offset:G}));return ee(ee({formattedGraphicalItems:I,graphicalItems:X,offset:G,stackGroups:J},W),te)},S=(function(b){function P(A){var j,T,_;return K6(this,P),_=Q6(this,P,[A]),_e(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),_e(_,"accessibilityManager",new I6),_e(_,"handleLegendBBoxUpdate",function(O){if(O){var C=_.state,M=C.dataStartIndex,$=C.dataEndIndex,K=C.updateId;_.setState(ee({legendBBox:O},x({props:_.props,dataStartIndex:M,dataEndIndex:$,updateId:K},ee(ee({},_.state),{},{legendBBox:O}))))}}),_e(_,"handleReceiveSyncEvent",function(O,C,M){if(_.props.syncId===O){if(M===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(C)}}),_e(_,"handleBrushChange",function(O){var C=O.startIndex,M=O.endIndex;if(C!==_.state.dataStartIndex||M!==_.state.dataEndIndex){var $=_.state.updateId;_.setState(function(){return ee({dataStartIndex:C,dataEndIndex:M},x({props:_.props,dataStartIndex:C,dataEndIndex:M,updateId:$},_.state))}),_.triggerSyncEvent({dataStartIndex:C,dataEndIndex:M})}}),_e(_,"handleMouseEnter",function(O){var C=_.getMouseInfo(O);if(C){var M=ee(ee({},C),{},{isTooltipActive:!0});_.setState(M),_.triggerSyncEvent(M);var $=_.props.onMouseEnter;Ae($)&&$(M,O)}}),_e(_,"triggeredAfterMouseMove",function(O){var C=_.getMouseInfo(O),M=C?ee(ee({},C),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(M),_.triggerSyncEvent(M);var $=_.props.onMouseMove;Ae($)&&$(M,O)}),_e(_,"handleItemMouseEnter",function(O){_.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),_e(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),_e(_,"handleMouseMove",function(O){O.persist(),_.throttleTriggeredAfterMouseMove(O)}),_e(_,"handleMouseLeave",function(O){_.throttleTriggeredAfterMouseMove.cancel();var C={isTooltipActive:!1};_.setState(C),_.triggerSyncEvent(C);var M=_.props.onMouseLeave;Ae(M)&&M(C,O)}),_e(_,"handleOuterEvent",function(O){var C=_M(O),M=sr(_.props,"".concat(C));if(C&&Ae(M)){var $,K;/.*touch.*/i.test(C)?K=_.getMouseInfo(O.changedTouches[0]):K=_.getMouseInfo(O),M(($=K)!==null&&$!==void 0?$:{},O)}}),_e(_,"handleClick",function(O){var C=_.getMouseInfo(O);if(C){var M=ee(ee({},C),{},{isTooltipActive:!0});_.setState(M),_.triggerSyncEvent(M);var $=_.props.onClick;Ae($)&&$(M,O)}}),_e(_,"handleMouseDown",function(O){var C=_.props.onMouseDown;if(Ae(C)){var M=_.getMouseInfo(O);C(M,O)}}),_e(_,"handleMouseUp",function(O){var C=_.props.onMouseUp;if(Ae(C)){var M=_.getMouseInfo(O);C(M,O)}}),_e(_,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),_e(_,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&_.handleMouseDown(O.changedTouches[0])}),_e(_,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&_.handleMouseUp(O.changedTouches[0])}),_e(_,"handleDoubleClick",function(O){var C=_.props.onDoubleClick;if(Ae(C)){var M=_.getMouseInfo(O);C(M,O)}}),_e(_,"handleContextMenu",function(O){var C=_.props.onContextMenu;if(Ae(C)){var M=_.getMouseInfo(O);C(M,O)}}),_e(_,"triggerSyncEvent",function(O){_.props.syncId!==void 0&&Ny.emit(Iy,_.props.syncId,O,_.eventEmitterSymbol)}),_e(_,"applySyncEvent",function(O){var C=_.props,M=C.layout,$=C.syncMethod,K=_.state.updateId,F=O.dataStartIndex,B=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)_.setState(ee({dataStartIndex:F,dataEndIndex:B},x({props:_.props,dataStartIndex:F,dataEndIndex:B,updateId:K},_.state)));else if(O.activeTooltipIndex!==void 0){var H=O.chartX,Y=O.chartY,X=O.activeTooltipIndex,J=_.state,te=J.offset,G=J.tooltipTicks;if(!te)return;if(typeof $=="function")X=$(G,O);else if($==="value"){X=-1;for(var Z=0;Z=0){var Pe,ie;if(H.dataKey&&!H.allowDuplicatedCategory){var qe=typeof H.dataKey=="function"?be:"payload.".concat(H.dataKey.toString());Pe=ls(Z,qe,X),ie=W&&I&&ls(I,qe,X)}else Pe=Z==null?void 0:Z[Y],ie=W&&I&&I[Y];if(ge||ve){var Te=O.props.activeIndex!==void 0?O.props.activeIndex:Y;return[D.cloneElement(O,ee(ee(ee({},$.props),Se),{},{activeIndex:Te})),null,null]}if(!Ce(Pe))return[ue].concat(Oa(_.renderActivePoints({item:$,activePoint:Pe,basePoint:ie,childIndex:Y,isRange:W})))}else{var et,tt=(et=_.getItemByXY(_.state.activeCoordinate))!==null&&et!==void 0?et:{graphicalItem:ue},vt=tt.graphicalItem,dr=vt.item,Er=dr===void 0?O:dr,jr=vt.childIndex,$t=ee(ee(ee({},$.props),Se),{},{activeIndex:jr});return[D.cloneElement(Er,$t),null,null]}return W?[ue,null,null]:[ue,null]}),_e(_,"renderCustomized",function(O,C,M){return D.cloneElement(O,ee(ee({key:"recharts-customized-".concat(M)},_.props),_.state))}),_e(_,"renderMap",{CartesianGrid:{handler:rs,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:rs},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:rs},YAxis:{handler:rs},Brush:{handler:_.renderBrush,once:!0},Bar:{handler:_.renderGraphicChild},Line:{handler:_.renderGraphicChild},Area:{handler:_.renderGraphicChild},Radar:{handler:_.renderGraphicChild},RadialBar:{handler:_.renderGraphicChild},Scatter:{handler:_.renderGraphicChild},Pie:{handler:_.renderGraphicChild},Funnel:{handler:_.renderGraphicChild},Tooltip:{handler:_.renderCursor,once:!0},PolarGrid:{handler:_.renderPolarGrid,once:!0},PolarAngleAxis:{handler:_.renderPolarAxis},PolarRadiusAxis:{handler:_.renderPolarAxis},Customized:{handler:_.renderCustomized}}),_.clipPathId="".concat((j=A.id)!==null&&j!==void 0?j:Au("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=WE(_.triggeredAfterMouseMove,(T=A.throttleDelay)!==null&&T!==void 0?T:1e3/60),_.state={},_}return eU(P,b),Y6(P,[{key:"componentDidMount",value:function(){var j,T;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var j=this.props,T=j.children,_=j.data,O=j.height,C=j.layout,M=Xt(T,Ir);if(M){var $=M.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var K=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,F=Jm(this.state,_,$,K),B=this.state.tooltipTicks[$].coordinate,H=(this.state.offset.top+O)/2,Y=C==="horizontal",X=Y?{x:B,y:H}:{y:B,x:H},J=this.state.formattedGraphicalItems.find(function(G){var Z=G.item;return Z.type.name==="Scatter"});J&&(X=ee(ee({},X),J.props.points[$].tooltipPosition),F=J.props.points[$].tooltipPayload);var te={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:K,activePayload:F,activeCoordinate:X};this.setState(te),this.renderCursor(M),this.accessibilityManager.setIndex($)}}}},{key:"getSnapshotBeforeUpdate",value:function(j,T){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==T.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==j.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==j.margin){var _,O;this.accessibilityManager.setDetails({offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(j){qy([Xt(j.children,Ir)],[Xt(this.props.children,Ir)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var j=Xt(this.props.children,Ir);if(j&&typeof j.props.shared=="boolean"){var T=j.props.shared?"axis":"item";return c.indexOf(T)>=0?T:u}return u}},{key:"getMouseInfo",value:function(j){if(!this.container)return null;var T=this.container,_=T.getBoundingClientRect(),O=fR(_),C={chartX:Math.round(j.pageX-O.left),chartY:Math.round(j.pageY-O.top)},M=_.width/T.offsetWidth||1,$=this.inRange(C.chartX,C.chartY,M);if(!$)return null;var K=this.state,F=K.xAxisMap,B=K.yAxisMap,H=this.getTooltipEventType(),Y=$A(this.state,this.props.data,this.props.layout,$);if(H!=="axis"&&F&&B){var X=Mn(F).scale,J=Mn(B).scale,te=X&&X.invert?X.invert(C.chartX):null,G=J&&J.invert?J.invert(C.chartY):null;return ee(ee({},C),{},{xValue:te,yValue:G},Y)}return Y?ee(ee({},C),Y):null}},{key:"inRange",value:function(j,T){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,C=j/_,M=T/_;if(O==="horizontal"||O==="vertical"){var $=this.state.offset,K=C>=$.left&&C<=$.left+$.width&&M>=$.top&&M<=$.top+$.height;return K?{x:C,y:M}:null}var F=this.state,B=F.angleAxisMap,H=F.radiusAxisMap;if(B&&H){var Y=Mn(B);return JO({x:C,y:M},Y)}return null}},{key:"parseEventsOfWrapper",value:function(){var j=this.props.children,T=this.getTooltipEventType(),_=Xt(j,Ir),O={};_&&T==="axis"&&(_.props.trigger==="click"?O={onClick:this.handleClick}:O={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 C=ss(this.props,this.handleOuterEvent);return ee(ee({},C),O)}},{key:"addListener",value:function(){Ny.on(Iy,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Ny.removeListener(Iy,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(j,T,_){for(var O=this.state.formattedGraphicalItems,C=0,M=O.length;C{let n=String(r[0]);try{const u=new Date(r[0]);Number.isNaN(u.getTime())||(n=u.toLocaleTimeString("en-GB",{hour12:!1}))}catch{}const a=r.length>t?Number(r[t]):0;return{time:n,value:Number.isFinite(a)?a:0}}):[]}function os(e){return e.slice(-30)}function us(e){return e.length===0?null:e[e.length-1].value}function bU(e){return e===null?"text-gray-400":e>=90?"text-red-400":e>=70?"text-amber-400":"text-green-400"}function is({label:e,deviceTag:t,points:r,stroke:n,fill:a,fillOpacity:u=.15}){const l=os(r),c=us(l);return k.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-3",children:[k.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm",style:{backgroundColor:n}}),k.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-400",children:e}),k.jsx("span",{className:"rounded border px-1.5 py-0 text-[9px] font-bold",style:{color:n,borderColor:n+"50",backgroundColor:n+"15"},children:t})]}),k.jsx("div",{className:"text-right",children:c!==null?k.jsxs("span",{className:`font-mono text-xl font-bold ${bU(c)}`,style:{animation:"number-tick 0.25s ease-out"},children:[Math.round(c),k.jsx("span",{className:"ml-0.5 text-xs font-normal opacity-60",children:"%"})]},String(Math.round(c))):k.jsx("span",{className:"text-xs text-gray-400",children:"–"})})]}),l.length===0?k.jsx("div",{className:"flex h-[90px] items-center justify-center",children:k.jsxs("div",{className:"flex flex-col items-center gap-1",children:[k.jsx("div",{className:"h-4 w-4 animate-spin-slow rounded-full border-2 border-gray-200 border-t-transparent"}),k.jsx("span",{className:"text-[10px] text-gray-400",children:"Waiting for data…"})]})}):k.jsx("div",{className:"h-[90px]",children:k.jsx(iR,{width:"100%",height:"100%",children:k.jsxs(mU,{data:l,margin:{top:4,right:0,bottom:0,left:0},children:[k.jsx("defs",{children:k.jsxs("linearGradient",{id:`grad-${e}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[k.jsx("stop",{offset:"5%",stopColor:a,stopOpacity:u*3}),k.jsx("stop",{offset:"95%",stopColor:a,stopOpacity:0})]})}),k.jsx($T,{strokeDasharray:"3 3",stroke:"#e2e8f0",vertical:!1}),k.jsx(wu,{y:90,stroke:"#ef444460",strokeDasharray:"4 2",strokeWidth:1}),k.jsx(wu,{y:50,stroke:"#33415540",strokeDasharray:"4 2",strokeWidth:1}),k.jsx($c,{dataKey:"time",hide:!0}),k.jsx(Rc,{domain:[0,100],tick:{fontSize:9,fill:"#64748b"},width:26,unit:"%",tickLine:!1,axisLine:!1}),k.jsx(Ir,{contentStyle:{background:"#ffffff",border:"1px solid #e2e8f0",borderRadius:"6px",fontSize:"11px",color:"#1e293b"},itemStyle:{color:n},formatter:f=>[`${f.toFixed(1)}%`,e],labelStyle:{color:"#94a3b8",marginBottom:"2px"}}),k.jsx(Fn,{type:"monotone",dataKey:"value",stroke:n,strokeWidth:2,fill:`url(#grad-${e})`,dot:!1,isAnimationActive:!1})]})})})]})}function xU({metrics:e}){const t=ns(e.cpu_utilization),r=ns(e.gpu_utilization),n=ns(e.npu_utilization),a=ns(e.memory,4),u=us(os(t)),l=us(os(r)),c=us(os(n));return k.jsxs("div",{className:"space-y-2",children:[k.jsxs("div",{className:"flex items-center justify-between",children:[k.jsx("h2",{className:"text-xs font-semibold uppercase tracking-widest text-gray-400",children:"Hardware Utilization"}),k.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-green-100 px-2.5 py-0.5 text-[10px] font-semibold text-green-700",children:[k.jsx("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-500"}),"LIVE"]})]}),k.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{label:"CPU",val:u,color:"#0071c5"},{label:"GPU",val:l,color:"#16a34a"},{label:"NPU",val:c,color:"#9333ea"}].map(({label:f,val:d,color:h})=>k.jsxs("div",{className:"flex flex-col items-center rounded-lg border border-gray-200 bg-white py-2",children:[k.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-gray-400",children:f}),k.jsx("span",{className:"mt-0.5 font-mono text-2xl font-bold",style:{color:h},children:d!==null?`${Math.round(d)}`:"—"}),k.jsx("span",{className:"text-[9px] text-gray-400",children:"%"})]},f))}),k.jsx(is,{label:"CPU Utilization",deviceTag:"CPU",points:t,stroke:"#0071c5",fill:"#0071c5"}),k.jsx(is,{label:"GPU Utilization",deviceTag:"GPU",points:r,stroke:"#16a34a",fill:"#16a34a"}),k.jsx(is,{label:"NPU Utilization",deviceTag:"NPU",points:n,stroke:"#9333ea",fill:"#9333ea"}),k.jsx(is,{label:"Memory",deviceTag:"RAM",points:a,stroke:"#64748b",fill:"#64748b",fillOpacity:.1})]})}function wU({devices:e,selectedId:t,onSelect:r,error:n}){return k.jsxs("div",{children:[k.jsx("p",{className:"text-sm text-kiosk-textmd mb-2",children:"Select the microphone to use for recording."}),k.jsx("select",{className:"w-full border border-kiosk-border rounded-md px-3 py-2 text-sm text-intel-dark bg-white focus:outline-none focus:ring-2 focus:ring-intel-blue",value:t,onChange:a=>r(a.target.value),children:e.map((a,u)=>k.jsx("option",{value:a.deviceId,children:a.label||`Microphone ${u+1}`},a.deviceId))}),n?k.jsx("p",{className:"text-xs text-amber-600 mt-2",children:n}):null,e.length===0?k.jsx("p",{className:"text-xs text-kiosk-textlo mt-2",children:"No microphones detected."}):null]})}async function LA(e,t){try{await fetch(Ze.ragContext,{method:"DELETE"})}catch{}const r=new FormData;r.append("file",new File([t],e,{type:"text/plain"}));const n=await fetch(Ze.ragContextFile,{method:"POST",body:r});if(!n.ok){let a=`HTTP ${n.status}`;try{const u=await n.json();a=u.detail||u.error||a}catch{}throw new Error(String(a))}return n.json()}async function SU(e){const t=await fetch(`/samples/${e}`);if(!t.ok)throw new Error(`Failed to load sample ${e}: ${t.status}`);return t.blob()}const _U={idle:"",loading:"text-intel-blue",success:"text-green-600",error:"text-red-600",warn:"text-amber-600"};var FA;const OU=((FA=UA[0])==null?void 0:FA.file)??"";function PU({onIngestStateChange:e}){const[t,r]=D.useState(OU),[n,a]=D.useState({kind:"idle",message:""}),[u,l]=D.useState(!1),c=async(h,v)=>{l(!0),e==null||e(!0),a({kind:"loading",message:"⏳ Ingesting knowledge base…"});try{const m=await LA(h,v);a({kind:"success",message:`✅ Knowledge base updated — ${m.chunks_added??0} chunks from ${m.source??h}`})}catch(m){const x=m instanceof Error?m.message:"Unknown error";a({kind:"error",message:`⚠️ Ingestion failed: ${x}. Previous knowledge base remains active.`})}finally{l(!1),e==null||e(!1)}},f=async()=>{if(!t){a({kind:"warn",message:"Select a sample knowledge base first."});return}l(!0),e==null||e(!0),a({kind:"loading",message:"⏳ Ingesting knowledge base…"});try{const h=await SU(t),v=await LA(t,h);a({kind:"success",message:`✅ Knowledge base updated — ${v.chunks_added??0} chunks from ${v.source??t}`})}catch(h){const v=h instanceof Error?h.message:"Unknown error";a({kind:"error",message:`⚠️ Ingestion failed: ${v}. Previous knowledge base remains active.`})}finally{l(!1),e==null||e(!1)}},d=async h=>{var m;const v=(m=h.target.files)==null?void 0:m[0];v&&(await c(v.name,v),h.target.value="")};return k.jsxs("section",{className:"rounded-lg border border-kiosk-border bg-white p-4",children:[k.jsx("p",{className:"mb-3 text-sm text-kiosk-textmd",children:"Replace the assistant's knowledge base with a sample or your own .txt / .md document."}),k.jsx("select",{className:"mb-2 w-full rounded-md border border-kiosk-border bg-white px-3 py-2 text-sm",disabled:u,value:t,onChange:h=>r(h.target.value),children:UA.map(h=>k.jsx("option",{value:h.file,children:h.label},h.file))}),k.jsx("a",{href:`/samples/${t}`,download:!0,className:"text-xs text-intel-blue hover:underline",children:"Download selected sample"}),k.jsxs("div",{className:"mt-3 flex gap-2",children:[k.jsx("button",{type:"button",className:"rounded-md border border-kiosk-border px-3 py-1.5 text-sm text-intel-dark hover:bg-kiosk-pane disabled:opacity-50",disabled:u,onClick:()=>void f(),children:"Use Sample & Ingest"}),k.jsxs("label",{"aria-disabled":u,className:`rounded-md bg-intel-blue px-3 py-1.5 text-sm text-white hover:bg-intel-blue-dark disabled:opacity-50 ${u?"pointer-events-none opacity-50":""}`,children:["📄 Upload .txt / .md & Ingest",k.jsx("input",{type:"file",accept:".txt,.md",className:"hidden",disabled:u,onChange:h=>void d(h)})]})]}),n.kind!=="idle"?k.jsx("p",{className:`mt-3 text-sm ${_U[n.kind]}`,children:n.message}):null]})}async function AU(){try{const e=await fetch(Ze.products,{signal:AbortSignal.timeout(4e3)});return e.ok?await e.json():[]}catch{return[]}}async function EU(e){try{const t=await fetch(Ze.order(e),{signal:AbortSignal.timeout(4e3)});return t.ok?await t.json()??null:null}catch{return null}}async function jU(e){try{const t=await fetch(Ze.currentOrder(e),{signal:AbortSignal.timeout(4e3)});return t.ok?await t.json()??null:null}catch{return null}}async function TU(e){if(e.length===0)return[];try{const t=await fetch(Ze.upsell,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({product_ids:e}),signal:AbortSignal.timeout(4e3)});return t.ok?await t.json():[]}catch{return[]}}const kU=e=>{const t=Math.round(e*100)/100;return`₹${Number.isInteger(t)?t:t.toFixed(2)}`},eg=[{key:"burgers",label:"Burgers",icon:"🍔"},{key:"pizza",label:"Pizza",icon:"🍕"},{key:"wraps",label:"Wraps",icon:"🌯"},{key:"sides",label:"Sides",icon:"🍟"},{key:"beverages",label:"Beverages",icon:"🥤"},{key:"desserts",label:"Desserts",icon:"🍰"}],CU=new Set(["burgers","beverages","sides"]),MU=e=>eg.find(t=>t.key===e)??{key:e,label:e.charAt(0).toUpperCase()+e.slice(1),icon:"🍽"};function NU({peakOnly:e=!1}){const[t,r]=D.useState(null),n=D.useRef(!1);D.useEffect(()=>(n.current=!0,(async()=>{const u=await AU();n.current&&r(u)})(),()=>{n.current=!1}),[]);const a=D.useMemo(()=>{if(!t)return[];const u=e?t.filter(f=>CU.has(f.category)):t,l=new Map;for(const f of u){const d=l.get(f.category)??[];d.push(f),l.set(f.category,d)}return[...eg.map(f=>f.key).filter(f=>l.has(f)),...[...l.keys()].filter(f=>!eg.some(d=>d.key===f)).sort()].map(f=>({...MU(f),items:(l.get(f)??[]).sort((d,h)=>d.name.localeCompare(h.name))}))},[t,e]);return t===null?k.jsx("p",{className:"px-1 py-3 text-sm text-kiosk-textlo",children:"Loading menu…"}):t.length===0?k.jsx("p",{className:"px-1 py-3 text-sm text-kiosk-textlo",children:"Menu is currently unavailable."}):k.jsx("div",{className:"space-y-3",children:a.map(u=>k.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm",children:[k.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 bg-gray-50 px-3 py-2",children:[k.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-500",children:[u.icon," ",u.label]}),k.jsx("span",{className:"text-[10px] text-gray-400",children:u.items.length})]}),k.jsx("div",{className:"divide-y divide-gray-100",children:u.items.map(l=>k.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2",children:[k.jsx("span",{className:"min-w-0 truncate text-sm text-intel-dark",children:l.name}),k.jsx("span",{className:"shrink-0 text-sm font-medium text-intel-dark",children:kU(l.price)})]},l.product_id))})]},u.key))})}const BA=e=>{const t=Math.round((e??0)*100)/100;return`₹${Number.isInteger(t)?t:t.toFixed(2)}`},qA=e=>`ORD-${e}`,IU=2e3,$U=$r.perfRefreshMs;function RU({active:e}){const[t,r]=D.useState(null),[n,a]=D.useState([]),u=D.useRef(!1),l=D.useRef(null),c=D.useCallback(async m=>{var S;if(!u.current)return;l.current=m,r(m);const x=m&&m.status==="draft"?((S=m.items)==null?void 0:S.map(w=>w.product_id))??[]:[];if(x.length>0){const w=await TU(x);if(!u.current)return;a(w)}else a([])},[]),f=D.useCallback(async()=>{const m=await jU($r.userId);if(!u.current)return;if(m){await c(m);return}const x=l.current;if(x&&x.status!=="confirmed"){const S=await EU(x.order_id);if(!u.current)return;if(S){await c(S);return}}x||await c(null)},[c]);D.useEffect(()=>{u.current=!0,f();const m=e?IU:$U,x=window.setInterval(()=>{f()},m);return()=>{u.current=!1,window.clearInterval(x)}},[e,f]);const d=D.useMemo(()=>n.slice(0,3),[n]),h=(t==null?void 0:t.items)??[],v=(t==null?void 0:t.status)==="confirmed";return k.jsxs("section",{className:"rounded-lg border border-kiosk-border bg-white p-4",children:[k.jsxs("div",{className:"flex items-center justify-between gap-2",children:[k.jsx("h2",{className:"text-sm font-semibold text-intel-dark",children:v?"✅ Order Confirmed":"🛒 Current Order"}),(t==null?void 0:t.order_id)!==void 0?k.jsxs("span",{className:"text-xs text-kiosk-textlo",children:["#",qA(t.order_id)]}):null]}),t?k.jsxs("div",{className:"mt-3",children:[k.jsx("div",{className:"space-y-2",children:h.map(m=>k.jsxs("div",{className:"flex justify-between gap-3",children:[k.jsxs("span",{className:"text-sm text-intel-dark",children:[k.jsxs("span",{className:"text-xs",children:[m.quantity,"×"]})," ",m.product_name]}),k.jsx("span",{className:"text-sm font-medium",children:BA(m.subtotal)})]},m.id))}),k.jsx("div",{className:"my-3 border-t border-kiosk-border"}),k.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm font-bold text-intel-dark",children:[k.jsxs("div",{className:"flex items-center gap-2",children:[k.jsx("span",{children:"Total"}),k.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] ${v?"bg-green-100 text-green-700":"bg-amber-100 text-amber-700"}`,children:t.status})]}),k.jsx("span",{children:BA(t.total)})]}),v?k.jsxs("p",{className:"mt-3 rounded-md bg-green-50 px-2 py-1.5 text-center text-xs text-green-700",children:["🎉 Thank you! Your order ",qA(t.order_id)," is confirmed."]}):d.length>0?k.jsxs("div",{children:[k.jsx("h3",{className:"mb-1 mt-3 text-xs font-semibold text-kiosk-textmd",children:"✨ You might also like"}),d.map(m=>k.jsxs("div",{className:"mb-1 rounded-md border border-kiosk-border bg-kiosk-asst px-2 py-1 text-xs text-intel-dark",children:[m.product.name," — ",m.reason]},m.product.product_id))]}):null]}):k.jsx("p",{className:"py-3 text-sm text-kiosk-textlo",children:"No active order yet. Start ordering by voice."})]})}const DU="/queue-svc/stream",LU="/queue-svc/api/v1/queue/count",BU=2e3,qU={LOW:"bg-green-50 border-green-200 text-green-800",MEDIUM:"bg-amber-50 border-amber-200 text-amber-800",HIGH:"bg-red-50 border-red-200 text-red-800",unknown:"bg-gray-50 border-gray-200 text-gray-500"},zU={LOW:"🟢",MEDIUM:"🟡",HIGH:"🔴",unknown:"⚪"};function FU(e,t,r){D.useEffect(()=>{let n=!1;const a=async()=>{try{const l=await fetch(e,{signal:AbortSignal.timeout(4e3)});if(!l.ok||n)return;const c=await l.json();r({count:c.count??0,status:c.status??"unknown"})}catch{}};a();const u=window.setInterval(()=>{a()},t);return()=>{n=!0,window.clearInterval(u)}},[e,t,r])}function UU({orderActive:e}){const[t,r]=D.useState("menu"),[n,a]=D.useState(null),[u,l]=D.useState(!1),[c,f]=D.useState(!1),d=D.useCallback(S=>{a(S)},[]);FU(LU,BU,d);const h=(n==null?void 0:n.status)??"unknown",v=h==="MEDIUM"||h==="HIGH",m=v&&!u,x=[{id:"menu",label:"Menu",icon:"🍔"},{id:"cart",label:"Cart",icon:"🛒"}];return k.jsxs("div",{className:"space-y-3 p-4",children:[k.jsx("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-black shadow-sm",children:c?k.jsx("div",{className:"flex items-center justify-center text-xs text-gray-400",style:{height:"280px"},children:"📷 Queue feed unavailable"}):k.jsx("img",{src:DU,alt:"Live queue feed with person detection",className:"w-full object-contain",style:{height:"280px"},onError:()=>f(!0)})}),n!==null&&k.jsxs("div",{className:`flex items-center justify-between rounded-lg border px-3 py-2 text-xs font-medium ${qU[h]}`,children:[k.jsxs("span",{children:[zU[h]," Queue: ",k.jsx("strong",{children:n.count})," ",n.count===1?"person":"people"," · ",h]}),v&&k.jsx("button",{type:"button",onClick:()=>l(S=>!S),className:"ml-2 rounded border border-current px-2 py-0.5 text-[10px] opacity-75 hover:opacity-100",children:u?"⚡ Peak menu":"📋 Full menu"})]}),m&&k.jsxs("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-800",children:["⚡ ",k.jsx("strong",{children:"Peak hours"}),' — express menu shown (Burgers · Sides · Beverages). Tap "Full menu" to see all items.']}),k.jsx("div",{className:"flex gap-2",children:x.map(S=>k.jsxs("button",{type:"button",onClick:()=>r(S.id),className:` + flex flex-1 items-center justify-center gap-1.5 rounded-lg border py-2 text-xs font-semibold + transition-colors duration-150 + ${t===S.id?"border-intel-blue bg-blue-50/60 text-intel-blue":"border-gray-200 bg-white text-gray-400 hover:text-gray-600"} + `,children:[k.jsx("span",{children:S.icon}),k.jsx("span",{children:S.label})]},S.id))}),k.jsx("div",{className:t==="menu"?"":"hidden",children:k.jsx(NU,{peakOnly:m})}),k.jsx("div",{className:t==="cart"?"":"hidden",children:k.jsx(RU,{active:e})})]})}function WU({kpis:e,metrics:t,phase:r,orderActive:n,devices:a,selectedDeviceId:u,onSelectDevice:l,micError:c,onIngestStateChange:f,onRefreshKpis:d}){const[h,v]=D.useState("performance");return k.jsxs("aside",{className:"flex flex-col overflow-hidden rounded-xl border border-gray-200 bg-gray-50 shadow-sm min-h-[360px] lg:min-h-0 lg:h-full w-full",children:[k.jsx("div",{className:"flex shrink-0 border-b border-gray-200 bg-white",children:[{id:"performance",label:"Performance",icon:"📊"},{id:"settings",label:"Settings",icon:"⚙️"},{id:"qsr",label:"QSR",icon:"🍔"}].map(m=>k.jsxs("button",{type:"button",onClick:()=>v(m.id),className:` + flex flex-1 items-center justify-center gap-2 border-b-2 py-3 text-xs font-semibold + uppercase tracking-widest transition-colors duration-150 + ${h===m.id?"border-intel-blue text-intel-blue bg-blue-50/50":"border-transparent text-gray-400 hover:text-gray-600 hover:bg-gray-50"} + `,children:[k.jsx("span",{children:m.icon}),k.jsx("span",{children:m.label})]},m.id))}),k.jsxs("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:[h==="performance"&&k.jsxs("div",{className:"space-y-5 p-4",children:[k.jsx(wC,{kpis:e,phase:r}),k.jsx("div",{className:"h-px bg-gray-200"}),k.jsx(SC,{kpis:e}),k.jsx("div",{className:"flex justify-end",children:k.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-1.5 rounded-md border border-gray-200 bg-white px-2.5 py-1.5 text-[11px] text-gray-500 transition-colors hover:border-intel-blue/50 hover:text-intel-blue",children:[k.jsxs("svg",{className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[k.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),k.jsx("path",{d:"M21 3v5h-5"}),k.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),k.jsx("path",{d:"M8 16H3v5"})]}),"Refresh KPIs"]})}),k.jsx("div",{className:"h-px bg-gray-200"}),k.jsx(xU,{metrics:t})]}),h==="settings"&&k.jsxs("div",{className:"space-y-4 p-4",children:[k.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm",children:[k.jsx("div",{className:"border-b border-gray-100 bg-gray-50 px-3 py-2",children:k.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-500",children:"🎙 Audio Device"})}),k.jsx("div",{className:"p-3",children:k.jsx(wU,{devices:a,selectedId:u,onSelect:l,error:c})})]}),k.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm",children:[k.jsx("div",{className:"border-b border-gray-100 bg-gray-50 px-3 py-2",children:k.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-500",children:"📚 Knowledge Base"})}),k.jsx("div",{className:"p-3",children:k.jsx(PU,{onIngestStateChange:f})})]}),k.jsx(HU,{kpis:e})]}),h==="qsr"&&k.jsx(UU,{orderActive:n})]})]})}function HU({kpis:e}){var a,u,l,c,f,d,h,v;const t=m=>m==null||m===""?"—":String(m),r=m=>t(m).split("/").pop()??"—",n=[["🎙 ASR",r((a=e.asr)==null?void 0:a.model),t((u=e.asr)==null?void 0:u.device).toUpperCase()],["🔍 Embedding",r((l=e.rag)==null?void 0:l.embedding_model),t((c=e.rag)==null?void 0:c.embedding_device).toUpperCase()],["🧠 LLM",r((f=e.rag)==null?void 0:f.llm_model),t((d=e.rag)==null?void 0:d.llm_device).toUpperCase()],["🔊 TTS",r((h=e.tts)==null?void 0:h.model),t((v=e.tts)==null?void 0:v.device).toUpperCase()]];return k.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm",children:[k.jsx("div",{className:"border-b border-gray-100 bg-gray-50 px-3 py-2",children:k.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-gray-500",children:"⚙️ Model Configuration"})}),k.jsx("div",{className:"divide-y divide-gray-100",children:n.map(([m,x,S])=>k.jsxs("div",{className:"flex items-center justify-between gap-2 bg-white px-3 py-2",children:[k.jsx("span",{className:"shrink-0 text-xs text-gray-500",children:m}),k.jsx("span",{className:"min-w-0 flex-1 truncate text-center text-[11px] font-medium text-gray-700",children:x}),k.jsx("span",{className:"shrink-0 rounded border border-gray-200 bg-gray-50 px-1.5 py-0.5 text-[9px] font-bold text-gray-500",children:S})]},m))})]})}const VU="Microphone access requires HTTPS or localhost.",GU="Unable to access the microphone. Device names may be unavailable until permission is granted.",KU="Unable to list microphones. Check your browser permissions.";function XU(){const[e,t]=D.useState([]),[r,n]=D.useState(""),[a,u]=D.useState(null),l=D.useCallback(async()=>{var f;if(!((f=navigator.mediaDevices)!=null&&f.enumerateDevices)){t([]),n(""),u(VU);return}let c=null;if(navigator.mediaDevices.getUserMedia)try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(h=>h.stop())}catch{c=GU}try{const d=(await navigator.mediaDevices.enumerateDevices()).filter(h=>h.kind==="audioinput");t(d),n(h=>{var v;return h&&d.some(m=>m.deviceId===h)?h:((v=d[0])==null?void 0:v.deviceId)??""}),u(c)}catch{t([]),n(""),u(c??KU)}},[]);return D.useEffect(()=>{var c;if(l(),!!((c=navigator.mediaDevices)!=null&&c.addEventListener))return navigator.mediaDevices.addEventListener("devicechange",l),()=>{navigator.mediaDevices.removeEventListener("devicechange",l)}},[l]),{devices:e,selectedId:r,setSelectedId:n,refresh:l,error:a}}async function ni(e){try{const t=await fetch(e,{signal:AbortSignal.timeout(4e3)});return t.ok?await t.json():{}}catch{return{}}}async function YU(){const[e,t,r,n,a,u,l]=await Promise.all([ni(Ze.asrModelInfo),ni(Ze.asrPerformance),ni(Ze.ttsModelInfo),ni(Ze.ttsPerformance),ni(Ze.ragModelInfo),ni(Ze.ragPerformance),ni(Ze.pipelineLatest)]),c=(d,h)=>({...d,perf:h.latency??{}}),f=l.trace??null;return{asr:c(e,t),rag:c(a,u),tts:c(r,n),pipeline:f}}const QU=()=>({asr:{},rag:{},tts:{}});function ZU(){const e=D.useRef(!1),[t,r]=D.useState(()=>QU()),[n,a]=D.useState(!1),u=D.useCallback(()=>{e.current&&(a(!0),YU().then(l=>{e.current&&r(l)}).catch(()=>{}).finally(()=>{e.current&&a(!1)}))},[]);return D.useEffect(()=>(e.current=!0,u(),()=>{e.current=!1}),[u]),{kpis:t,loading:n,refresh:u}}const JU={analyzer_url:"http://audio-analyzer:8010/v1/audio/transcriptions",rag_url:"http://rag-service:8020/api/v1/query",tts_url:"http://text-to-speech:8011/v1/audio/speech"};async function eW(e,t,r){const n=await fetch(Ze.startStream,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sample_rate:e,chunk_seconds:$r.chunkSeconds,silence_timeout_seconds:2,max_session_seconds:60,silence_threshold:900,language:"en",temperature:0,tts_model:"speecht5",tts_language:"English",history:t,...r?{conversation_id:r}:{},...JU})});if(!n.ok)throw new Error(`Failed to start session: ${n.status} ${n.statusText}`);return n.json()}async function tW(e,t){const r=await fetch(Ze.pushAudio(e),{method:"POST",headers:{"Content-Type":"audio/wav"},body:t});if(!r.ok)throw new Error(`Failed to push audio: ${r.status}`)}async function rW(e){const t=await fetch(Ze.endAudio(e),{method:"POST"});if(!t.ok)throw new Error(`Failed to end stream: ${t.status}`)}async function nW(e){const t=await fetch(Ze.pollSession(e));if(!t.ok)throw new Error(`Failed to poll session: ${t.status}`);return t.json()}function iW(e,t){const r=t.split("/").pop()??"";return Ze.sessionAudioFile(e,r)}function JT(e){let t=0;for(const a of e)t+=a.length;const r=new Float32Array(t);let n=0;for(const a of e)r.set(a,n),n+=a.length;return r}function ek(e,t,r){if(t===r||e.length===0)return e;const n=t/r,a=Math.floor(e.length/n),u=new Float32Array(a);for(let l=0;l(l.current||(l.current=new Audio,l.current.preload="auto"),l.current),[]),h=D.useCallback(()=>{var A,j,T,_;const S=n.current.shift();if(!S){u.current=!1,r("idle"),c.current&&(c.current=!1,(j=(A=f.current)==null?void 0:A.onAllDone)==null||j.call(A));return}u.current=!0,r("playing");const w=d();w.src=S,c.current||(c.current=!0,(_=(T=f.current)==null?void 0:T.onFirstPlay)==null||_.call(T));const b=()=>{w.removeEventListener("ended",b),w.removeEventListener("error",P),h()},P=()=>{w.removeEventListener("ended",b),w.removeEventListener("error",P),h()};w.addEventListener("ended",b),w.addEventListener("error",P),w.play().catch(()=>{w.removeEventListener("ended",b),w.removeEventListener("error",P),h()})},[d]),v=D.useCallback(S=>{let w=!1;for(const b of S)!b||a.current.has(b)||(a.current.add(b),n.current.push(b),w=!0);w&&!u.current&&(r("queued"),h())},[h]),m=D.useCallback(()=>{n.current=[],a.current=new Set},[]),x=D.useCallback(()=>{n.current=[],l.current&&(l.current.pause(),l.current.src=""),u.current=!1,c.current=!1,r("idle")},[]);return D.useEffect(()=>()=>{l.current&&(l.current.pause(),l.current.src="")},[]),{state:t,enqueue:v,reset:m,stop:x}}const Ry=$r.sampleRate;function uW({deviceId:e,enabled:t,onTurnComplete:r}){const[n,a]=D.useState("idle"),[u,l]=D.useState([]),[c,f]=D.useState(""),[d,h]=D.useState(""),[v,m]=D.useState("Tap the mic and ask a question"),[x,S]=D.useState(null),w=oW({onAllDone:()=>{r==null||r()}}),b=D.useRef(null),P=D.useRef(null),A=D.useRef(null),j=D.useRef(null),T=D.useRef([]),_=D.useRef(48e3),O=D.useRef(null),C=D.useRef(crypto.randomUUID()),M=D.useRef(!1),$=D.useRef(!1),K=D.useRef(null),F=D.useRef([]);F.current=u;const B=D.useCallback(()=>F.current.slice(-4).filter(W=>W.text.trim()).map(W=>({role:W.role,content:W.text})),[]),H=D.useCallback(async(Z=!1)=>{const W=T.current;if(W.length===0)return;const z=W.reduce((Ee,Se)=>Ee+Se.length,0)/_.current;if(!Z&&z<$r.chunkSeconds)return;T.current=[];const oe=JT(W),ce=ek(oe,_.current,Ry),ve=tk(ce,Ry),ge=O.current;if(ge)try{await tW(ge,ve)}catch{}},[]),Y=D.useCallback(()=>{var Z,W,I;M.current=!1;try{(Z=A.current)==null||Z.disconnect(),(W=j.current)==null||W.disconnect()}catch{}(I=P.current)==null||I.getTracks().forEach(z=>z.stop()),b.current&&b.current.state!=="closed"&&b.current.close().catch(()=>{}),A.current=null,j.current=null,P.current=null,b.current=null},[]),X=D.useCallback(()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},[]),J=D.useCallback(async()=>{const Z=O.current;if(!Z)return;let W;try{W=await nW(Z)}catch{K.current=window.setTimeout(J,$r.pollIntervalMs);return}const I=(W.transcript??"").trim(),z=(W.response??"").trim(),oe=W.status==="running"||W.status==="stopping";I&&f(I),z&&h(z);const ce=W.tts_audio_segments??[];if(ce.length>0){const ve=ce.map(ge=>iW(Z,String(ge.audio_file)));w.enqueue(ve)}if($.current&&(ce.length?m(`🔊 Speaking… (${ce.length})`):m(z?"💬 Generating response…":I?"📝 Querying knowledge base…":"⏳ Processing speech…")),$.current&&!oe){X();const ve=I,ge=z;l(Ee=>{const Se=[...Ee];return ve&&Se.push({role:"user",text:ve}),ge&&Se.push({role:"assistant",text:ge}),Se}),f(""),h(""),O.current=null,$.current=!1,a("idle"),m("✓ Done — tap 🎤 for another question"),ce.length===0&&(r==null||r());return}K.current=window.setTimeout(J,$r.pollIntervalMs)},[w,r,X]),te=D.useCallback(async()=>{var Z;if(!t){m("⏳ Ingestion in progress — please wait…");return}if(!(M.current||n!=="idle")){S(null),w.reset(),T.current=[],$.current=!1,f("🎤 Listening…"),h(""),a("listening"),m("🎙 Listening — speak now");try{if(!((Z=navigator.mediaDevices)!=null&&Z.getUserMedia))throw new Error("Microphone access requires HTTPS or localhost.");const W={audio:e?{deviceId:{exact:e}}:!0},I=await navigator.mediaDevices.getUserMedia(W);P.current=I;const z=new AudioContext;b.current=z,_.current=z.sampleRate,await z.audioWorklet.addModule("/pcm-capture-processor.js");const oe=z.createMediaStreamSource(I);j.current=oe;const ce=new AudioWorkletNode(z,"pcm-capture-processor");A.current=ce,ce.port.onmessage=ge=>{M.current&&(T.current.push(ge.data),H(!1))},oe.connect(ce),ce.connect(z.destination),M.current=!0;const{session_id:ve}=await eW(Ry,B(),C.current);O.current=ve,X(),K.current=window.setTimeout(J,$r.pollIntervalMs)}catch(W){Y(),a("idle"),f("");const I=W instanceof Error?W.message:String(W);S(I),m(`❌ ${I}`)}}},[t,n,e,w,B,H,J,X,Y]),G=D.useCallback(async()=>{if(!M.current)return;M.current=!1,a("processing"),m("⏳ Processing…"),f(W=>W==="🎤 Listening…"?"⏳ Processing…":W),await H(!0),Y();const Z=O.current;if(!Z){a("idle"),m("No audio — try again"),f("");return}try{await rW(Z),$.current=!0}catch(W){const I=W instanceof Error?W.message:String(W);S(I),m(`❌ ${I}`),a("idle");return}},[H,Y]);return D.useEffect(()=>()=>{X(),Y(),w.stop()},[]),{phase:n,messages:u,partialUser:c,partialAssistant:d,statusText:v,error:x,playbackState:w.state,start:te,stop:G}}function lW(){const[e,t]=D.useState({}),[r,n]=D.useState(!0),a=D.useRef(!1),u=D.useRef(!1),l=D.useCallback(async()=>{if(!u.current){u.current=!0,a.current&&n(!0);try{const f=await gU();a.current&&t(f)}finally{u.current=!1,a.current&&n(!1)}}},[]);D.useEffect(()=>{a.current=!0,l();const f=window.setInterval(()=>{l()},$r.perfRefreshMs);return()=>{a.current=!1,window.clearInterval(f)}},[l]);const c=D.useCallback(()=>{l()},[l]);return{metrics:e,loading:r,refresh:c}}function sW(){const{devices:e,selectedId:t,setSelectedId:r,error:n}=XU(),{kpis:a,refresh:u}=ZU(),{metrics:l}=lW(),[c,f]=D.useState(!1),d=D.useCallback(()=>{u()},[u]),{phase:h,messages:v,partialUser:m,partialAssistant:x,statusText:S,playbackState:w,start:b,stop:P}=uW({deviceId:t,enabled:!c,onTurnComplete:d}),A=h==="listening"||h==="processing"||w!=="idle";return k.jsxs("div",{className:"flex flex-col h-full bg-gray-100 font-text",children:[k.jsx(fC,{}),k.jsx("main",{className:"flex-1 min-h-0",children:k.jsxs("div",{className:"h-full p-3 flex flex-col gap-3 lg:grid lg:gap-3",style:{gridTemplateColumns:"minmax(0, 3fr) minmax(0, 2fr)",gridTemplateRows:"1fr"},children:[k.jsxs("section",{className:`flex flex-col bg-white rounded-xl border border-gray-200 overflow-hidden shadow-sm + min-h-[420px] lg:min-h-0`,children:[k.jsx(vC,{messages:v,partialUser:m,partialAssistant:x,phase:h}),k.jsx("div",{className:"shrink-0 border-t border-gray-200 bg-gray-50/80 px-4 sm:px-6 py-3 sm:py-4",children:k.jsxs("div",{className:"flex flex-col items-center gap-2 sm:gap-3",children:[k.jsx(mC,{phase:h,playbackState:w}),k.jsx(yC,{phase:h,locked:c,onStart:b,onStop:P}),k.jsx("p",{className:"text-xs text-kiosk-textlo text-center min-h-[1rem] max-w-sm",children:S})]})})]}),k.jsx(WU,{kpis:a,metrics:l,phase:h,orderActive:A,devices:e,selectedDeviceId:t,onSelectDevice:r,micError:n,onIngestStateChange:f,onRefreshKpis:u})]})}),k.jsx(dC,{})]})}async function cW(){try{const e=await fetch(Ze.identityEnabled,{signal:AbortSignal.timeout(4e3)});return e.ok?!!(await e.json()).enabled:!1}catch{return!1}}async function rk(){try{const e=await fetch(Ze.identityChallenge,{signal:AbortSignal.timeout(4e3)});return e.ok?await e.json():null}catch{return null}}async function fW(e){const t=await fetch(Ze.identityVerify,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(15e3)});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(`Verification request failed (${t.status}): ${r}`)}return await t.json()}async function dW(e){const t=await fetch(Ze.identityRegister,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:AbortSignal.timeout(15e3)});if(!t.ok){const r=await t.text().catch(()=>"");throw new Error(`Registration request failed (${t.status}): ${r}`)}return await t.json()}function nk(){const e=D.useRef(null),t=D.useRef(null),[r,n]=D.useState(!1),[a,u]=D.useState(null),l=D.useCallback(async()=>{var d;u(null),n(!1);try{if(!((d=navigator.mediaDevices)!=null&&d.getUserMedia))throw new Error("Camera access requires HTTPS or localhost.");const h=await navigator.mediaDevices.getUserMedia({video:{facingMode:"user"}});t.current=h,e.current&&(e.current.srcObject=h,await e.current.play()),n(!0)}catch(h){const v=h instanceof Error?h.message:String(h);u(`Unable to access the camera: ${v}`),n(!1)}},[]),c=D.useCallback(()=>{var d;(d=t.current)==null||d.getTracks().forEach(h=>h.stop()),t.current=null,e.current&&(e.current.srcObject=null),n(!1)},[]),f=D.useCallback(()=>{const d=e.current;if(!d||d.readyState<2)return null;const h=document.createElement("canvas");h.width=d.videoWidth,h.height=d.videoHeight;const v=h.getContext("2d");if(!v)return null;v.drawImage(d,0,0,h.width,h.height);const m=h.toDataURL("image/jpeg",.9),x=m.indexOf(",");return x>=0?m.slice(x+1):null},[]);return D.useEffect(()=>()=>c(),[]),{videoRef:e,ready:r,error:a,start:l,stop:c,captureFrameBase64:f}}const zA=$r.sampleRate;function ik(){const[e,t]=D.useState(!1),[r,n]=D.useState(null),a=D.useRef(null),u=D.useCallback(async l=>{var x;n(null),t(!0);let c=null,f=null,d=null,h=null;const v=[],m=()=>{try{d==null||d.disconnect(),h==null||h.disconnect()}catch{}c==null||c.getTracks().forEach(S=>S.stop()),f&&f.state!=="closed"&&f.close().catch(()=>{})};a.current=m;try{if(!((x=navigator.mediaDevices)!=null&&x.getUserMedia))throw new Error("Microphone access requires HTTPS or localhost.");c=await navigator.mediaDevices.getUserMedia({audio:!0}),f=new AudioContext,await f.audioWorklet.addModule("/pcm-capture-processor.js"),h=f.createMediaStreamSource(c),d=new AudioWorkletNode(f,"pcm-capture-processor"),d.port.onmessage=_=>{v.push(_.data)},h.connect(d),d.connect(f.destination);const S=f.sampleRate;await new Promise(_=>setTimeout(_,l*1e3)),m();const w=JT(v),b=ek(w,S,zA),A=await tk(b,zA).arrayBuffer();let j="";const T=new Uint8Array(A);for(let _=0;_{const w=await rk();w?(c(w.prompt_text),d(w.challenge_id)):(c("Please look at the camera and say your name."),d(null))},[]);D.useEffect(()=>(r.start(),m(),()=>r.stop()),[]);const x=D.useCallback(async()=>{v(null),u("capturing");const w=r.captureFrameBase64();if(!w){v("Could not capture a camera frame. Please ensure your face is visible."),u("error");return}const b=await n.recordClip(pW);if(!b){v(n.error??"Could not capture audio."),u("error");return}u("verifying");try{const P=await fW({challenge_id:f,image_base64:w,audio_base64:b});P.verified&&P.user_id?e(P.profile??null,P.user_id):(v(P.reason??"User not authenticated. Please try again or register."),u("error"),m())}catch(P){const A=P instanceof Error?P.message:String(P);v(`User not authenticated: ${A}`),u("error")}},[r,n,f,e,m]),S=a==="capturing"||a==="verifying";return k.jsx("div",{className:"flex flex-col items-center justify-center h-full bg-gray-100 px-4 py-8 gap-6",children:k.jsxs("div",{className:"max-w-2xl w-full bg-white rounded-xl border border-gray-200 shadow-sm p-8 sm:p-10 flex flex-col items-center gap-5",children:[k.jsx("h1",{className:"text-2xl font-semibold text-intel-blue",children:"Sign in to the kiosk"}),k.jsx("p",{className:"text-base text-kiosk-textlo text-center",children:"Look at the camera and read the phrase below aloud."}),k.jsx("div",{className:"w-full max-w-lg aspect-video bg-black rounded-lg overflow-hidden",children:k.jsx("video",{ref:r.videoRef,muted:!0,playsInline:!0,className:"w-full h-full object-cover"})}),k.jsxs("div",{className:"w-full bg-gray-50 border border-gray-200 rounded-lg px-6 py-4 text-center",children:[k.jsx("span",{className:"text-xs uppercase tracking-wide text-kiosk-textlo",children:"Say aloud"}),k.jsx("p",{className:"text-lg font-medium text-gray-800",children:l})]}),r.error&&k.jsx("p",{className:"text-sm text-red-500 text-center",children:r.error}),a==="error"&&h&&k.jsx("div",{className:"w-full bg-red-50 border border-red-200 text-red-700 text-sm rounded-lg px-4 py-3 text-center",children:h}),k.jsx("button",{type:"button",onClick:x,disabled:S||!r.ready,className:"w-full max-w-sm rounded-full bg-intel-blue text-white font-medium text-lg py-4 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-intel-blue-dark transition-colors",children:a==="capturing"?"Capturing…":a==="verifying"?"Verifying…":"Authenticate"}),k.jsx("button",{type:"button",onClick:t,disabled:S,className:"text-base text-intel-blue underline disabled:opacity-50",children:"New here? Register your face & voice"})]})})}const vW=3;function yW(e){const t=e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)+/g,"")||"guest",r=Math.random().toString(36).slice(2,7);return`${t}-${r}`}function mW({onRegistered:e,onCancel:t}){const r=nk(),n=ik(),[a,u]=D.useState(""),[l,c]=D.useState("idle"),[f,d]=D.useState("Loading challenge phrase…"),[h,v]=D.useState(null),m=D.useCallback(async()=>{const w=await rk();d((w==null?void 0:w.prompt_text)??"Please say your name clearly.")},[]);D.useEffect(()=>(r.start(),m(),()=>r.stop()),[]);const x=D.useCallback(async()=>{if(v(null),!a.trim()){v("Please enter your name first."),c("error");return}c("capturing");const w=r.captureFrameBase64();if(!w){v("Could not capture a camera frame. Please ensure your face is visible."),c("error");return}const b=await n.recordClip(vW);if(!b){v(n.error??"Could not capture audio."),c("error");return}c("submitting");const P=yW(a);try{const A=await dW({user_id:P,name:a.trim(),image_base64:w,audio_base64:b});A.registered?(c("success"),e(A.user_id)):(v(A.reason??"Registration failed. Please try again."),c("error"),m())}catch(A){const j=A instanceof Error?A.message:String(A);v(`Registration failed: ${j}`),c("error")}},[r,n,a,e,m]),S=l==="capturing"||l==="submitting";return k.jsx("div",{className:"flex flex-col items-center justify-center h-full bg-gray-100 px-4 py-8 gap-6",children:k.jsxs("div",{className:"max-w-2xl w-full bg-white rounded-xl border border-gray-200 shadow-sm p-8 sm:p-10 flex flex-col items-center gap-5",children:[k.jsx("h1",{className:"text-2xl font-semibold text-intel-blue",children:"Register your face & voice"}),k.jsx("p",{className:"text-base text-kiosk-textlo text-center",children:"Enter your name, then read the phrase below aloud while looking at the camera."}),k.jsx("input",{type:"text",value:a,onChange:w=>u(w.target.value),placeholder:"Your name",disabled:S,className:"w-full max-w-lg rounded-lg border border-gray-300 px-4 py-3 text-base focus:outline-none focus:ring-2 focus:ring-intel-blue/30"}),k.jsx("div",{className:"w-full max-w-lg aspect-video bg-black rounded-lg overflow-hidden",children:k.jsx("video",{ref:r.videoRef,muted:!0,playsInline:!0,className:"w-full h-full object-cover"})}),k.jsxs("div",{className:"w-full bg-gray-50 border border-gray-200 rounded-lg px-6 py-4 text-center",children:[k.jsx("span",{className:"text-xs uppercase tracking-wide text-kiosk-textlo",children:"Say aloud"}),k.jsx("p",{className:"text-lg font-medium text-gray-800",children:f})]}),r.error&&k.jsx("p",{className:"text-sm text-red-500 text-center",children:r.error}),l==="error"&&h&&k.jsx("div",{className:"w-full bg-red-50 border border-red-200 text-red-700 text-sm rounded-lg px-4 py-3 text-center",children:h}),k.jsx("button",{type:"button",onClick:x,disabled:S||!r.ready,className:"w-full max-w-sm rounded-full bg-intel-blue text-white font-medium text-lg py-4 disabled:opacity-50 disabled:cursor-not-allowed hover:bg-intel-blue-dark transition-colors",children:l==="capturing"?"Capturing…":l==="submitting"?"Registering…":"Register"}),k.jsx("button",{type:"button",onClick:t,disabled:S,className:"text-base text-intel-blue underline disabled:opacity-50",children:"Back to sign in"})]})})}function gW({name:e,onDismiss:t,durationMs:r=3e3}){const[n,a]=D.useState(!0);return D.useEffect(()=>{const u=window.setTimeout(()=>a(!1),r),l=window.setTimeout(t,r+300);return()=>{window.clearTimeout(u),window.clearTimeout(l)}},[r,t]),k.jsx("div",{className:`fixed top-20 left-1/2 -translate-x-1/2 z-[100] transition-all duration-300 ${n?"opacity-100 translate-y-0":"opacity-0 -translate-y-2 pointer-events-none"}`,role:"status",children:k.jsxs("div",{className:"flex items-center gap-3 bg-white border border-green-200 shadow-lg rounded-xl px-5 py-3",children:[k.jsx("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-green-100 text-green-600 shrink-0",children:k.jsx("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",fill:"none",children:k.jsx("path",{d:"M20 6L9 17l-5-5",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),k.jsxs("div",{children:[k.jsx("p",{className:"text-sm font-semibold text-gray-800",children:"Successfully authenticated"}),k.jsxs("p",{className:"text-xs text-kiosk-textlo",children:["Welcome, ",e,"!"]})]})]})})}function bW({children:e}){const[t,r]=D.useState("checking"),[n,a]=D.useState(null),[u,l]=D.useState(null),[c,f]=D.useState(!1);D.useEffect(()=>{let v=!1;return cW().then(m=>{v||r(m?"login":"bypass")}),()=>{v=!0}},[]);const d=D.useCallback((v,m)=>{a(v),l(m),r("authenticated"),f(!0)},[]),h=D.useCallback(()=>{r("login")},[]);if(t==="checking")return k.jsx("div",{className:"flex items-center justify-center h-full bg-gray-100",children:k.jsx("p",{className:"text-sm text-kiosk-textlo",children:"Loading…"})});if(t==="bypass"||t==="authenticated"){const v=(n==null?void 0:n.name)||u||"Guest";return k.jsxs(k.Fragment,{children:[e,c&&k.jsx(gW,{name:v,onDismiss:()=>f(!1)})]})}return t==="register"?k.jsx(mW,{onRegistered:h,onCancel:()=>r("login")}):k.jsx(hW,{onVerified:d,onRegisterRequested:()=>r("register")})}sC.createRoot(document.getElementById("root")).render(k.jsx(D.StrictMode,{children:k.jsx(bW,{children:k.jsx(sW,{})})})); diff --git a/smart-kiosk-assistant/kiosk-ui/dist/assets/index-CuX-224k.css b/smart-kiosk-assistant/kiosk-ui/dist/assets/index-CuX-224k.css deleted file mode 100644 index 8377d0e6..00000000 --- a/smart-kiosk-assistant/kiosk-ui/dist/assets/index-CuX-224k.css +++ /dev/null @@ -1 +0,0 @@ -*,: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:Roboto Mono,ui-monospace,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}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-bottom-1{bottom:-.25rem}.-right-1{right:-.25rem}.-right-2{right:-.5rem}.-top-2{top:-.5rem}.bottom-0{bottom:0}.left-0{left:0}.left-1\/2{left:50%}.right-0{right:0}.top-0{top:0}.z-10{z-index:10}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-\[150px\]{height:150px}.h-\[52px\]{height:52px}.h-\[90px\]{height:90px}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0px}.min-h-\[1rem\]{min-height:1rem}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-12{width:3rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-8{width:2rem}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[80\%\]{max-width:80%}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -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-180{--tw-rotate: 180deg;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))}@keyframes kpi-glow{0%,to{box-shadow:0 0 #0071c500}50%{box-shadow:0 0 12px 2px #0071c559}}.animate-kpi-glow{animation:kpi-glow 2.5s ease-in-out infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin-slow{animation:spin 2s linear infinite}@keyframes stage-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.04)}}.animate-stage-pulse{animation:stage-pulse 1.8s ease-in-out infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-x-0\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.125rem * var(--tw-space-x-reverse));margin-left:calc(.125rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.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-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * 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-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-dash-border>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(51 65 85 / var(--tw-divide-opacity, 1))}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-bl-sm{border-bottom-left-radius:.125rem}.rounded-br-sm{border-bottom-right-radius:.125rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-asr{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-asr\/40{border-color:#ea580c66}.border-cpu-muted{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-dash-border{--tw-border-opacity: 1;border-color:rgb(51 65 85 / var(--tw-border-opacity, 1))}.border-gpu-muted{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-gpu\/30{border-color:#16a34a4d}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-intel-blue{--tw-border-opacity: 1;border-color:rgb(0 113 197 / var(--tw-border-opacity, 1))}.border-intel-blue-dark{--tw-border-opacity: 1;border-color:rgb(0 90 158 / var(--tw-border-opacity, 1))}.border-intel-blue\/40{border-color:#0071c566}.border-kiosk-border{--tw-border-opacity: 1;border-color:rgb(200 216 234 / var(--tw-border-opacity, 1))}.border-llm{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity, 1))}.border-llm\/40{border-color:#0891b266}.border-npu-muted{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.border-ret{--tw-border-opacity: 1;border-color:rgb(202 138 4 / var(--tw-border-opacity, 1))}.border-ret\/30{border-color:#ca8a044d}.border-transparent{border-color:transparent}.border-tts{--tw-border-opacity: 1;border-color:rgb(219 39 119 / var(--tw-border-opacity, 1))}.border-tts\/40{border-color:#db277766}.border-t-transparent{border-top-color:transparent}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-amber-500\/20{background-color:#f59e0b33}.bg-asr-light{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-cpu-light{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-dash-bg{--tw-bg-opacity: 1;background-color:rgb(15 23 42 / var(--tw-bg-opacity, 1))}.bg-dash-border{--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity, 1))}.bg-dash-card{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-gpu-light{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-400{--tw-bg-opacity: 1;background-color:rgb(74 222 128 / var(--tw-bg-opacity, 1))}.bg-green-500\/20{background-color:#22c55e33}.bg-green-900\/30{background-color:#14532d4d}.bg-intel-blue{--tw-bg-opacity: 1;background-color:rgb(0 113 197 / var(--tw-bg-opacity, 1))}.bg-intel-blue\/10{background-color:#0071c51a}.bg-kiosk-asst{--tw-bg-opacity: 1;background-color:rgb(235 242 250 / var(--tw-bg-opacity, 1))}.bg-kiosk-pane{--tw-bg-opacity: 1;background-color:rgb(244 247 251 / var(--tw-bg-opacity, 1))}.bg-kiosk-pane\/60{background-color:#f4f7fb99}.bg-kiosk-user{--tw-bg-opacity: 1;background-color:rgb(0 104 181 / var(--tw-bg-opacity, 1))}.bg-llm-light{--tw-bg-opacity: 1;background-color:rgb(207 250 254 / var(--tw-bg-opacity, 1))}.bg-npu-light{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/20{background-color:#ef444433}.bg-ret-light{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-tts-light{--tw-bg-opacity: 1;background-color:rgb(252 231 243 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/5{background-color:#ffffff0d}.bg-white\/60{background-color:#fff9}.bg-white\/\[0\.03\]{background-color:#ffffff08}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0{padding:0}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.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}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-4{padding-bottom:1rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-right{text-align:right}.font-display{font-family:IntelOne Display,Inter,system-ui,sans-serif}.font-mono{font-family:Roboto Mono,ui-monospace,monospace}.font-text{font-family:IntelOne Text,Inter,system-ui,sans-serif}.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-6xl{font-size:3.75rem;line-height:1}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.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-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-300{--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-asr{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-asr-dark{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-cpu{--tw-text-opacity: 1;color:rgb(0 113 197 / var(--tw-text-opacity, 1))}.text-cpu-dark{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-dash-label{--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity, 1))}.text-dash-value{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.text-gpu{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-gpu-dark{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-green-300{--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-intel-blue{--tw-text-opacity: 1;color:rgb(0 113 197 / var(--tw-text-opacity, 1))}.text-intel-dark{--tw-text-opacity: 1;color:rgb(43 44 48 / var(--tw-text-opacity, 1))}.text-intel-gray{--tw-text-opacity: 1;color:rgb(106 109 117 / var(--tw-text-opacity, 1))}.text-kiosk-textlo{--tw-text-opacity: 1;color:rgb(143 160 174 / var(--tw-text-opacity, 1))}.text-kiosk-textmd{--tw-text-opacity: 1;color:rgb(74 96 112 / var(--tw-text-opacity, 1))}.text-llm{--tw-text-opacity: 1;color:rgb(8 145 178 / var(--tw-text-opacity, 1))}.text-llm-dark{--tw-text-opacity: 1;color:rgb(14 116 144 / var(--tw-text-opacity, 1))}.text-npu-dark{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-ret{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-ret-dark{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-tts{--tw-text-opacity: 1;color:rgb(219 39 119 / var(--tw-text-opacity, 1))}.text-tts-dark{--tw-text-opacity: 1;color:rgb(190 24 93 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/40{color:#fff6}.text-white\/50{color:#ffffff80}.text-white\/60{color:#fff9}.text-white\/70{color:#ffffffb3}.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-\[0_-2px_8px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow: 0 -2px 8px rgba(0,0,0,.04);--tw-shadow-colored: 0 -2px 8px 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-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-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px 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-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 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)}.shadow-asr\/30{--tw-shadow-color: rgb(234 88 12 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-tts\/30{--tw-shadow-color: rgb(219 39 119 / .3);--tw-shadow: var(--tw-shadow-colored)}.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}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}html,body,#root{height:100%;margin:0}.dash-scroll::-webkit-scrollbar{width:4px}.dash-scroll::-webkit-scrollbar-track{background:transparent}.dash-scroll::-webkit-scrollbar-thumb{background:#334155;border-radius:2px}.dash-scroll::-webkit-scrollbar-thumb:hover{background:#475569}@keyframes dash-flow{0%{stroke-dashoffset:12}to{stroke-dashoffset:0}}@keyframes stage-glow-pulse{0%,to{opacity:1}50%{opacity:.65}}@keyframes kpi-glow{0%{box-shadow:0 0 #0071c500}40%{box-shadow:0 0 14px 3px #0071c54d}to{box-shadow:0 0 #0071c500}}.animate-kpi-glow{animation:kpi-glow 1.2s ease-out}@keyframes number-tick{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}@keyframes stage-pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.04);opacity:.8}}.animate-stage-pulse{animation:stage-pulse 1.6s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin-slow{animation:spin 1.8s linear infinite}@keyframes messageSlideIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.kiosk-message-fade-in{animation:messageSlideIn .3s ease-out}@keyframes kiosk-blink{0%,49%{opacity:1}50%,to{opacity:0}}.kiosk-cursor{animation:kiosk-blink 1s steps(1) infinite}@keyframes typingDot{0%,60%,to{transform:translateY(0);opacity:.6}30%{transform:translateY(-8px);opacity:1}}.kiosk-typing-dot{display:inline-block;width:6px;height:6px;margin:0 2px;background-color:#64748b;border-radius:50%;animation:typingDot 1.4s ease-in-out infinite}@keyframes kiosk-bar{0%,to{transform:scaleY(.35)}50%{transform:scaleY(1)}}.kiosk-bar{transform-origin:bottom;animation:kiosk-bar .9s ease-in-out infinite}.kiosk-bar:nth-child(2){animation-delay:.15s}.kiosk-bar:nth-child(3){animation-delay:.3s}.kiosk-bar:nth-child(4){animation-delay:.45s}@keyframes kiosk-pulse{0%{box-shadow:0 0 #0068b573;transform:scale(1)}50%{box-shadow:0 0 0 12px #0068b500;transform:scale(1.05)}to{box-shadow:0 0 #0068b500;transform:scale(1)}}@keyframes kiosk-pulse-red{0%{box-shadow:0 0 #ef444473;transform:scale(1)}50%{box-shadow:0 0 0 12px #ef444400;transform:scale(1.05)}to{box-shadow:0 0 #ef444400;transform:scale(1)}}.kiosk-pulse-recording{animation:kiosk-pulse-red 1.5s infinite}@keyframes bounce-slow{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}.animate-bounce-slow{animation:bounce-slow 2s ease-in-out infinite}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#94a3b8}*{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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))}.hover\:border-intel-blue:hover{--tw-border-opacity: 1;border-color:rgb(0 113 197 / var(--tw-border-opacity, 1))}.hover\:border-intel-blue\/50:hover{border-color:#0071c580}.hover\:bg-intel-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(0 90 158 / var(--tw-bg-opacity, 1))}.hover\:bg-kiosk-pane:hover{--tw-bg-opacity: 1;background-color:rgb(244 247 251 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:text-dash-value:hover{--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity, 1))}.hover\:text-intel-blue:hover{--tw-text-opacity: 1;color:rgb(0 113 197 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-4:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-amber-500\/30:focus{--tw-ring-color: rgb(245 158 11 / .3)}.focus\:ring-intel-blue:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 113 197 / var(--tw-ring-opacity, 1))}.focus\:ring-intel-blue\/30:focus{--tw-ring-color: rgb(0 113 197 / .3)}.focus\:ring-red-500\/30:focus{--tw-ring-color: rgb(239 68 68 / .3)}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}@media(min-width:1024px){.lg\:flex{display:flex}}@media(min-width:1280px){.xl\:block{display:block}} diff --git a/smart-kiosk-assistant/kiosk-ui/dist/assets/index-DT9PwSDs.js b/smart-kiosk-assistant/kiosk-ui/dist/assets/index-DT9PwSDs.js deleted file mode 100644 index 2417bacc..00000000 --- a/smart-kiosk-assistant/kiosk-ui/dist/assets/index-DT9PwSDs.js +++ /dev/null @@ -1,119 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const l of u.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function r(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function n(a){if(a.ep)return;a.ep=!0;const u=r(a);fetch(a.href,u)}})();var Fl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jd={exports:{}},So={},Td={exports:{}},je={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Hx;function K2(){if(Hx)return je;Hx=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),v=Symbol.iterator;function m(I){return I===null||typeof I!="object"?null:(I=v&&I[v]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,w={};function b(I,z,ne){this.props=I,this.context=z,this.refs=w,this.updater=ne||x}b.prototype.isReactComponent={},b.prototype.setState=function(I,z){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,z,"setState")},b.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function P(){}P.prototype=b.prototype;function E(I,z,ne){this.props=I,this.context=z,this.refs=w,this.updater=ne||x}var j=E.prototype=new P;j.constructor=E,S(j,b.prototype),j.isPureReactComponent=!0;var T=Array.isArray,_=Object.prototype.hasOwnProperty,O={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function N(I,z,ne){var ce,ve={},we=null,Ee=null;if(z!=null)for(ce in z.ref!==void 0&&(Ee=z.ref),z.key!==void 0&&(we=""+z.key),z)_.call(z,ce)&&!k.hasOwnProperty(ce)&&(ve[ce]=z[ce]);var Oe=arguments.length-2;if(Oe===1)ve.children=ne;else if(1>>1,z=F[I];if(0>>1;Ia(ve,G))wea(Ee,ve)?(F[I]=Ee,F[we]=G,I=we):(F[I]=ve,F[ce]=G,I=ce);else if(wea(Ee,G))F[I]=Ee,F[we]=G,I=we;else break e}}return K}function a(F,K){var G=F.sortIndex-K.sortIndex;return G!==0?G:F.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],h=1,v=null,m=3,x=!1,S=!1,w=!1,b=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(F){for(var K=r(d);K!==null;){if(K.callback===null)n(d);else if(K.startTime<=F)n(d),K.sortIndex=K.expirationTime,t(f,K);else break;K=r(d)}}function T(F){if(w=!1,j(F),!S)if(r(f)!==null)S=!0,J(_);else{var K=r(d);K!==null&&te(T,K.startTime-F)}}function _(F,K){S=!1,w&&(w=!1,P(N),N=-1),x=!0;var G=m;try{for(j(K),v=r(f);v!==null&&(!(v.expirationTime>K)||F&&!q());){var I=v.callback;if(typeof I=="function"){v.callback=null,m=v.priorityLevel;var z=I(v.expirationTime<=K);K=e.unstable_now(),typeof z=="function"?v.callback=z:v===r(f)&&n(f),j(K)}else n(f);v=r(f)}if(v!==null)var ne=!0;else{var ce=r(d);ce!==null&&te(T,ce.startTime-K),ne=!1}return ne}finally{v=null,m=G,x=!1}}var O=!1,k=null,N=-1,$=5,X=-1;function q(){return!(e.unstable_now()-X<$)}function L(){if(k!==null){var F=e.unstable_now();X=F;var K=!0;try{K=k(!0,F)}finally{K?H():(O=!1,k=null)}}else O=!1}var H;if(typeof E=="function")H=function(){E(L)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,Q=Y.port2;Y.port1.onmessage=L,H=function(){Q.postMessage(null)}}else H=function(){b(L,0)};function J(F){k=F,O||(O=!0,H())}function te(F,K){N=b(function(){F(e.unstable_now())},K)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(F){F.callback=null},e.unstable_continueExecution=function(){S||x||(S=!0,J(_))},e.unstable_forceFrameRate=function(F){0>F||125I?(F.sortIndex=G,t(d,F),r(f)===null&&F===r(d)&&(w?(P(N),N=-1):w=!0,te(T,G-I))):(F.sortIndex=z,t(f,F),S||x||(S=!0,J(_))),F},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(F){var K=m;return function(){var G=m;m=K;try{return F.apply(this,arguments)}finally{m=G}}}})(Md)),Md}var Yx;function Q2(){return Yx||(Yx=1,Cd.exports=Y2()),Cd.exports}/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Qx;function Z2(){if(Qx)return zt;Qx=1;var e=eg(),t=Q2();function r(i){for(var o="https://reactjs.org/docs/error-decoder.html?invariant="+i,s=1;s"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,d=/^[: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]*$/,h={},v={};function m(i){return f.call(v,i)?!0:f.call(h,i)?!1:d.test(i)?v[i]=!0:(h[i]=!0,!1)}function x(i,o,s,p){if(s!==null&&s.type===0)return!1;switch(typeof o){case"function":case"symbol":return!0;case"boolean":return p?!1:s!==null?!s.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function S(i,o,s,p){if(o===null||typeof o>"u"||x(i,o,s,p))return!0;if(p)return!1;if(s!==null)switch(s.type){case 3:return!o;case 4:return o===!1;case 5:return isNaN(o);case 6:return isNaN(o)||1>o}return!1}function w(i,o,s,p,y,g,A){this.acceptsBooleans=o===2||o===3||o===4,this.attributeName=p,this.attributeNamespace=y,this.mustUseProperty=s,this.propertyName=i,this.type=o,this.sanitizeURL=g,this.removeEmptyString=A}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){b[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var o=i[0];b[o]=new w(o,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){b[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){b[i]=new w(i,2,!1,i,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(i){b[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){b[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){b[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){b[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){b[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function E(i){return i[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(i){var o=i.replace(P,E);b[o]=new w(o,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var o=i.replace(P,E);b[o]=new w(o,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var o=i.replace(P,E);b[o]=new w(o,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){b[i]=new w(i,1,!1,i.toLowerCase(),null,!1,!1)}),b.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){b[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function j(i,o,s,p){var y=b.hasOwnProperty(o)?b[o]:null;(y!==null?y.type!==0:p||!(2M||y[A]!==g[M]){var R=` -`+y[A].replace(" at new "," at ");return i.displayName&&R.includes("")&&(R=R.replace("",i.displayName)),R}while(1<=A&&0<=M);break}}}finally{ne=!1,Error.prepareStackTrace=s}return(i=i?i.displayName||i.name:"")?z(i):""}function ve(i){switch(i.tag){case 5:return z(i.type);case 16:return z("Lazy");case 13:return z("Suspense");case 19:return z("SuspenseList");case 0:case 2:case 15:return i=ce(i.type,!1),i;case 11:return i=ce(i.type.render,!1),i;case 1:return i=ce(i.type,!0),i;default:return""}}function we(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case k:return"Fragment";case O:return"Portal";case $:return"Profiler";case N:return"StrictMode";case H:return"Suspense";case Y:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case q:return(i.displayName||"Context")+".Consumer";case X:return(i._context.displayName||"Context")+".Provider";case L:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case Q:return o=i.displayName||null,o!==null?o:we(i.type)||"Memo";case J:o=i._payload,i=i._init;try{return we(i(o))}catch{}}return null}function Ee(i){var o=i.type;switch(i.tag){case 24:return"Cache";case 9:return(o.displayName||"Context")+".Consumer";case 10:return(o._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=o.render,i=i.displayName||i.name||"",o.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return o;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return we(o);case 8:return o===N?"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 o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o}return null}function Oe(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ue(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function ge(i){var o=ue(i)?"checked":"value",s=Object.getOwnPropertyDescriptor(i.constructor.prototype,o),p=""+i[o];if(!i.hasOwnProperty(o)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var y=s.get,g=s.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return y.call(this)},set:function(A){p=""+A,g.call(this,A)}}),Object.defineProperty(i,o,{enumerable:s.enumerable}),{getValue:function(){return p},setValue:function(A){p=""+A},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function Pe(i){i._valueTracker||(i._valueTracker=ge(i))}function ae(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var s=o.getValue(),p="";return i&&(p=ue(i)?i.checked?"true":"false":i.value),i=p,i!==s?(o.setValue(i),!0):!1}function qe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Te(i,o){var s=o.checked;return G({},o,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??i._wrapperState.initialChecked})}function Je(i,o){var s=o.defaultValue==null?"":o.defaultValue,p=o.checked!=null?o.checked:o.defaultChecked;s=Oe(o.value!=null?o.value:s),i._wrapperState={initialChecked:p,initialValue:s,controlled:o.type==="checkbox"||o.type==="radio"?o.checked!=null:o.value!=null}}function et(i,o){o=o.checked,o!=null&&j(i,"checked",o,!1)}function ht(i,o){et(i,o);var s=Oe(o.value),p=o.type;if(s!=null)p==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+s):i.value!==""+s&&(i.value=""+s);else if(p==="submit"||p==="reset"){i.removeAttribute("value");return}o.hasOwnProperty("value")?Er(i,o.type,s):o.hasOwnProperty("defaultValue")&&Er(i,o.type,Oe(o.defaultValue)),o.checked==null&&o.defaultChecked!=null&&(i.defaultChecked=!!o.defaultChecked)}function dr(i,o,s){if(o.hasOwnProperty("value")||o.hasOwnProperty("defaultValue")){var p=o.type;if(!(p!=="submit"&&p!=="reset"||o.value!==void 0&&o.value!==null))return;o=""+i._wrapperState.initialValue,s||o===i.value||(i.value=o),i.defaultValue=o}s=i.name,s!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,s!==""&&(i.name=s)}function Er(i,o,s){(o!=="number"||qe(i.ownerDocument)!==i)&&(s==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+s&&(i.defaultValue=""+s))}var jr=Array.isArray;function $t(i,o,s,p){if(i=i.options,o){o={};for(var y=0;y"+o.valueOf().toString()+"",o=Iu.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;o.firstChild;)i.appendChild(o.firstChild)}});function Da(i,o){if(o){var s=i.firstChild;if(s&&s===i.lastChild&&s.nodeType===3){s.nodeValue=o;return}}i.textContent=o}var La={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},QT=["Webkit","ms","Moz","O"];Object.keys(La).forEach(function(i){QT.forEach(function(o){o=o+i.charAt(0).toUpperCase()+i.substring(1),La[o]=La[i]})});function o0(i,o,s){return o==null||typeof o=="boolean"||o===""?"":s||typeof o!="number"||o===0||La.hasOwnProperty(i)&&La[i]?(""+o).trim():o+"px"}function u0(i,o){i=i.style;for(var s in o)if(o.hasOwnProperty(s)){var p=s.indexOf("--")===0,y=o0(s,o[s],p);s==="float"&&(s="cssFloat"),p?i.setProperty(s,y):i[s]=y}}var ZT=G({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 Bc(i,o){if(o){if(ZT[i]&&(o.children!=null||o.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(o.dangerouslySetInnerHTML!=null){if(o.children!=null)throw Error(r(60));if(typeof o.dangerouslySetInnerHTML!="object"||!("__html"in o.dangerouslySetInnerHTML))throw Error(r(61))}if(o.style!=null&&typeof o.style!="object")throw Error(r(62))}}function qc(i,o){if(i.indexOf("-")===-1)return typeof o.is=="string";switch(i){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 zc=null;function Fc(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Uc=null,_i=null,Oi=null;function l0(i){if(i=oo(i)){if(typeof Uc!="function")throw Error(r(280));var o=i.stateNode;o&&(o=nl(o),Uc(i.stateNode,i.type,o))}}function s0(i){_i?Oi?Oi.push(i):Oi=[i]:_i=i}function c0(){if(_i){var i=_i,o=Oi;if(Oi=_i=null,l0(i),o)for(i=0;i>>=0,i===0?32:31-(sk(i)/ck|0)|0}var Bu=64,qu=4194304;function Fa(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function zu(i,o){var s=i.pendingLanes;if(s===0)return 0;var p=0,y=i.suspendedLanes,g=i.pingedLanes,A=s&268435455;if(A!==0){var M=A&~y;M!==0?p=Fa(M):(g&=A,g!==0&&(p=Fa(g)))}else A=s&~y,A!==0?p=Fa(A):g!==0&&(p=Fa(g));if(p===0)return 0;if(o!==0&&o!==p&&(o&y)===0&&(y=p&-p,g=o&-o,y>=g||y===16&&(g&4194240)!==0))return o;if((p&4)!==0&&(p|=s&16),o=i.entangledLanes,o!==0)for(i=i.entanglements,o&=p;0s;s++)o.push(i);return o}function Ua(i,o,s){i.pendingLanes|=o,o!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,o=31-hr(o),i[o]=s}function hk(i,o){var s=i.pendingLanes&~o;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=o,i.mutableReadLanes&=o,i.entangledLanes&=o,o=i.entanglements;var p=i.eventTimes;for(i=i.expirationTimes;0=Qa),L0=" ",B0=!1;function q0(i,o){switch(i){case"keyup":return Fk.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function z0(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ei=!1;function Wk(i,o){switch(i){case"compositionend":return z0(o);case"keypress":return o.which!==32?null:(B0=!0,L0);case"textInput":return i=o.data,i===L0&&B0?null:i;default:return null}}function Hk(i,o){if(Ei)return i==="compositionend"||!lf&&q0(i,o)?(i=M0(),Vu=tf=vn=null,Ei=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1=o)return{node:s,offset:o-i};i=p}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=G0(s)}}function Y0(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Y0(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function Q0(){for(var i=window,o=qe();o instanceof i.HTMLIFrameElement;){try{var s=typeof o.contentWindow.location.href=="string"}catch{s=!1}if(s)i=o.contentWindow;else break;o=qe(i.document)}return o}function ff(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}function e2(i){var o=Q0(),s=i.focusedElem,p=i.selectionRange;if(o!==s&&s&&s.ownerDocument&&Y0(s.ownerDocument.documentElement,s)){if(p!==null&&ff(s)){if(o=p.start,i=p.end,i===void 0&&(i=o),"selectionStart"in s)s.selectionStart=o,s.selectionEnd=Math.min(i,s.value.length);else if(i=(o=s.ownerDocument||document)&&o.defaultView||window,i.getSelection){i=i.getSelection();var y=s.textContent.length,g=Math.min(p.start,y);p=p.end===void 0?g:Math.min(p.end,y),!i.extend&&g>p&&(y=p,p=g,g=y),y=X0(s,g);var A=X0(s,p);y&&A&&(i.rangeCount!==1||i.anchorNode!==y.node||i.anchorOffset!==y.offset||i.focusNode!==A.node||i.focusOffset!==A.offset)&&(o=o.createRange(),o.setStart(y.node,y.offset),i.removeAllRanges(),g>p?(i.addRange(o),i.extend(A.node,A.offset)):(o.setEnd(A.node,A.offset),i.addRange(o)))}}for(o=[],i=s;i=i.parentNode;)i.nodeType===1&&o.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s=document.documentMode,ji=null,df=null,to=null,pf=!1;function Z0(i,o,s){var p=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;pf||ji==null||ji!==qe(p)||(p=ji,"selectionStart"in p&&ff(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),to&&eo(to,p)||(to=p,p=el(df,"onSelect"),0Ni||(i.current=Pf[Ni],Pf[Ni]=null,Ni--)}function Ue(i,o){Ni++,Pf[Ni]=i.current,i.current=o}var bn={},Ot=gn(bn),Rt=gn(!1),Hn=bn;function Ii(i,o){var s=i.type.contextTypes;if(!s)return bn;var p=i.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===o)return p.__reactInternalMemoizedMaskedChildContext;var y={},g;for(g in s)y[g]=o[g];return p&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=o,i.__reactInternalMemoizedMaskedChildContext=y),y}function Dt(i){return i=i.childContextTypes,i!=null}function il(){Ve(Rt),Ve(Ot)}function pb(i,o,s){if(Ot.current!==bn)throw Error(r(168));Ue(Ot,o),Ue(Rt,s)}function hb(i,o,s){var p=i.stateNode;if(o=o.childContextTypes,typeof p.getChildContext!="function")return s;p=p.getChildContext();for(var y in p)if(!(y in o))throw Error(r(108,Ee(i)||"Unknown",y));return G({},s,p)}function al(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||bn,Hn=Ot.current,Ue(Ot,i),Ue(Rt,Rt.current),!0}function vb(i,o,s){var p=i.stateNode;if(!p)throw Error(r(169));s?(i=hb(i,o,Hn),p.__reactInternalMemoizedMergedChildContext=i,Ve(Rt),Ve(Ot),Ue(Ot,i)):Ve(Rt),Ue(Rt,s)}var Fr=null,ol=!1,Af=!1;function yb(i){Fr===null?Fr=[i]:Fr.push(i)}function d2(i){ol=!0,yb(i)}function xn(){if(!Af&&Fr!==null){Af=!0;var i=0,o=Le;try{var s=Fr;for(Le=1;i>=A,y-=A,Ur=1<<32-hr(o)+y|s<_e?(mt=xe,xe=null):mt=xe.sibling;var Ie=re(U,xe,V[_e],le);if(Ie===null){xe===null&&(xe=mt);break}i&&xe&&Ie.alternate===null&&o(U,xe),D=g(Ie,D,_e),be===null?me=Ie:be.sibling=Ie,be=Ie,xe=mt}if(_e===V.length)return s(U,xe),Ge&&Kn(U,_e),me;if(xe===null){for(;_e_e?(mt=xe,xe=null):mt=xe.sibling;var Tn=re(U,xe,Ie.value,le);if(Tn===null){xe===null&&(xe=mt);break}i&&xe&&Tn.alternate===null&&o(U,xe),D=g(Tn,D,_e),be===null?me=Tn:be.sibling=Tn,be=Tn,xe=mt}if(Ie.done)return s(U,xe),Ge&&Kn(U,_e),me;if(xe===null){for(;!Ie.done;_e++,Ie=V.next())Ie=oe(U,Ie.value,le),Ie!==null&&(D=g(Ie,D,_e),be===null?me=Ie:be.sibling=Ie,be=Ie);return Ge&&Kn(U,_e),me}for(xe=p(U,xe);!Ie.done;_e++,Ie=V.next())Ie=fe(xe,U,_e,Ie.value,le),Ie!==null&&(i&&Ie.alternate!==null&&xe.delete(Ie.key===null?_e:Ie.key),D=g(Ie,D,_e),be===null?me=Ie:be.sibling=Ie,be=Ie);return i&&xe.forEach(function(V2){return o(U,V2)}),Ge&&Kn(U,_e),me}function it(U,D,V,le){if(typeof V=="object"&&V!==null&&V.type===k&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case _:e:{for(var me=V.key,be=D;be!==null;){if(be.key===me){if(me=V.type,me===k){if(be.tag===7){s(U,be.sibling),D=y(be,V.props.children),D.return=U,U=D;break e}}else if(be.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===J&&Sb(me)===be.type){s(U,be.sibling),D=y(be,V.props),D.ref=uo(U,be,V),D.return=U,U=D;break e}s(U,be);break}else o(U,be);be=be.sibling}V.type===k?(D=ti(V.props.children,U.mode,le,V.key),D.return=U,U=D):(le=Il(V.type,V.key,V.props,null,U.mode,le),le.ref=uo(U,D,V),le.return=U,U=le)}return A(U);case O:e:{for(be=V.key;D!==null;){if(D.key===be)if(D.tag===4&&D.stateNode.containerInfo===V.containerInfo&&D.stateNode.implementation===V.implementation){s(U,D.sibling),D=y(D,V.children||[]),D.return=U,U=D;break e}else{s(U,D);break}else o(U,D);D=D.sibling}D=_d(V,U.mode,le),D.return=U,U=D}return A(U);case J:return be=V._init,it(U,D,be(V._payload),le)}if(jr(V))return he(U,D,V,le);if(K(V))return ye(U,D,V,le);cl(U,V)}return typeof V=="string"&&V!==""||typeof V=="number"?(V=""+V,D!==null&&D.tag===6?(s(U,D.sibling),D=y(D,V),D.return=U,U=D):(s(U,D),D=Sd(V,U.mode,le),D.return=U,U=D),A(U)):s(U,D)}return it}var Li=_b(!0),Ob=_b(!1),fl=gn(null),dl=null,Bi=null,Mf=null;function Nf(){Mf=Bi=dl=null}function If(i){var o=fl.current;Ve(fl),i._currentValue=o}function $f(i,o,s){for(;i!==null;){var p=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),i===s)break;i=i.return}}function qi(i,o){dl=i,Mf=Bi=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&o)!==0&&(Lt=!0),i.firstContext=null)}function er(i){var o=i._currentValue;if(Mf!==i)if(i={context:i,memoizedValue:o,next:null},Bi===null){if(dl===null)throw Error(r(308));Bi=i,dl.dependencies={lanes:0,firstContext:i}}else Bi=Bi.next=i;return o}var Gn=null;function Rf(i){Gn===null?Gn=[i]:Gn.push(i)}function Pb(i,o,s,p){var y=o.interleaved;return y===null?(s.next=s,Rf(o)):(s.next=y.next,y.next=s),o.interleaved=s,Hr(i,p)}function Hr(i,o){i.lanes|=o;var s=i.alternate;for(s!==null&&(s.lanes|=o),s=i,i=i.return;i!==null;)i.childLanes|=o,s=i.alternate,s!==null&&(s.childLanes|=o),s=i,i=i.return;return s.tag===3?s.stateNode:null}var wn=!1;function Df(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ab(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Vr(i,o){return{eventTime:i,lane:o,tag:0,payload:null,callback:null,next:null}}function Sn(i,o,s){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(Me&2)!==0){var y=p.pending;return y===null?o.next=o:(o.next=y.next,y.next=o),p.pending=o,Hr(i,s)}return y=p.interleaved,y===null?(o.next=o,Rf(p)):(o.next=y.next,y.next=o),p.interleaved=o,Hr(i,s)}function pl(i,o,s){if(o=o.updateQueue,o!==null&&(o=o.shared,(s&4194240)!==0)){var p=o.lanes;p&=i.pendingLanes,s|=p,o.lanes=s,Yc(i,s)}}function Eb(i,o){var s=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,s===p)){var y=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var A={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};g===null?y=g=A:g=g.next=A,s=s.next}while(s!==null);g===null?y=g=o:g=g.next=o}else y=g=o;s={baseState:p.baseState,firstBaseUpdate:y,lastBaseUpdate:g,shared:p.shared,effects:p.effects},i.updateQueue=s;return}i=s.lastBaseUpdate,i===null?s.firstBaseUpdate=o:i.next=o,s.lastBaseUpdate=o}function hl(i,o,s,p){var y=i.updateQueue;wn=!1;var g=y.firstBaseUpdate,A=y.lastBaseUpdate,M=y.shared.pending;if(M!==null){y.shared.pending=null;var R=M,Z=R.next;R.next=null,A===null?g=Z:A.next=Z,A=R;var ie=i.alternate;ie!==null&&(ie=ie.updateQueue,M=ie.lastBaseUpdate,M!==A&&(M===null?ie.firstBaseUpdate=Z:M.next=Z,ie.lastBaseUpdate=R))}if(g!==null){var oe=y.baseState;A=0,ie=Z=R=null,M=g;do{var re=M.lane,fe=M.eventTime;if((p&re)===re){ie!==null&&(ie=ie.next={eventTime:fe,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var he=i,ye=M;switch(re=o,fe=s,ye.tag){case 1:if(he=ye.payload,typeof he=="function"){oe=he.call(fe,oe,re);break e}oe=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ye.payload,re=typeof he=="function"?he.call(fe,oe,re):he,re==null)break e;oe=G({},oe,re);break e;case 2:wn=!0}}M.callback!==null&&M.lane!==0&&(i.flags|=64,re=y.effects,re===null?y.effects=[M]:re.push(M))}else fe={eventTime:fe,lane:re,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ie===null?(Z=ie=fe,R=oe):ie=ie.next=fe,A|=re;if(M=M.next,M===null){if(M=y.shared.pending,M===null)break;re=M,M=re.next,re.next=null,y.lastBaseUpdate=re,y.shared.pending=null}}while(!0);if(ie===null&&(R=oe),y.baseState=R,y.firstBaseUpdate=Z,y.lastBaseUpdate=ie,o=y.shared.interleaved,o!==null){y=o;do A|=y.lane,y=y.next;while(y!==o)}else g===null&&(y.shared.lanes=0);Qn|=A,i.lanes=A,i.memoizedState=oe}}function jb(i,o,s){if(i=o.effects,o.effects=null,i!==null)for(o=0;os?s:4,i(!0);var p=Ff.transition;Ff.transition={};try{i(!1),o()}finally{Le=s,Ff.transition=p}}function Kb(){return tr().memoizedState}function y2(i,o,s){var p=An(i);if(s={lane:p,action:s,hasEagerState:!1,eagerState:null,next:null},Gb(i))Xb(o,s);else if(s=Pb(i,o,s,p),s!==null){var y=Nt();xr(s,i,p,y),Yb(s,o,p)}}function m2(i,o,s){var p=An(i),y={lane:p,action:s,hasEagerState:!1,eagerState:null,next:null};if(Gb(i))Xb(o,y);else{var g=i.alternate;if(i.lanes===0&&(g===null||g.lanes===0)&&(g=o.lastRenderedReducer,g!==null))try{var A=o.lastRenderedState,M=g(A,s);if(y.hasEagerState=!0,y.eagerState=M,vr(M,A)){var R=o.interleaved;R===null?(y.next=y,Rf(o)):(y.next=R.next,R.next=y),o.interleaved=y;return}}catch{}finally{}s=Pb(i,o,y,p),s!==null&&(y=Nt(),xr(s,i,p,y),Yb(s,o,p))}}function Gb(i){var o=i.alternate;return i===Qe||o!==null&&o===Qe}function Xb(i,o){fo=ml=!0;var s=i.pending;s===null?o.next=o:(o.next=s.next,s.next=o),i.pending=o}function Yb(i,o,s){if((s&4194240)!==0){var p=o.lanes;p&=i.pendingLanes,s|=p,o.lanes=s,Yc(i,s)}}var xl={readContext:er,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useInsertionEffect:Pt,useLayoutEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useMutableSource:Pt,useSyncExternalStore:Pt,useId:Pt,unstable_isNewReconciler:!1},g2={readContext:er,useCallback:function(i,o){return Mr().memoizedState=[i,o===void 0?null:o],i},useContext:er,useEffect:Bb,useImperativeHandle:function(i,o,s){return s=s!=null?s.concat([i]):null,gl(4194308,4,Fb.bind(null,o,i),s)},useLayoutEffect:function(i,o){return gl(4194308,4,i,o)},useInsertionEffect:function(i,o){return gl(4,2,i,o)},useMemo:function(i,o){var s=Mr();return o=o===void 0?null:o,i=i(),s.memoizedState=[i,o],i},useReducer:function(i,o,s){var p=Mr();return o=s!==void 0?s(o):o,p.memoizedState=p.baseState=o,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:o},p.queue=i,i=i.dispatch=y2.bind(null,Qe,i),[p.memoizedState,i]},useRef:function(i){var o=Mr();return i={current:i},o.memoizedState=i},useState:Db,useDebugValue:Xf,useDeferredValue:function(i){return Mr().memoizedState=i},useTransition:function(){var i=Db(!1),o=i[0];return i=v2.bind(null,i[1]),Mr().memoizedState=i,[o,i]},useMutableSource:function(){},useSyncExternalStore:function(i,o,s){var p=Qe,y=Mr();if(Ge){if(s===void 0)throw Error(r(407));s=s()}else{if(s=o(),yt===null)throw Error(r(349));(Yn&30)!==0||Mb(p,o,s)}y.memoizedState=s;var g={value:s,getSnapshot:o};return y.queue=g,Bb(Ib.bind(null,p,g,i),[i]),p.flags|=2048,vo(9,Nb.bind(null,p,g,s,o),void 0,null),s},useId:function(){var i=Mr(),o=yt.identifierPrefix;if(Ge){var s=Wr,p=Ur;s=(p&~(1<<32-hr(p)-1)).toString(32)+s,o=":"+o+"R"+s,s=po++,0<\/script>",i=i.removeChild(i.firstChild)):typeof p.is=="string"?i=A.createElement(s,{is:p.is}):(i=A.createElement(s),s==="select"&&(A=i,p.multiple?A.multiple=!0:p.size&&(A.size=p.size))):i=A.createElementNS(i,s),i[kr]=o,i[ao]=p,yx(i,o,!1,!1),o.stateNode=i;e:{switch(A=qc(s,p),s){case"dialog":He("cancel",i),He("close",i),y=p;break;case"iframe":case"object":case"embed":He("load",i),y=p;break;case"video":case"audio":for(y=0;yHi&&(o.flags|=128,p=!0,yo(g,!1),o.lanes=4194304)}else{if(!p)if(i=vl(A),i!==null){if(o.flags|=128,p=!0,s=i.updateQueue,s!==null&&(o.updateQueue=s,o.flags|=4),yo(g,!0),g.tail===null&&g.tailMode==="hidden"&&!A.alternate&&!Ge)return At(o),null}else 2*nt()-g.renderingStartTime>Hi&&s!==1073741824&&(o.flags|=128,p=!0,yo(g,!1),o.lanes=4194304);g.isBackwards?(A.sibling=o.child,o.child=A):(s=g.last,s!==null?s.sibling=A:o.child=A,g.last=A)}return g.tail!==null?(o=g.tail,g.rendering=o,g.tail=o.sibling,g.renderingStartTime=nt(),o.sibling=null,s=Ye.current,Ue(Ye,p?s&1|2:s&1),o):(At(o),null);case 22:case 23:return bd(),p=o.memoizedState!==null,i!==null&&i.memoizedState!==null!==p&&(o.flags|=8192),p&&(o.mode&1)!==0?(Kt&1073741824)!==0&&(At(o),o.subtreeFlags&6&&(o.flags|=8192)):At(o),null;case 24:return null;case 25:return null}throw Error(r(156,o.tag))}function A2(i,o){switch(jf(o),o.tag){case 1:return Dt(o.type)&&il(),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return zi(),Ve(Rt),Ve(Ot),zf(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 5:return Bf(o),null;case 13:if(Ve(Ye),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));Di()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return Ve(Ye),null;case 4:return zi(),null;case 10:return If(o.type._context),null;case 22:case 23:return bd(),null;case 24:return null;default:return null}}var Ol=!1,Et=!1,E2=typeof WeakSet=="function"?WeakSet:Set,de=null;function Ui(i,o){var s=i.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(p){tt(i,o,p)}else s.current=null}function ud(i,o,s){try{s()}catch(p){tt(i,o,p)}}var bx=!1;function j2(i,o){if(bf=Wu,i=Q0(),ff(i)){if("selectionStart"in i)var s={start:i.selectionStart,end:i.selectionEnd};else e:{s=(s=i.ownerDocument)&&s.defaultView||window;var p=s.getSelection&&s.getSelection();if(p&&p.rangeCount!==0){s=p.anchorNode;var y=p.anchorOffset,g=p.focusNode;p=p.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var A=0,M=-1,R=-1,Z=0,ie=0,oe=i,re=null;t:for(;;){for(var fe;oe!==s||y!==0&&oe.nodeType!==3||(M=A+y),oe!==g||p!==0&&oe.nodeType!==3||(R=A+p),oe.nodeType===3&&(A+=oe.nodeValue.length),(fe=oe.firstChild)!==null;)re=oe,oe=fe;for(;;){if(oe===i)break t;if(re===s&&++Z===y&&(M=A),re===g&&++ie===p&&(R=A),(fe=oe.nextSibling)!==null)break;oe=re,re=oe.parentNode}oe=fe}s=M===-1||R===-1?null:{start:M,end:R}}else s=null}s=s||{start:0,end:0}}else s=null;for(xf={focusedElem:i,selectionRange:s},Wu=!1,de=o;de!==null;)if(o=de,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,de=i;else for(;de!==null;){o=de;try{var he=o.alternate;if((o.flags&1024)!==0)switch(o.tag){case 0:case 11:case 15:break;case 1:if(he!==null){var ye=he.memoizedProps,it=he.memoizedState,U=o.stateNode,D=U.getSnapshotBeforeUpdate(o.elementType===o.type?ye:mr(o.type,ye),it);U.__reactInternalSnapshotBeforeUpdate=D}break;case 3:var V=o.stateNode.containerInfo;V.nodeType===1?V.textContent="":V.nodeType===9&&V.documentElement&&V.removeChild(V.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(le){tt(o,o.return,le)}if(i=o.sibling,i!==null){i.return=o.return,de=i;break}de=o.return}return he=bx,bx=!1,he}function mo(i,o,s){var p=o.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var y=p=p.next;do{if((y.tag&i)===i){var g=y.destroy;y.destroy=void 0,g!==void 0&&ud(o,s,g)}y=y.next}while(y!==p)}}function Pl(i,o){if(o=o.updateQueue,o=o!==null?o.lastEffect:null,o!==null){var s=o=o.next;do{if((s.tag&i)===i){var p=s.create;s.destroy=p()}s=s.next}while(s!==o)}}function ld(i){var o=i.ref;if(o!==null){var s=i.stateNode;switch(i.tag){case 5:i=s;break;default:i=s}typeof o=="function"?o(i):o.current=i}}function xx(i){var o=i.alternate;o!==null&&(i.alternate=null,xx(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&(delete o[kr],delete o[ao],delete o[Of],delete o[c2],delete o[f2])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function wx(i){return i.tag===5||i.tag===3||i.tag===4}function Sx(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||wx(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function sd(i,o,s){var p=i.tag;if(p===5||p===6)i=i.stateNode,o?s.nodeType===8?s.parentNode.insertBefore(i,o):s.insertBefore(i,o):(s.nodeType===8?(o=s.parentNode,o.insertBefore(i,s)):(o=s,o.appendChild(i)),s=s._reactRootContainer,s!=null||o.onclick!==null||(o.onclick=rl));else if(p!==4&&(i=i.child,i!==null))for(sd(i,o,s),i=i.sibling;i!==null;)sd(i,o,s),i=i.sibling}function cd(i,o,s){var p=i.tag;if(p===5||p===6)i=i.stateNode,o?s.insertBefore(i,o):s.appendChild(i);else if(p!==4&&(i=i.child,i!==null))for(cd(i,o,s),i=i.sibling;i!==null;)cd(i,o,s),i=i.sibling}var xt=null,gr=!1;function _n(i,o,s){for(s=s.child;s!==null;)_x(i,o,s),s=s.sibling}function _x(i,o,s){if(Tr&&typeof Tr.onCommitFiberUnmount=="function")try{Tr.onCommitFiberUnmount(Lu,s)}catch{}switch(s.tag){case 5:Et||Ui(s,o);case 6:var p=xt,y=gr;xt=null,_n(i,o,s),xt=p,gr=y,xt!==null&&(gr?(i=xt,s=s.stateNode,i.nodeType===8?i.parentNode.removeChild(s):i.removeChild(s)):xt.removeChild(s.stateNode));break;case 18:xt!==null&&(gr?(i=xt,s=s.stateNode,i.nodeType===8?_f(i.parentNode,s):i.nodeType===1&&_f(i,s),Ga(i)):_f(xt,s.stateNode));break;case 4:p=xt,y=gr,xt=s.stateNode.containerInfo,gr=!0,_n(i,o,s),xt=p,gr=y;break;case 0:case 11:case 14:case 15:if(!Et&&(p=s.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){y=p=p.next;do{var g=y,A=g.destroy;g=g.tag,A!==void 0&&((g&2)!==0||(g&4)!==0)&&ud(s,o,A),y=y.next}while(y!==p)}_n(i,o,s);break;case 1:if(!Et&&(Ui(s,o),p=s.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=s.memoizedProps,p.state=s.memoizedState,p.componentWillUnmount()}catch(M){tt(s,o,M)}_n(i,o,s);break;case 21:_n(i,o,s);break;case 22:s.mode&1?(Et=(p=Et)||s.memoizedState!==null,_n(i,o,s),Et=p):_n(i,o,s);break;default:_n(i,o,s)}}function Ox(i){var o=i.updateQueue;if(o!==null){i.updateQueue=null;var s=i.stateNode;s===null&&(s=i.stateNode=new E2),o.forEach(function(p){var y=D2.bind(null,i,p);s.has(p)||(s.add(p),p.then(y,y))})}}function br(i,o){var s=o.deletions;if(s!==null)for(var p=0;py&&(y=A),p&=~g}if(p=y,p=nt()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*k2(p/1960))-p,10i?16:i,Pn===null)var p=!1;else{if(i=Pn,Pn=null,kl=0,(Me&6)!==0)throw Error(r(331));var y=Me;for(Me|=4,de=i.current;de!==null;){var g=de,A=g.child;if((de.flags&16)!==0){var M=g.deletions;if(M!==null){for(var R=0;Rnt()-pd?Jn(i,0):dd|=s),qt(i,o)}function Dx(i,o){o===0&&((i.mode&1)===0?o=1:(o=qu,qu<<=1,(qu&130023424)===0&&(qu=4194304)));var s=Nt();i=Hr(i,o),i!==null&&(Ua(i,o,s),qt(i,s))}function R2(i){var o=i.memoizedState,s=0;o!==null&&(s=o.retryLane),Dx(i,s)}function D2(i,o){var s=0;switch(i.tag){case 13:var p=i.stateNode,y=i.memoizedState;y!==null&&(s=y.retryLane);break;case 19:p=i.stateNode;break;default:throw Error(r(314))}p!==null&&p.delete(o),Dx(i,s)}var Lx;Lx=function(i,o,s){if(i!==null)if(i.memoizedProps!==o.pendingProps||Rt.current)Lt=!0;else{if((i.lanes&s)===0&&(o.flags&128)===0)return Lt=!1,O2(i,o,s);Lt=(i.flags&131072)!==0}else Lt=!1,Ge&&(o.flags&1048576)!==0&&mb(o,ll,o.index);switch(o.lanes=0,o.tag){case 2:var p=o.type;_l(i,o),i=o.pendingProps;var y=Ii(o,Ot.current);qi(o,s),y=Wf(null,o,p,i,y,s);var g=Hf();return o.flags|=1,typeof y=="object"&&y!==null&&typeof y.render=="function"&&y.$$typeof===void 0?(o.tag=1,o.memoizedState=null,o.updateQueue=null,Dt(p)?(g=!0,al(o)):g=!1,o.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,Df(o),y.updater=wl,o.stateNode=y,y._reactInternals=o,Qf(o,p,i,s),o=td(null,o,p,!0,g,s)):(o.tag=0,Ge&&g&&Ef(o),Mt(null,o,y,s),o=o.child),o;case 16:p=o.elementType;e:{switch(_l(i,o),i=o.pendingProps,y=p._init,p=y(p._payload),o.type=p,y=o.tag=B2(p),i=mr(p,i),y){case 0:o=ed(null,o,p,i,s);break e;case 1:o=cx(null,o,p,i,s);break e;case 11:o=ax(null,o,p,i,s);break e;case 14:o=ox(null,o,p,mr(p.type,i),s);break e}throw Error(r(306,p,""))}return o;case 0:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:mr(p,y),ed(i,o,p,y,s);case 1:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:mr(p,y),cx(i,o,p,y,s);case 3:e:{if(fx(o),i===null)throw Error(r(387));p=o.pendingProps,g=o.memoizedState,y=g.element,Ab(i,o),hl(o,p,null,s);var A=o.memoizedState;if(p=A.element,g.isDehydrated)if(g={element:p,isDehydrated:!1,cache:A.cache,pendingSuspenseBoundaries:A.pendingSuspenseBoundaries,transitions:A.transitions},o.updateQueue.baseState=g,o.memoizedState=g,o.flags&256){y=Fi(Error(r(423)),o),o=dx(i,o,p,s,y);break e}else if(p!==y){y=Fi(Error(r(424)),o),o=dx(i,o,p,s,y);break e}else for(Vt=mn(o.stateNode.containerInfo.firstChild),Ht=o,Ge=!0,yr=null,s=Ob(o,null,p,s),o.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Di(),p===y){o=Kr(i,o,s);break e}Mt(i,o,p,s)}o=o.child}return o;case 5:return Tb(o),i===null&&kf(o),p=o.type,y=o.pendingProps,g=i!==null?i.memoizedProps:null,A=y.children,wf(p,y)?A=null:g!==null&&wf(p,g)&&(o.flags|=32),sx(i,o),Mt(i,o,A,s),o.child;case 6:return i===null&&kf(o),null;case 13:return px(i,o,s);case 4:return Lf(o,o.stateNode.containerInfo),p=o.pendingProps,i===null?o.child=Li(o,null,p,s):Mt(i,o,p,s),o.child;case 11:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:mr(p,y),ax(i,o,p,y,s);case 7:return Mt(i,o,o.pendingProps,s),o.child;case 8:return Mt(i,o,o.pendingProps.children,s),o.child;case 12:return Mt(i,o,o.pendingProps.children,s),o.child;case 10:e:{if(p=o.type._context,y=o.pendingProps,g=o.memoizedProps,A=y.value,Ue(fl,p._currentValue),p._currentValue=A,g!==null)if(vr(g.value,A)){if(g.children===y.children&&!Rt.current){o=Kr(i,o,s);break e}}else for(g=o.child,g!==null&&(g.return=o);g!==null;){var M=g.dependencies;if(M!==null){A=g.child;for(var R=M.firstContext;R!==null;){if(R.context===p){if(g.tag===1){R=Vr(-1,s&-s),R.tag=2;var Z=g.updateQueue;if(Z!==null){Z=Z.shared;var ie=Z.pending;ie===null?R.next=R:(R.next=ie.next,ie.next=R),Z.pending=R}}g.lanes|=s,R=g.alternate,R!==null&&(R.lanes|=s),$f(g.return,s,o),M.lanes|=s;break}R=R.next}}else if(g.tag===10)A=g.type===o.type?null:g.child;else if(g.tag===18){if(A=g.return,A===null)throw Error(r(341));A.lanes|=s,M=A.alternate,M!==null&&(M.lanes|=s),$f(A,s,o),A=g.sibling}else A=g.child;if(A!==null)A.return=g;else for(A=g;A!==null;){if(A===o){A=null;break}if(g=A.sibling,g!==null){g.return=A.return,A=g;break}A=A.return}g=A}Mt(i,o,y.children,s),o=o.child}return o;case 9:return y=o.type,p=o.pendingProps.children,qi(o,s),y=er(y),p=p(y),o.flags|=1,Mt(i,o,p,s),o.child;case 14:return p=o.type,y=mr(p,o.pendingProps),y=mr(p.type,y),ox(i,o,p,y,s);case 15:return ux(i,o,o.type,o.pendingProps,s);case 17:return p=o.type,y=o.pendingProps,y=o.elementType===p?y:mr(p,y),_l(i,o),o.tag=1,Dt(p)?(i=!0,al(o)):i=!1,qi(o,s),Zb(o,p,y),Qf(o,p,y,s),td(null,o,p,!0,i,s);case 19:return vx(i,o,s);case 22:return lx(i,o,s)}throw Error(r(156,o.tag))};function Bx(i,o){return g0(i,o)}function L2(i,o,s,p){this.tag=i,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nr(i,o,s,p){return new L2(i,o,s,p)}function wd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function B2(i){if(typeof i=="function")return wd(i)?1:0;if(i!=null){if(i=i.$$typeof,i===L)return 11;if(i===Q)return 14}return 2}function jn(i,o){var s=i.alternate;return s===null?(s=nr(i.tag,o,i.key,i.mode),s.elementType=i.elementType,s.type=i.type,s.stateNode=i.stateNode,s.alternate=i,i.alternate=s):(s.pendingProps=o,s.type=i.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=i.flags&14680064,s.childLanes=i.childLanes,s.lanes=i.lanes,s.child=i.child,s.memoizedProps=i.memoizedProps,s.memoizedState=i.memoizedState,s.updateQueue=i.updateQueue,o=i.dependencies,s.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},s.sibling=i.sibling,s.index=i.index,s.ref=i.ref,s}function Il(i,o,s,p,y,g){var A=2;if(p=i,typeof i=="function")wd(i)&&(A=1);else if(typeof i=="string")A=5;else e:switch(i){case k:return ti(s.children,y,g,o);case N:A=8,y|=8;break;case $:return i=nr(12,s,o,y|2),i.elementType=$,i.lanes=g,i;case H:return i=nr(13,s,o,y),i.elementType=H,i.lanes=g,i;case Y:return i=nr(19,s,o,y),i.elementType=Y,i.lanes=g,i;case te:return $l(s,y,g,o);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case X:A=10;break e;case q:A=9;break e;case L:A=11;break e;case Q:A=14;break e;case J:A=16,p=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return o=nr(A,s,o,y),o.elementType=i,o.type=p,o.lanes=g,o}function ti(i,o,s,p){return i=nr(7,i,p,o),i.lanes=s,i}function $l(i,o,s,p){return i=nr(22,i,p,o),i.elementType=te,i.lanes=s,i.stateNode={isHidden:!1},i}function Sd(i,o,s){return i=nr(6,i,null,o),i.lanes=s,i}function _d(i,o,s){return o=nr(4,i.children!==null?i.children:[],i.key,o),o.lanes=s,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}function q2(i,o,s,p,y){this.tag=o,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xc(0),this.expirationTimes=Xc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xc(0),this.identifierPrefix=p,this.onRecoverableError=y,this.mutableSourceEagerHydrationData=null}function Od(i,o,s,p,y,g,A,M,R){return i=new q2(i,o,s,M,R),o===1?(o=1,g===!0&&(o|=8)):o=0,g=nr(3,null,null,o),i.current=g,g.stateNode=i,g.memoizedState={element:p,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Df(g),i}function z2(i,o,s){var p=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),kd.exports=Z2(),kd.exports}var Jx;function eC(){if(Jx)return Ul;Jx=1;var e=J2();return Ul.createRoot=e.createRoot,Ul.hydrateRoot=e.hydrateRoot,Ul}var tC=eC();const rC="/assets/BrandSlot-B9l4dQxi.svg",Dy={TITLE:"Kiosk Voice Assistant",COPYRIGHT:"© 2026 Intel Corporation. All rights reserved.",VERSION:"2026.1.0"},Tt={startStream:"/api/v1/sessions/start-stream",pushAudio:e=>`/api/v1/sessions/${e}/audio`,endAudio:e=>`/api/v1/sessions/${e}/audio/end`,pollSession:e=>`/api/v1/sessions/${e}`,sessionAudioFile:(e,t)=>`/api/v1/sessions/${e}/audio/${encodeURIComponent(t)}`,products:"/api/v1/products",currentOrder:e=>`/api/v1/users/${encodeURIComponent(e)}/orders/current`,upsell:"/api/v1/upsell",ragContext:"/rag/api/v1/context",ragContextFile:"/rag/api/v1/context/file",ragModelInfo:"/rag/api/v1/model-info",ragPerformance:"/rag/api/v1/performance",asrModelInfo:"/asr/v1/model-info",asrPerformance:"/asr/v1/performance",ttsModelInfo:"/tts/v1/model-info",ttsPerformance:"/tts/v1/performance",metrics:"/metrics-svc/metrics"},Yr={chunkSeconds:5,sampleRate:16e3,pollIntervalMs:350,perfRefreshMs:1e4,maxHistoryTurns:4,userId:"kiosk-user"},zA=[{label:"QuickBite (QSR)",file:"QuickBite-M.md"},{label:"MegaRetail (Retail Store)",file:"MegaRetail-M.md"},{label:"SkyJet (Airline)",file:"SkyJet-S.md"}];function Nd({label:e,pct:t,color:r}){const n=t!==null?`${Math.round(t)}%`:"—";return C.jsxs("div",{className:"flex items-center gap-1.5 rounded-full bg-white/10 px-3 py-1",children:[C.jsx("span",{className:"h-2 w-2 rounded-full",style:{backgroundColor:r}}),C.jsx("span",{className:"text-[11px] font-semibold text-white/70",children:e}),C.jsx("span",{className:"font-mono text-sm font-bold text-white",children:n})]})}function nC({phase:e}){const t={idle:{label:"READY",cls:"bg-white/10 text-white/60"},listening:{label:"● LISTENING",cls:"bg-red-500/20 text-red-300 animate-pulse"},processing:{label:"⟳ PROCESSING",cls:"bg-amber-500/20 text-amber-300"},speaking:{label:"▶ SPEAKING",cls:"bg-green-500/20 text-green-300"}},{label:r,cls:n}=t[e];return C.jsx("div",{className:`rounded-full px-3 py-1 text-[11px] font-bold tracking-widest ${n}`,children:r})}const iC=({phase:e,cpuPct:t,gpuPct:r,npuPct:n})=>C.jsxs("header",{className:"sticky top-0 left-0 right-0 z-50 bg-intel-blue w-full flex items-center justify-between px-6 border-b border-intel-blue-dark",style:{height:"64px"},children:[C.jsxs("div",{className:"flex items-center gap-4",children:[C.jsx("img",{src:rC,alt:"Intel",className:"h-[52px] w-auto object-contain"}),C.jsxs("div",{className:"flex flex-col",children:[C.jsx("span",{className:"text-base font-semibold text-white font-display leading-tight",children:Dy.TITLE}),C.jsxs("span",{className:"text-[10px] text-white/50 font-mono tracking-widest uppercase",children:["AI Benchmarking Demo · v",Dy.VERSION]})]})]}),C.jsxs("div",{className:"hidden lg:flex items-center gap-2",children:[C.jsx(Nd,{label:"CPU",pct:t,color:"#60a5fa"}),C.jsx(Nd,{label:"GPU",pct:r,color:"#4ade80"}),C.jsx(Nd,{label:"NPU",pct:n,color:"#c084fc"})]}),C.jsxs("div",{className:"flex items-center gap-3",children:[C.jsx(nC,{phase:e}),C.jsx("span",{className:"hidden xl:block text-[11px] font-mono text-white/40",children:new Date().toLocaleTimeString("en-GB",{hour12:!1})})]})]}),aC=()=>C.jsx("footer",{className:"sticky bottom-0 left-0 right-0 w-full bg-intel-blue text-white text-center px-8 h-12 text-sm z-10 shadow-[0_-2px_8px_rgba(0,0,0,0.04)] border-t border-intel-blue-dark flex items-center justify-center font-text",children:C.jsx("span",{children:Dy.COPYRIGHT})});function Id({role:e,text:t,streaming:r,isLatest:n}){const[a,u]=W.useState(!1),l=e==="user",c=async()=>{try{await navigator.clipboard.writeText(t),u(!0),setTimeout(()=>u(!1),2e3)}catch{}};return C.jsx("div",{className:`flex ${l?"justify-end":"justify-start"} kiosk-message-fade-in`,style:n?{animation:"messageSlideIn 0.3s ease-out"}:void 0,children:C.jsxs("div",{className:`group relative max-w-[80%] rounded-2xl px-4 py-3 text-sm whitespace-pre-wrap break-words shadow-sm transition-all duration-150 ${l?"bg-kiosk-user text-white rounded-br-sm hover:shadow-md":"bg-kiosk-asst text-intel-dark rounded-bl-sm hover:shadow-md"}`,children:[t,r?C.jsx("span",{className:"kiosk-cursor ml-0.5 inline-block",children:"▋"}):null,!l&&!r&&t&&C.jsx("button",{type:"button",onClick:()=>void c(),className:"absolute -top-2 -right-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200 bg-white rounded-full p-1.5 shadow-md border border-kiosk-border hover:bg-kiosk-pane",title:"Copy message","aria-label":"Copy message to clipboard",children:a?C.jsx("svg",{className:"w-3.5 h-3.5 text-green-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}):C.jsx("svg",{className:"w-3.5 h-3.5 text-intel-blue",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",children:C.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"})})})]})})}function oC(){return C.jsx("div",{className:"flex justify-start",children:C.jsx("div",{className:"bg-kiosk-asst rounded-2xl rounded-bl-sm px-4 py-3 shadow-sm",children:C.jsxs("div",{className:"flex items-center space-x-1",children:[C.jsx("div",{className:"kiosk-typing-dot",style:{animationDelay:"0ms"}}),C.jsx("div",{className:"kiosk-typing-dot",style:{animationDelay:"200ms"}}),C.jsx("div",{className:"kiosk-typing-dot",style:{animationDelay:"400ms"}})]})})})}function uC(){const e=[{icon:"🍔",text:"Show menu"},{icon:"🛒",text:"Place order"},{icon:"⏰",text:"Store hours"},{icon:"❓",text:"Get help"}];return C.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center px-6",children:[C.jsx("div",{className:"text-6xl mb-4 animate-bounce-slow",children:"🤖"}),C.jsx("h2",{className:"text-2xl font-semibold text-intel-dark mb-2",children:"Welcome! I'm your kiosk assistant"}),C.jsx("p",{className:"text-kiosk-textmd mb-8 max-w-md",children:"Ask me anything about our menu, place an order, or get help"}),C.jsxs("div",{className:"mb-8",children:[C.jsx("p",{className:"text-xs text-kiosk-textlo uppercase tracking-wide font-medium mb-3",children:"Try asking:"}),C.jsx("div",{className:"grid grid-cols-2 gap-3",children:e.map((t,r)=>C.jsxs("div",{className:"flex items-center space-x-2 bg-white rounded-lg border border-kiosk-border px-4 py-3 text-sm text-kiosk-textmd hover:border-intel-blue hover:bg-kiosk-pane transition-all duration-150 cursor-pointer",children:[C.jsx("span",{className:"text-lg",children:t.icon}),C.jsx("span",{children:t.text})]},r))})]}),C.jsxs("p",{className:"text-xs text-kiosk-textlo flex items-center space-x-2",children:[C.jsx("span",{className:"text-lg",children:"🎤"}),C.jsx("span",{children:"Tap the microphone below to start speaking"})]})]})}function lC({messages:e,partialUser:t,partialAssistant:r,phase:n}){const a=W.useRef(null);W.useEffect(()=>{var d;(d=a.current)==null||d.scrollIntoView({behavior:"smooth",block:"end"})},[e,t,r]);const u=(n==="listening"||n==="processing")&&!!t,l=n==="processing"&&!!r,c=n==="processing"&&!r&&e.length>0,f=e.length===0&&!u&&!l;return C.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-4 space-y-3",children:[f?C.jsx(uC,{}):null,e.map((d,h)=>C.jsx(Id,{role:d.role,text:d.text,isLatest:h===e.length-1},h)),u?C.jsx(Id,{role:"user",text:t,streaming:!0}):null,l?C.jsx(Id,{role:"assistant",text:r,streaming:!0}):null,c?C.jsx(oC,{}):null,C.jsx("div",{ref:a})]})}function sC({phase:e,locked:t,onStart:r,onStop:n}){const a=e==="listening",u=e==="processing",l=t||u,c=()=>{l||(a?n():r())},f="relative flex items-center justify-center w-20 h-20 rounded-full text-3xl transition-all duration-200 shadow-lg focus:outline-none focus:ring-4",d=a?"bg-red-500 text-white kiosk-pulse-recording focus:ring-red-500/30 hover:bg-red-600":u?"bg-amber-500 text-white animate-spin-slow focus:ring-amber-500/30 cursor-wait":l?"bg-gray-300 text-gray-500 cursor-not-allowed opacity-50":"bg-intel-blue text-white hover:bg-intel-blue-dark hover:scale-105 focus:ring-intel-blue/30 active:scale-95",h=t?"Ingestion in progress...":u?"Processing...":a?"Recording... (tap to stop)":"Tap to speak",v=a?"text-red-500":u?"text-amber-500":l?"text-gray-400":"text-intel-blue";return C.jsxs("div",{className:"flex flex-col items-center space-y-3",children:[C.jsxs("button",{type:"button",className:`${f} ${d}`,onClick:c,disabled:l,"aria-pressed":a,"aria-label":a?"Stop recording":"Start recording",title:h,children:[u?C.jsxs("svg",{className:"w-8 h-8 animate-spin-slow",viewBox:"0 0 24 24",fill:"none",children:[C.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),C.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):a?C.jsx("svg",{className:"w-8 h-8",viewBox:"0 0 24 24",fill:"currentColor",children:C.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})}):C.jsxs("svg",{className:"w-8 h-8",viewBox:"0 0 24 24",fill:"currentColor",children:[C.jsx("path",{d:"M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"}),C.jsx("path",{d:"M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"})]}),a&&C.jsxs("div",{className:"absolute -bottom-1 flex items-end space-x-0.5 h-3",children:[C.jsx("div",{className:"kiosk-bar w-0.5 bg-white rounded-full"}),C.jsx("div",{className:"kiosk-bar w-0.5 bg-white rounded-full"}),C.jsx("div",{className:"kiosk-bar w-0.5 bg-white rounded-full"}),C.jsx("div",{className:"kiosk-bar w-0.5 bg-white rounded-full"})]})]}),C.jsx("div",{className:`text-sm font-medium ${v} transition-colors duration-200`,children:h})]})}function cC({phase:e,playbackState:t}){const r=t==="playing"||t==="queued";let n="",a=null,u="text-intel-blue";if(r)n="Assistant speaking...",a=C.jsxs("div",{className:"flex items-end gap-0.5 h-5","aria-hidden":!0,children:[C.jsx("span",{className:"kiosk-bar w-1 h-5 bg-intel-blue rounded-sm"}),C.jsx("span",{className:"kiosk-bar w-1 h-5 bg-intel-blue rounded-sm"}),C.jsx("span",{className:"kiosk-bar w-1 h-5 bg-intel-blue rounded-sm"}),C.jsx("span",{className:"kiosk-bar w-1 h-5 bg-intel-blue rounded-sm"})]});else if(e==="processing")n="Thinking...",u="text-amber-500",a=C.jsxs("svg",{className:"w-4 h-4 animate-spin-slow",viewBox:"0 0 24 24",fill:"none",children:[C.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),C.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]});else if(e==="listening")n="Listening...",u="text-red-500",a=C.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:[C.jsx("circle",{cx:"12",cy:"12",r:"3",className:"animate-pulse"}),C.jsx("circle",{cx:"12",cy:"12",r:"8",opacity:"0.3"})]});else return null;return C.jsxs("div",{className:`inline-flex items-center gap-2 px-3 py-2 rounded-full bg-white border border-gray-200 shadow-sm ${u} transition-all duration-200`,children:[a,C.jsx("span",{className:"text-xs font-medium",children:n})]})}const e1=[{id:"asr",label:"ASR",icon:"🎙",bg:"bg-asr-light",border:"border-asr",textColor:"text-asr-dark",glowColor:"rgba(234,88,12,0.4)"},{id:"retrieval",label:"Retrieval",icon:"🔍",bg:"bg-ret-light",border:"border-ret",textColor:"text-ret-dark",glowColor:"rgba(202,138,4,0.4)"},{id:"llm",label:"LLM",icon:"🧠",bg:"bg-llm-light",border:"border-llm",textColor:"text-llm-dark",glowColor:"rgba(8,145,178,0.4)"},{id:"tts",label:"TTS",icon:"🔊",bg:"bg-tts-light",border:"border-tts",textColor:"text-tts-dark",glowColor:"rgba(219,39,119,0.4)"}];function fC(e){var c,f,d;const t=((c=e.asr)==null?void 0:c.perf)??{},r=((f=e.rag)==null?void 0:f.perf)??{},n=r.retrieval??{},a=r.llm??{},u=((d=e.tts)==null?void 0:d.perf)??{},l=h=>typeof h=="number"?h:null;return{asrMs:l(t.last_ms),retrievalMs:l(n.last_ms),llmMs:l(a.last_ms),ttsMs:l(u.last_ms)}}function t1(e){return e===null?"—":e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(2)} s`}function dC(e){const t=String(e??"").toUpperCase();return t.includes("GPU")?{label:"GPU",cls:"bg-gpu-light text-gpu-dark border-gpu-muted"}:t.includes("NPU")?{label:"NPU",cls:"bg-npu-light text-npu-dark border-npu-muted"}:t.includes("CPU")?{label:"CPU",cls:"bg-cpu-light text-cpu-dark border-cpu-muted"}:null}function pC(e){return e==="listening"?"asr":e==="processing"?"retrieval":e==="speaking"?"tts":null}function hC({kpis:e,phase:t}){var f,d,h,v;const r=fC(e),n={asr:r.asrMs,retrieval:r.retrievalMs,llm:r.llmMs,tts:r.ttsMs},a={asr:(f=e.asr)==null?void 0:f.device,retrieval:(d=e.rag)==null?void 0:d.embedding_device,llm:(h=e.rag)==null?void 0:h.llm_device,tts:(v=e.tts)==null?void 0:v.device},u=pC(t),l=[r.asrMs,r.retrievalMs,r.llmMs,r.ttsMs].filter(m=>m!==null),c=l.length>0?l.reduce((m,x)=>m+x,0):null;return C.jsxs("div",{className:"space-y-3",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("h2",{className:"text-xs font-semibold uppercase tracking-widest text-dash-label",children:"AI Inference Pipeline"}),c!==null&&C.jsxs("span",{className:"rounded-full bg-intel-blue/10 px-2.5 py-0.5 text-[11px] font-semibold text-intel-blue",children:["E2E ",t1(c)]})]}),C.jsxs("div",{className:"flex items-stretch gap-0",children:[C.jsxs("div",{className:"flex flex-col items-center justify-center",children:[C.jsx("div",{className:`flex h-12 w-12 flex-col items-center justify-center rounded-full border-2 bg-dash-card shadow-sm transition-all duration-300 ${t==="listening"?"border-asr animate-stage-pulse shadow-asr/30 shadow-md":"border-dash-border"}`,children:C.jsx("span",{className:"text-lg",children:"🎤"})}),C.jsx("span",{className:"mt-1 text-[10px] text-dash-label",children:"Input"})]}),e1.map((m,x)=>{const S=u===m.id,w=n[m.id],b=dC(a[m.id]);return C.jsxs("div",{className:"flex flex-1 items-stretch",children:[C.jsx("div",{className:"flex items-center justify-center px-1",children:C.jsxs("svg",{width:"24",height:"12",viewBox:"0 0 24 12",className:"overflow-visible",children:[C.jsx("line",{x1:"0",y1:"6",x2:"18",y2:"6",stroke:S?"#0071c5":"#334155",strokeWidth:S?2.5:1.5,strokeDasharray:S?"4 2":void 0,style:S?{animation:"dash-flow 0.8s linear infinite"}:void 0}),C.jsx("polygon",{points:"18,2 24,6 18,10",fill:S?"#0071c5":"#334155"})]})}),C.jsxs("div",{className:` - relative flex flex-1 flex-col items-center justify-between rounded-lg border p-2 transition-all duration-300 - ${m.bg} ${m.border} - ${S?"animate-stage-pulse shadow-lg":"shadow-sm hover:shadow-md"} - `,style:S?{boxShadow:`0 0 16px 2px ${m.glowColor}`}:void 0,children:[b&&C.jsx("span",{className:`absolute -right-1 -top-2 rounded-full border px-1.5 py-0 text-[9px] font-bold ${b.cls}`,children:b.label}),C.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[C.jsx("span",{className:"text-base leading-none",children:m.icon}),C.jsx("span",{className:`text-[10px] font-semibold ${m.textColor}`,children:m.label})]}),C.jsx("div",{className:`mt-1 rounded-full px-1.5 py-0.5 text-[10px] font-mono font-semibold ${m.textColor} bg-white/60`,style:{animation:w!==null?"number-tick 0.25s ease-out":void 0},children:t1(w)},String(w)),S&&C.jsx("span",{className:"absolute -bottom-1 left-1/2 h-2 w-2 -translate-x-1/2 rounded-full bg-intel-blue shadow-sm"})]}),x===e1.length-1&&C.jsx("div",{className:"flex items-center justify-center px-1",children:C.jsxs("svg",{width:"24",height:"12",viewBox:"0 0 24 12",children:[C.jsx("line",{x1:"0",y1:"6",x2:"18",y2:"6",stroke:"#334155",strokeWidth:"1.5"}),C.jsx("polygon",{points:"18,2 24,6 18,10",fill:"#334155"})]})})]},m.id)}),C.jsxs("div",{className:"flex flex-col items-center justify-center",children:[C.jsx("div",{className:`flex h-12 w-12 flex-col items-center justify-center rounded-full border-2 bg-dash-card shadow-sm transition-all duration-300 ${t==="speaking"?"border-tts animate-stage-pulse shadow-tts/30 shadow-md":"border-dash-border"}`,children:C.jsx("span",{className:"text-lg",children:"🔊"})}),C.jsx("span",{className:"mt-1 text-[10px] text-dash-label",children:"Output"})]})]})]})}const Io=e=>e==null||e===""?"—":String(e),$d=e=>Io(e).split("/").pop()??"—",_o=e=>typeof e=="number"?e<1e3?`${Math.round(e)}`:`${(e/1e3).toFixed(2)}`:"—",Oo=e=>typeof e=="number"?e<1e3?"ms":"s":"";function Wl({icon:e,title:t,value:r,unit:n,sub:a,accentCls:u,valueCls:l,updated:c}){return C.jsxs("div",{className:` - relative flex flex-col rounded-xl border bg-dash-card p-4 transition-all duration-300 - ${u} - ${c?"animate-kpi-glow":""} - `,children:[C.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[C.jsx("span",{className:"text-xl leading-none",children:e}),C.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-widest text-dash-label",children:t})]}),C.jsxs("div",{className:"flex items-baseline gap-1",children:[C.jsx("span",{className:`text-4xl font-bold font-mono leading-none tracking-tight ${l}`,style:{animation:r!=="—"?"number-tick 0.25s ease-out":void 0},children:r},r),n&&C.jsx("span",{className:`text-base font-semibold ${l} opacity-70`,children:n})]}),C.jsx("p",{className:"mt-2 text-[11px] leading-snug text-dash-label",children:a})]})}function vC({kpis:e}){var w,b,P,E,j,T,_,O,k,N;const t=((w=e.asr)==null?void 0:w.perf)??{},r=((b=e.rag)==null?void 0:b.perf)??{},n=r.retrieval??{},a=r.llm??{},u=((P=e.tts)==null?void 0:P.perf)??{},l=[t.last_ms,n.last_ms,a.last_ms,u.last_ms].filter($=>typeof $=="number"),c=l.length>0?l.reduce(($,X)=>$+X,0):null,f=Io((E=e.asr)==null?void 0:E.device).toUpperCase()||"—",d=Io((j=e.rag)==null?void 0:j.llm_device).toUpperCase()||"—",h=Io((T=e.tts)==null?void 0:T.device).toUpperCase()||"—",v=$d((_=e.asr)==null?void 0:_.model),m=$d((O=e.rag)==null?void 0:O.llm_model),x=$d((k=e.tts)==null?void 0:k.model),S=l.length>0;return C.jsxs("div",{className:"space-y-2",children:[C.jsx("h2",{className:"text-xs font-semibold uppercase tracking-widest text-dash-label",children:"Performance KPIs"}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsx(Wl,{icon:"⚡",title:"E2E Latency",value:_o(c),unit:Oo(c),sub:"Full pipeline round-trip",accentCls:"border-intel-blue/40",valueCls:"text-intel-blue",updated:S}),C.jsx(Wl,{icon:"🎙",title:"ASR Speed",value:_o(t.last_ms),unit:Oo(t.last_ms),sub:`${v} · ${f}`,accentCls:"border-asr/40",valueCls:"text-asr",updated:typeof t.last_ms=="number"}),C.jsx(Wl,{icon:"🧠",title:"LLM Latency",value:_o(a.last_ms),unit:Oo(a.last_ms),sub:`${m} · ${d}`,accentCls:"border-llm/40",valueCls:"text-llm",updated:typeof a.last_ms=="number"}),C.jsx(Wl,{icon:"🔊",title:"TTS Speed",value:_o(u.last_ms),unit:Oo(u.last_ms),sub:`${x} · ${h}`,accentCls:"border-tts/40",valueCls:"text-tts",updated:typeof u.last_ms=="number"})]}),C.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[C.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-ret/30 bg-dash-card px-3 py-2",children:[C.jsx("span",{className:"text-lg",children:"🔍"}),C.jsxs("div",{className:"min-w-0",children:[C.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-dash-label",children:"Retrieval"}),C.jsxs("p",{className:"font-mono text-lg font-bold text-ret",children:[_o(n.last_ms),C.jsx("span",{className:"ml-1 text-xs font-normal opacity-70",children:Oo(n.last_ms)})]})]})]}),C.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-gpu/30 bg-dash-card px-3 py-2",children:[C.jsx("span",{className:"text-lg",children:"📚"}),C.jsxs("div",{className:"min-w-0",children:[C.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-wider text-dash-label",children:"Docs Indexed"}),C.jsx("p",{className:"font-mono text-lg font-bold text-gpu",children:Io((N=e.rag)==null?void 0:N.document_count)})]})]})]})]})}function FA(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t-1}return dp=t,dp}var pp,N1;function MC(){if(N1)return pp;N1=1;var e=uc();function t(r,n){var a=this.__data__,u=e(a,r);return u<0?(++this.size,a.push([r,n])):a[u][1]=n,this}return pp=t,pp}var hp,I1;function lc(){if(I1)return hp;I1=1;var e=jC(),t=TC(),r=kC(),n=CC(),a=MC();function u(l){var c=-1,f=l==null?0:l.length;for(this.clear();++c0?1:-1},ai=function(t){return pi(t)&&t.indexOf("%")===t.length-1},se=function(t){return tM(t)&&!ja(t)},rM=function(t){return Ce(t)},dt=function(t){return se(t)||pi(t)},nM=0,Eu=function(t){var r=++nM;return"".concat(t||"").concat(r)},hi=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!se(t)&&!pi(t))return n;var u;if(ai(t)){var l=t.indexOf("%");u=r*parseFloat(t.slice(0,l))/100}else u=+t;return ja(u)&&(u=n),a&&u>r&&(u=r),u},Mn=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},iM=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function fM(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 By(e){"@babel/helpers - typeof";return By=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},By(e)}var lw={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"},en=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},sw=null,qp=null,sg=function e(t){if(t===sw&&Array.isArray(qp))return qp;var r=[];return W.Children.forEach(t,function(n){Ce(n)||(QC.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),qp=r,sw=t,r};function Pr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(a){return en(a)}):n=[en(t)],sg(e).forEach(function(a){var u=sr(a,"type.displayName")||sr(a,"type.name");n.indexOf(u)!==-1&&r.push(a)}),r}function Xt(e,t){var r=Pr(e,t);return r&&r[0]}var cw=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,a=r.height;return!(!se(n)||n<=0||!se(a)||a<=0)},dM=["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"],pM=function(t){return t&&t.type&&pi(t.type)&&dM.indexOf(t.type)>=0},hM=function(t){return t&&By(t)==="object"&&"clipDot"in t},vM=function(t,r,n,a){var u,l=(u=Bp==null?void 0:Bp[a])!==null&&u!==void 0?u:[];return r.startsWith("data-")||!Ae(t)&&(a&&l.includes(r)||uM.includes(r))||n&&lg.includes(r)},ke=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(W.isValidElement(t)&&(a=t.props),!Ea(a))return null;var u={};return Object.keys(a).forEach(function(l){var c;vM((c=a)===null||c===void 0?void 0:c[l],l,r,n)&&(u[l]=a[l])}),u},qy=function e(t,r){if(t===r)return!0;var n=W.Children.count(t);if(n!==W.Children.count(r))return!1;if(n===0)return!0;if(n===1)return fw(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function xM(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,a=e.viewBox,u=e.className,l=e.style,c=e.title,f=e.desc,d=bM(e,gM),h=a||{width:r,height:n,x:0,y:0},v=Ne("recharts-surface",u);return B.createElement("svg",zy({},ke(d,!0,"svg"),{className:v,width:r,height:n,style:l,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),B.createElement("title",null,c),B.createElement("desc",null,f),t)}var wM=["children","className"];function Uy(){return Uy=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 _M(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 Ze=B.forwardRef(function(e,t){var r=e.children,n=e.className,a=SM(e,wM),u=Ne("recharts-layer",n);return B.createElement("g",Uy({className:u},ke(a,!0),{ref:t}),r)}),tn=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),u=2;uu?0:u+r),n=n>u?u:n,n<0&&(n+=u),u=r>n?0:n-r>>>0,r>>>=0;for(var l=Array(u);++a=u?r:e(r,n,a)}return Fp=t,Fp}var Up,vw;function YA(){if(vw)return Up;vw=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,u="\\ufe0e\\ufe0f",l="\\u200d",c=RegExp("["+l+e+a+u+"]");function f(d){return c.test(d)}return Up=f,Up}var Wp,yw;function AM(){if(yw)return Wp;yw=1;function e(t){return t.split("")}return Wp=e,Wp}var Hp,mw;function EM(){if(mw)return Hp;mw=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=t+r+n,u="\\ufe0e\\ufe0f",l="["+e+"]",c="["+a+"]",f="\\ud83c[\\udffb-\\udfff]",d="(?:"+c+"|"+f+")",h="[^"+e+"]",v="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",x="\\u200d",S=d+"?",w="["+u+"]?",b="(?:"+x+"(?:"+[h,v,m].join("|")+")"+w+S+")*",P=w+S+b,E="(?:"+[h+c+"?",c,v,m,l].join("|")+")",j=RegExp(f+"(?="+f+")|"+E+P,"g");function T(_){return _.match(j)||[]}return Hp=T,Hp}var Vp,gw;function jM(){if(gw)return Vp;gw=1;var e=AM(),t=YA(),r=EM();function n(a){return t(a)?r(a):e(a)}return Vp=n,Vp}var Kp,bw;function TM(){if(bw)return Kp;bw=1;var e=PM(),t=YA(),r=jM(),n=VA();function a(u){return function(l){l=n(l);var c=t(l)?r(l):void 0,f=c?c[0]:l.charAt(0),d=c?e(c,1).join(""):l.slice(1);return f[u]()+d}}return Kp=a,Kp}var Gp,xw;function kM(){if(xw)return Gp;xw=1;var e=TM(),t=e("toUpperCase");return Gp=t,Gp}var CM=kM();const fc=Fe(CM);function We(e){return function(){return e}}const QA=Math.cos,fs=Math.sin,Ar=Math.sqrt,ds=Math.PI,dc=2*ds,Wy=Math.PI,Hy=2*Wy,ni=1e-6,MM=Hy-ni;function ZA(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return ZA;const r=10**t;return function(n){this._+=n[0];for(let a=1,u=n.length;ani)if(!(Math.abs(v*f-d*h)>ni)||!u)this._append`L${this._x1=t},${this._y1=r}`;else{let x=n-l,S=a-c,w=f*f+d*d,b=x*x+S*S,P=Math.sqrt(w),E=Math.sqrt(m),j=u*Math.tan((Wy-Math.acos((w+m-b)/(2*P*E)))/2),T=j/E,_=j/P;Math.abs(T-1)>ni&&this._append`L${t+T*h},${r+T*v}`,this._append`A${u},${u},0,0,${+(v*x>h*S)},${this._x1=t+_*f},${this._y1=r+_*d}`}}arc(t,r,n,a,u,l){if(t=+t,r=+r,n=+n,l=!!l,n<0)throw new Error(`negative radius: ${n}`);let c=n*Math.cos(a),f=n*Math.sin(a),d=t+c,h=r+f,v=1^l,m=l?a-u:u-a;this._x1===null?this._append`M${d},${h}`:(Math.abs(this._x1-d)>ni||Math.abs(this._y1-h)>ni)&&this._append`L${d},${h}`,n&&(m<0&&(m=m%Hy+Hy),m>MM?this._append`A${n},${n},0,1,${v},${t-c},${r-f}A${n},${n},0,1,${v},${this._x1=d},${this._y1=h}`:m>ni&&this._append`A${n},${n},0,${+(m>=Wy)},${v},${this._x1=t+n*Math.cos(u)},${this._y1=r+n*Math.sin(u)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function cg(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 IM(t)}function fg(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function JA(e){this._context=e}JA.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 pc(e){return new JA(e)}function eE(e){return e[0]}function tE(e){return e[1]}function rE(e,t){var r=We(!0),n=null,a=pc,u=null,l=cg(c);e=typeof e=="function"?e:e===void 0?eE:We(e),t=typeof t=="function"?t:t===void 0?tE:We(t);function c(f){var d,h=(f=fg(f)).length,v,m=!1,x;for(n==null&&(u=a(x=l())),d=0;d<=h;++d)!(d=x;--S)c.point(j[S],T[S]);c.lineEnd(),c.areaEnd()}P&&(j[m]=+e(b,m,v),T[m]=+t(b,m,v),c.point(n?+n(b,m,v):j[m],r?+r(b,m,v):T[m]))}if(E)return c=null,E+""||null}function h(){return rE().defined(a).curve(l).context(u)}return d.x=function(v){return arguments.length?(e=typeof v=="function"?v:We(+v),n=null,d):e},d.x0=function(v){return arguments.length?(e=typeof v=="function"?v:We(+v),d):e},d.x1=function(v){return arguments.length?(n=v==null?null:typeof v=="function"?v:We(+v),d):n},d.y=function(v){return arguments.length?(t=typeof v=="function"?v:We(+v),r=null,d):t},d.y0=function(v){return arguments.length?(t=typeof v=="function"?v:We(+v),d):t},d.y1=function(v){return arguments.length?(r=v==null?null:typeof v=="function"?v:We(+v),d):r},d.lineX0=d.lineY0=function(){return h().x(e).y(t)},d.lineY1=function(){return h().x(e).y(r)},d.lineX1=function(){return h().x(n).y(t)},d.defined=function(v){return arguments.length?(a=typeof v=="function"?v:We(!!v),d):a},d.curve=function(v){return arguments.length?(l=v,u!=null&&(c=l(u)),d):l},d.context=function(v){return arguments.length?(v==null?u=c=null:c=l(u=v),d):u},d}class nE{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 $M(e){return new nE(e,!0)}function RM(e){return new nE(e,!1)}const dg={draw(e,t){const r=Ar(t/ds);e.moveTo(r,0),e.arc(0,0,r,0,dc)}},DM={draw(e,t){const r=Ar(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()}},iE=Ar(1/3),LM=iE*2,BM={draw(e,t){const r=Ar(t/LM),n=r*iE;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},qM={draw(e,t){const r=Ar(t),n=-r/2;e.rect(n,n,r,r)}},zM=.8908130915292852,aE=fs(ds/10)/fs(7*ds/10),FM=fs(dc/10)*aE,UM=-QA(dc/10)*aE,WM={draw(e,t){const r=Ar(t*zM),n=FM*r,a=UM*r;e.moveTo(0,-r),e.lineTo(n,a);for(let u=1;u<5;++u){const l=dc*u/5,c=QA(l),f=fs(l);e.lineTo(f*r,-c*r),e.lineTo(c*n-f*a,f*n+c*a)}e.closePath()}},Xp=Ar(3),HM={draw(e,t){const r=-Ar(t/(Xp*3));e.moveTo(0,r*2),e.lineTo(-Xp*r,-r),e.lineTo(Xp*r,-r),e.closePath()}},ir=-.5,ar=Ar(3)/2,Vy=1/Ar(12),VM=(Vy/2+1)*3,KM={draw(e,t){const r=Ar(t/VM),n=r/2,a=r*Vy,u=n,l=r*Vy+r,c=-u,f=l;e.moveTo(n,a),e.lineTo(u,l),e.lineTo(c,f),e.lineTo(ir*n-ar*a,ar*n+ir*a),e.lineTo(ir*u-ar*l,ar*u+ir*l),e.lineTo(ir*c-ar*f,ar*c+ir*f),e.lineTo(ir*n+ar*a,ir*a-ar*n),e.lineTo(ir*u+ar*l,ir*l-ar*u),e.lineTo(ir*c+ar*f,ir*f-ar*c),e.closePath()}};function GM(e,t){let r=null,n=cg(a);e=typeof e=="function"?e:We(e||dg),t=typeof t=="function"?t:We(t===void 0?64:+t);function a(){let u;if(r||(r=u=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),u)return r=null,u+""||null}return a.type=function(u){return arguments.length?(e=typeof u=="function"?u:We(u),a):e},a.size=function(u){return arguments.length?(t=typeof u=="function"?u:We(+u),a):t},a.context=function(u){return arguments.length?(r=u??null,a):r},a}function ps(){}function hs(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 oE(e){this._context=e}oE.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:hs(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:hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function XM(e){return new oE(e)}function uE(e){this._context=e}uE.prototype={areaStart:ps,areaEnd:ps,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:hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function YM(e){return new uE(e)}function lE(e){this._context=e}lE.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:hs(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function QM(e){return new lE(e)}function sE(e){this._context=e}sE.prototype={areaStart:ps,areaEnd:ps,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 ZM(e){return new sE(e)}function ww(e){return e<0?-1:1}function Sw(e,t,r){var n=e._x1-e._x0,a=t-e._x1,u=(e._y1-e._y0)/(n||a<0&&-0),l=(r-e._y1)/(a||n<0&&-0),c=(u*a+l*n)/(n+a);return(ww(u)+ww(l))*Math.min(Math.abs(u),Math.abs(l),.5*Math.abs(c))||0}function _w(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Yp(e,t,r){var n=e._x0,a=e._y0,u=e._x1,l=e._y1,c=(u-n)/3;e._context.bezierCurveTo(n+c,a+c*t,u-c,l-c*r,u,l)}function vs(e){this._context=e}vs.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:Yp(this,this._t0,_w(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,Yp(this,_w(this,r=Sw(this,e,t)),r);break;default:Yp(this,this._t0,r=Sw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function cE(e){this._context=new fE(e)}(cE.prototype=Object.create(vs.prototype)).point=function(e,t){vs.prototype.point.call(this,t,e)};function fE(e){this._context=e}fE.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,a,u){this._context.bezierCurveTo(t,e,n,r,u,a)}};function JM(e){return new vs(e)}function eN(e){return new cE(e)}function dE(e){this._context=e}dE.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=Ow(e),a=Ow(t),u=0,l=1;l=0;--t)a[t]=(l[t]-a[t+1])/u[t];for(u[r-1]=(e[r]+a[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 rN(e){return new hc(e,.5)}function nN(e){return new hc(e,0)}function iN(e){return new hc(e,1)}function ia(e,t){if((l=e.length)>1)for(var r=1,n,a,u=e[t[0]],l,c=u.length;r=0;)r[t]=t;return r}function aN(e,t){return e[t]}function oN(e){const t=[];return t.key=e,t}function uN(){var e=We([]),t=Ky,r=ia,n=aN;function a(u){var l=Array.from(e.apply(this,arguments),oN),c,f=l.length,d=-1,h;for(const v of u)for(c=0,++d;c0){for(var r,n,a=0,u=e[0].length,l;a0){for(var r=0,n=e[t[0]],a,u=n.length;r0)||!((u=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,u,l;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function yN(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 pE={symbolCircle:dg,symbolCross:DM,symbolDiamond:BM,symbolSquare:qM,symbolStar:WM,symbolTriangle:HM,symbolWye:KM},mN=Math.PI/180,gN=function(t){var r="symbol".concat(fc(t));return pE[r]||dg},bN=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 a=18*mN;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),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}},xN=function(t,r){pE["symbol".concat(fc(t))]=r},pg=function(t){var r=t.type,n=r===void 0?"circle":r,a=t.size,u=a===void 0?64:a,l=t.sizeType,c=l===void 0?"area":l,f=vN(t,fN),d=Aw(Aw({},f),{},{type:n,size:u,sizeType:c}),h=function(){var b=gN(n),P=GM().type(b).size(bN(u,c,n));return P()},v=d.className,m=d.cx,x=d.cy,S=ke(d,!0);return m===+m&&x===+x&&u===+u?B.createElement("path",Gy({},S,{className:Ne("recharts-symbols",v),transform:"translate(".concat(m,", ").concat(x,")"),d:h()})):null};pg.registerSymbol=xN;function aa(e){"@babel/helpers - typeof";return aa=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},aa(e)}function Xy(){return Xy=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var E=x.inactive?d:x.color;return B.createElement("li",Xy({className:b,style:v,key:"legend-item-".concat(S)},cs(n.props,x,S)),B.createElement(Fy,{width:l,height:l,viewBox:h,style:m},n.renderIcon(x)),B.createElement("span",{className:"recharts-legend-item-text",style:{color:E}},w?w(P,x,S):P))})}},{key:"render",value:function(){var n=this.props,a=n.payload,u=n.layout,l=n.align;if(!a||!a.length)return null;var c={padding:0,margin:0,textAlign:u==="horizontal"?l:"left"};return B.createElement("ul",{className:"recharts-default-legend",style:c},this.renderItems())}}])})(W.PureComponent);Wo(hg,"displayName","Legend");Wo(hg,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Qp,jw;function kN(){if(jw)return Qp;jw=1;var e=lc();function t(){this.__data__=new e,this.size=0}return Qp=t,Qp}var Zp,Tw;function CN(){if(Tw)return Zp;Tw=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Zp=e,Zp}var Jp,kw;function MN(){if(kw)return Jp;kw=1;function e(t){return this.__data__.get(t)}return Jp=e,Jp}var eh,Cw;function NN(){if(Cw)return eh;Cw=1;function e(t){return this.__data__.has(t)}return eh=e,eh}var th,Mw;function IN(){if(Mw)return th;Mw=1;var e=lc(),t=ig(),r=ag(),n=200;function a(u,l){var c=this.__data__;if(c instanceof e){var f=c.__data__;if(!t||f.lengthx))return!1;var w=v.get(l),b=v.get(c);if(w&&b)return w==c&&b==l;var P=-1,E=!0,j=f&a?new e:void 0;for(v.set(l,c),v.set(c,l);++P-1&&n%1==0&&n-1&&r%1==0&&r<=e}return _h=t,_h}var Oh,rS;function KN(){if(rS)return Oh;rS=1;var e=ln(),t=gg(),r=sn(),n="[object Arguments]",a="[object Array]",u="[object Boolean]",l="[object Date]",c="[object Error]",f="[object Function]",d="[object Map]",h="[object Number]",v="[object Object]",m="[object RegExp]",x="[object Set]",S="[object String]",w="[object WeakMap]",b="[object ArrayBuffer]",P="[object DataView]",E="[object Float32Array]",j="[object Float64Array]",T="[object Int8Array]",_="[object Int16Array]",O="[object Int32Array]",k="[object Uint8Array]",N="[object Uint8ClampedArray]",$="[object Uint16Array]",X="[object Uint32Array]",q={};q[E]=q[j]=q[T]=q[_]=q[O]=q[k]=q[N]=q[$]=q[X]=!0,q[n]=q[a]=q[b]=q[u]=q[P]=q[l]=q[c]=q[f]=q[d]=q[h]=q[v]=q[m]=q[x]=q[S]=q[w]=!1;function L(H){return r(H)&&t(H.length)&&!!q[e(H)]}return Oh=L,Oh}var Ph,nS;function _E(){if(nS)return Ph;nS=1;function e(t){return function(r){return t(r)}}return Ph=e,Ph}var Ro={exports:{}};Ro.exports;var iS;function GN(){return iS||(iS=1,(function(e,t){var r=UA(),n=t&&!t.nodeType&&t,a=n&&!0&&e&&!e.nodeType&&e,u=a&&a.exports===n,l=u&&r.process,c=(function(){try{var f=a&&a.require&&a.require("util").types;return f||l&&l.binding&&l.binding("util")}catch{}})();e.exports=c})(Ro,Ro.exports)),Ro.exports}var Ah,aS;function OE(){if(aS)return Ah;aS=1;var e=KN(),t=_E(),r=GN(),n=r&&r.isTypedArray,a=n?t(n):e;return Ah=a,Ah}var Eh,oS;function XN(){if(oS)return Eh;oS=1;var e=WN(),t=yg(),r=Ut(),n=SE(),a=mg(),u=OE(),l=Object.prototype,c=l.hasOwnProperty;function f(d,h){var v=r(d),m=!v&&t(d),x=!v&&!m&&n(d),S=!v&&!m&&!x&&u(d),w=v||m||x||S,b=w?e(d.length,String):[],P=b.length;for(var E in d)(h||c.call(d,E))&&!(w&&(E=="length"||x&&(E=="offset"||E=="parent")||S&&(E=="buffer"||E=="byteLength"||E=="byteOffset")||a(E,P)))&&b.push(E);return b}return Eh=f,Eh}var jh,uS;function YN(){if(uS)return jh;uS=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||e;return r===a}return jh=t,jh}var Th,lS;function PE(){if(lS)return Th;lS=1;function e(t,r){return function(n){return t(r(n))}}return Th=e,Th}var kh,sS;function QN(){if(sS)return kh;sS=1;var e=PE(),t=e(Object.keys,Object);return kh=t,kh}var Ch,cS;function ZN(){if(cS)return Ch;cS=1;var e=YN(),t=QN(),r=Object.prototype,n=r.hasOwnProperty;function a(u){if(!e(u))return t(u);var l=[];for(var c in Object(u))n.call(u,c)&&c!="constructor"&&l.push(c);return l}return Ch=a,Ch}var Mh,fS;function ju(){if(fS)return Mh;fS=1;var e=rg(),t=gg();function r(n){return n!=null&&t(n.length)&&!e(n)}return Mh=r,Mh}var Nh,dS;function vc(){if(dS)return Nh;dS=1;var e=XN(),t=ZN(),r=ju();function n(a){return r(a)?e(a):t(a)}return Nh=n,Nh}var Ih,pS;function JN(){if(pS)return Ih;pS=1;var e=qN(),t=UN(),r=vc();function n(a){return e(a,r,t)}return Ih=n,Ih}var $h,hS;function eI(){if(hS)return $h;hS=1;var e=JN(),t=1,r=Object.prototype,n=r.hasOwnProperty;function a(u,l,c,f,d,h){var v=c&t,m=e(u),x=m.length,S=e(l),w=S.length;if(x!=w&&!v)return!1;for(var b=x;b--;){var P=m[b];if(!(v?P in l:n.call(l,P)))return!1}var E=h.get(u),j=h.get(l);if(E&&j)return E==l&&j==u;var T=!0;h.set(u,l),h.set(l,u);for(var _=v;++b-1}return uv=t,uv}var lv,zS;function xI(){if(zS)return lv;zS=1;function e(t,r,n){for(var a=-1,u=t==null?0:t.length;++a=l){var P=d?null:a(f);if(P)return u(P);S=!1,m=n,b=new e}else b=d?[]:w;e:for(;++v=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $I(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 RI(e){return e.value}function DI(e,t){if(B.isValidElement(e))return B.cloneElement(e,t);if(typeof e=="function")return B.createElement(e,t);t.ref;var r=II(t,AI);return B.createElement(hg,r)}var XS=1,ta=(function(e){function t(){var r;EI(this,t);for(var n=arguments.length,a=new Array(n),u=0;uXS||Math.abs(a.height-this.lastBoundingBox.height)>XS)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(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?Xr({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,u=a.layout,l=a.align,c=a.verticalAlign,f=a.margin,d=a.chartWidth,h=a.chartHeight,v,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(l==="center"&&u==="vertical"){var x=this.getBBoxSnapshot();v={left:((d||0)-x.width)/2}}else v=l==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(c==="middle"){var S=this.getBBoxSnapshot();m={top:((h||0)-S.height)/2}}else m=c==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return Xr(Xr({},v),m)}},{key:"render",value:function(){var n=this,a=this.props,u=a.content,l=a.width,c=a.height,f=a.wrapperStyle,d=a.payloadUniqBy,h=a.payload,v=Xr(Xr({position:"absolute",width:l||"auto",height:c||"auto"},this.getDefaultPosition(f)),f);return B.createElement("div",{className:"recharts-legend-wrapper",style:v,ref:function(x){n.wrapperNode=x}},DI(u,Xr(Xr({},this.props),{},{payload:kE(h,d,RI)})))}}],[{key:"getWithHeight",value:function(n,a){var u=Xr(Xr({},this.defaultProps),n.props),l=u.layout;return l==="vertical"&&se(n.props.height)?{height:n.props.height}:l==="horizontal"?{width:n.props.width||a}:null}}])})(W.PureComponent);yc(ta,"displayName","Legend");yc(ta,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var pv,YS;function LI(){if(YS)return pv;YS=1;var e=Au(),t=yg(),r=Ut(),n=e?e.isConcatSpreadable:void 0;function a(u){return r(u)||t(u)||!!(n&&u&&u[n])}return pv=a,pv}var hv,QS;function NE(){if(QS)return hv;QS=1;var e=wE(),t=LI();function r(n,a,u,l,c){var f=-1,d=n.length;for(u||(u=t),c||(c=[]);++f0&&u(h)?a>1?r(h,a-1,u,l,c):e(c,h):l||(c[c.length]=h)}return c}return hv=r,hv}var vv,ZS;function BI(){if(ZS)return vv;ZS=1;function e(t){return function(r,n,a){for(var u=-1,l=Object(r),c=a(r),f=c.length;f--;){var d=c[t?f:++u];if(n(l[d],d,l)===!1)break}return r}}return vv=e,vv}var yv,JS;function qI(){if(JS)return yv;JS=1;var e=BI(),t=e();return yv=t,yv}var mv,e_;function IE(){if(e_)return mv;e_=1;var e=qI(),t=vc();function r(n,a){return n&&e(n,a,t)}return mv=r,mv}var gv,t_;function zI(){if(t_)return gv;t_=1;var e=ju();function t(r,n){return function(a,u){if(a==null)return a;if(!e(a))return r(a,u);for(var l=a.length,c=n?l:-1,f=Object(a);(n?c--:++cn||c&&f&&h&&!d&&!v||u&&f&&h||!a&&h||!l)return 1;if(!u&&!c&&!v&&r=d)return h;var v=a[u];return h*(v=="desc"?-1:1)}}return r.index-n.index}return _v=t,_v}var Ov,u_;function HI(){if(u_)return Ov;u_=1;var e=og(),t=ug(),r=Ln(),n=$E(),a=FI(),u=_E(),l=WI(),c=Ta(),f=Ut();function d(h,v,m){v.length?v=e(v,function(w){return f(w)?function(b){return t(b,w.length===1?w[0]:w)}:w}):v=[c];var x=-1;v=e(v,u(r));var S=n(h,function(w,b,P){var E=e(v,function(j){return j(w)});return{criteria:E,index:++x,value:w}});return a(S,function(w,b){return l(w,b,m)})}return Ov=d,Ov}var Pv,l_;function VI(){if(l_)return Pv;l_=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return Pv=e,Pv}var Av,s_;function KI(){if(s_)return Av;s_=1;var e=VI(),t=Math.max;function r(n,a,u){return a=t(a===void 0?n.length-1:a,0),function(){for(var l=arguments,c=-1,f=t(l.length-a,0),d=Array(f);++c0){if(++u>=e)return arguments[0]}else u=0;return a.apply(void 0,arguments)}}return kv=n,kv}var Cv,h_;function QI(){if(h_)return Cv;h_=1;var e=XI(),t=YI(),r=t(e);return Cv=r,Cv}var Mv,v_;function ZI(){if(v_)return Mv;v_=1;var e=Ta(),t=KI(),r=QI();function n(a,u){return r(t(a,u,e),a+"")}return Mv=n,Mv}var Nv,y_;function mc(){if(y_)return Nv;y_=1;var e=ng(),t=ju(),r=mg(),n=Dn();function a(u,l,c){if(!n(c))return!1;var f=typeof l;return(f=="number"?t(c)&&r(l,c.length):f=="string"&&l in c)?e(c[l],u):!1}return Nv=a,Nv}var Iv,m_;function JI(){if(m_)return Iv;m_=1;var e=NE(),t=HI(),r=ZI(),n=mc(),a=r(function(u,l){if(u==null)return[];var c=l.length;return c>1&&n(u,l[0],l[1])?l=[]:c>2&&n(l[0],l[1],l[2])&&(l=[l[0]]),t(u,e(l,1),[])});return Iv=a,Iv}var e$=JI();const wg=Fe(e$);function Ho(e){"@babel/helpers - typeof";return Ho=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},Ho(e)}function Zy(){return Zy=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(Po,"-left"),se(r)&&t&&se(t.x)&&r=t.y),"".concat(Po,"-top"),se(n)&&t&&se(t.y)&&nw?Math.max(h,f[n]):Math.max(v,f[n])}function v$(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 y$(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,a=e.position,u=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,f=e.viewBox,d,h,v;return l.height>0&&l.width>0&&r?(h=x_({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:u,tooltipDimension:l.width,viewBox:f,viewBoxDimension:f.width}),v=x_({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:u,tooltipDimension:l.height,viewBox:f,viewBoxDimension:f.height}),d=v$({translateX:h,translateY:v,useTranslate3d:c})):d=p$,{cssProperties:d,cssClasses:h$({translateX:h,translateY:v,coordinate:r})}}function ua(e){"@babel/helpers - typeof";return ua=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},ua(e)}function w_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function S_(e){for(var t=1;t__||Math.abs(n.height-this.state.lastBoundingBox.height)>__)&&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,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,u=a.active,l=a.allowEscapeViewBox,c=a.animationDuration,f=a.animationEasing,d=a.children,h=a.coordinate,v=a.hasPayload,m=a.isAnimationActive,x=a.offset,S=a.position,w=a.reverseDirection,b=a.useTranslate3d,P=a.viewBox,E=a.wrapperStyle,j=y$({allowEscapeViewBox:l,coordinate:h,offsetTopLeft:x,position:S,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:b,viewBox:P}),T=j.cssClasses,_=j.cssProperties,O=S_(S_({transition:m&&u?"transform ".concat(c,"ms ").concat(f):void 0},_),{},{pointerEvents:"none",visibility:!this.state.dismissed&&u&&v?"visible":"hidden",position:"absolute",top:0,left:0},E);return B.createElement("div",{tabIndex:-1,className:T,style:O,ref:function(N){n.wrapperNode=N}},d)}}])})(W.PureComponent),A$=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ka={isSsr:A$()};function la(e){"@babel/helpers - typeof";return la=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},la(e)}function O_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function P_(e){for(var t=1;t0;return B.createElement(P$,{allowEscapeViewBox:l,animationDuration:c,animationEasing:f,isAnimationActive:m,active:u,coordinate:h,hasPayload:O,offset:x,position:b,reverseDirection:P,useTranslate3d:E,viewBox:j,wrapperStyle:T},R$(d,P_(P_({},this.props),{},{payload:_})))}}])})(W.PureComponent);Sg(Ir,"displayName","Tooltip");Sg(Ir,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ka.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 Rv,A_;function D$(){if(A_)return Rv;A_=1;var e=qr(),t=function(){return e.Date.now()};return Rv=t,Rv}var Dv,E_;function L$(){if(E_)return Dv;E_=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Dv=t,Dv}var Lv,j_;function B$(){if(j_)return Lv;j_=1;var e=L$(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Lv=r,Lv}var Bv,T_;function zE(){if(T_)return Bv;T_=1;var e=B$(),t=Dn(),r=Aa(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;function f(d){if(typeof d=="number")return d;if(r(d))return n;if(t(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=t(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=e(d);var v=u.test(d);return v||l.test(d)?c(d.slice(2),v?2:8):a.test(d)?n:+d}return Bv=f,Bv}var qv,k_;function q$(){if(k_)return qv;k_=1;var e=Dn(),t=D$(),r=zE(),n="Expected a function",a=Math.max,u=Math.min;function l(c,f,d){var h,v,m,x,S,w,b=0,P=!1,E=!1,j=!0;if(typeof c!="function")throw new TypeError(n);f=r(f)||0,e(d)&&(P=!!d.leading,E="maxWait"in d,m=E?a(r(d.maxWait)||0,f):m,j="trailing"in d?!!d.trailing:j);function T(H){var Y=h,Q=v;return h=v=void 0,b=H,x=c.apply(Q,Y),x}function _(H){return b=H,S=setTimeout(N,f),P?T(H):x}function O(H){var Y=H-w,Q=H-b,J=f-Y;return E?u(J,m-Q):J}function k(H){var Y=H-w,Q=H-b;return w===void 0||Y>=f||Y<0||E&&Q>=m}function N(){var H=t();if(k(H))return $(H);S=setTimeout(N,O(H))}function $(H){return S=void 0,j&&h?T(H):(h=v=void 0,x)}function X(){S!==void 0&&clearTimeout(S),b=0,h=w=v=S=void 0}function q(){return S===void 0?x:$(t())}function L(){var H=t(),Y=k(H);if(h=arguments,v=this,w=H,Y){if(S===void 0)return _(w);if(E)return clearTimeout(S),S=setTimeout(N,f),T(w)}return S===void 0&&(S=setTimeout(N,f)),x}return L.cancel=X,L.flush=q,L}return qv=l,qv}var zv,C_;function z$(){if(C_)return zv;C_=1;var e=q$(),t=Dn(),r="Expected a function";function n(a,u,l){var c=!0,f=!0;if(typeof a!="function")throw new TypeError(r);return t(l)&&(c="leading"in l?!!l.leading:c,f="trailing"in l?!!l.trailing:f),e(a,u,{leading:c,maxWait:u,trailing:f})}return zv=n,zv}var F$=z$();const FE=Fe(F$);function Ko(e){"@babel/helpers - typeof";return Ko=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},Ko(e)}function M_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Kl(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(H=FE(H,w,{trailing:!0,leading:!1}));var Y=new ResizeObserver(H),Q=_.current.getBoundingClientRect(),J=Q.width,te=Q.height;return q(J,te),Y.observe(_.current),function(){Y.disconnect()}},[q,w]);var L=W.useMemo(function(){var H=$.containerWidth,Y=$.containerHeight;if(H<0||Y<0)return null;tn(ai(l)||ai(f),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,l,f),tn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var Q=ai(l)?H:l,J=ai(f)?Y:f;r&&r>0&&(Q?J=Q/r:J&&(Q=J*r),m&&J>m&&(J=m)),tn(Q>0||J>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.`,Q,J,l,f,h,v,r);var te=!Array.isArray(x)&&en(x.type).endsWith("Chart");return B.Children.map(x,function(F){return B.isValidElement(F)?W.cloneElement(F,Kl({width:Q,height:J},te?{style:Kl({height:"100%",width:"100%",maxHeight:J,maxWidth:Q},F.props.style)}:{})):F})},[r,x,f,m,v,h,$,l]);return B.createElement("div",{id:b?"".concat(b):void 0,className:Ne("recharts-responsive-container",P),style:Kl(Kl({},T),{},{width:l,height:f,minWidth:h,minHeight:v,maxHeight:m}),ref:_},L)}),UE=function(t){return null};UE.displayName="Cell";function Go(e){"@babel/helpers - typeof";return Go=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},Go(e)}function I_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function rm(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ka.isSsr)return{width:0,height:0};var n=nR(r),a=JSON.stringify({text:t,copyStyle:n});if(Ki.widthCache[a])return Ki.widthCache[a];try{var u=document.getElementById($_);u||(u=document.createElement("span"),u.setAttribute("id",$_),u.setAttribute("aria-hidden","true"),document.body.appendChild(u));var l=rm(rm({},rR),n);Object.assign(u.style,l),u.textContent="".concat(t);var c=u.getBoundingClientRect(),f={width:c.width,height:c.height};return Ki.widthCache[a]=f,++Ki.cacheCount>tR&&(Ki.cacheCount=0,Ki.widthCache={}),f}catch{return{width:0,height:0}}},iR=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Xo(e){"@babel/helpers - typeof";return Xo=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},Xo(e)}function xs(e,t){return lR(e)||uR(e,t)||oR(e,t)||aR()}function aR(){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 oR(e,t){if(e){if(typeof e=="string")return R_(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 R_(e,t)}}function R_(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 SR(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 F_(e,t){return AR(e)||PR(e,t)||OR(e,t)||_R()}function _R(){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 OR(e,t){if(e){if(typeof e=="string")return U_(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 U_(e,t)}}function U_(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 Q.reduce(function(J,te){var F=te.word,K=te.width,G=J[J.length-1];if(G&&(a==null||u||G.width+K+nte.width?J:te})};if(!h)return x;for(var w="…",b=function(Q){var J=v.slice(0,Q),te=KE({breakAll:d,style:f,children:J+w}).wordsWithComputedWidth,F=m(te),K=F.length>l||S(F).width>Number(a);return[K,F]},P=0,E=v.length-1,j=0,T;P<=E&&j<=v.length-1;){var _=Math.floor((P+E)/2),O=_-1,k=b(O),N=F_(k,2),$=N[0],X=N[1],q=b(_),L=F_(q,1),H=L[0];if(!$&&!H&&(P=_+1),$&&H&&(E=_-1),!$&&H){T=X;break}j++}return T||x},W_=function(t){var r=Ce(t)?[]:t.toString().split(VE);return[{words:r}]},jR=function(t){var r=t.width,n=t.scaleToFit,a=t.children,u=t.style,l=t.breakAll,c=t.maxLines;if((r||n)&&!ka.isSsr){var f,d,h=KE({breakAll:l,children:a,style:u});if(h){var v=h.wordsWithComputedWidth,m=h.spaceWidth;f=v,d=m}else return W_(a);return ER({breakAll:l,children:a,maxLines:c,style:u},f,d,r,n)}return W_(a)},H_="#808080",ws=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,u=a===void 0?0:a,l=t.lineHeight,c=l===void 0?"1em":l,f=t.capHeight,d=f===void 0?"0.71em":f,h=t.scaleToFit,v=h===void 0?!1:h,m=t.textAnchor,x=m===void 0?"start":m,S=t.verticalAnchor,w=S===void 0?"end":S,b=t.fill,P=b===void 0?H_:b,E=z_(t,xR),j=W.useMemo(function(){return jR({breakAll:E.breakAll,children:E.children,maxLines:E.maxLines,scaleToFit:v,style:E.style,width:E.width})},[E.breakAll,E.children,E.maxLines,v,E.style,E.width]),T=E.dx,_=E.dy,O=E.angle,k=E.className,N=E.breakAll,$=z_(E,wR);if(!dt(n)||!dt(u))return null;var X=n+(se(T)?T:0),q=u+(se(_)?_:0),L;switch(w){case"start":L=Fv("calc(".concat(d,")"));break;case"middle":L=Fv("calc(".concat((j.length-1)/2," * -").concat(c," + (").concat(d," / 2))"));break;default:L=Fv("calc(".concat(j.length-1," * -").concat(c,")"));break}var H=[];if(v){var Y=j[0].width,Q=E.width;H.push("scale(".concat((se(Q)?Q/Y:1)/Y,")"))}return O&&H.push("rotate(".concat(O,", ").concat(X,", ").concat(q,")")),H.length&&($.transform=H.join(" ")),B.createElement("text",nm({},ke($,!0),{x:X,y:q,className:Ne("recharts-text",k),textAnchor:x,fill:P.includes("url")?H_:P}),j.map(function(J,te){var F=J.words.join(N?"":" ");return B.createElement("tspan",{x:X,dy:te===0?L:c,key:"".concat(F,"-").concat(te)},F)}))};function $n(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function TR(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function _g(e){let t,r,n;e.length!==2?(t=$n,r=(c,f)=>$n(e(c),f),n=(c,f)=>e(c)-f):(t=e===$n||e===TR?e:kR,r=e,n=e);function a(c,f,d=0,h=c.length){if(d>>1;r(c[v],f)<0?d=v+1:h=v}while(d>>1;r(c[v],f)<=0?d=v+1:h=v}while(dd&&n(c[v-1],f)>-n(c[v],f)?v-1:v}return{left:a,center:l,right:u}}function kR(){return 0}function GE(e){return e===null?NaN:+e}function*CR(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const MR=_g($n),Tu=MR.right;_g(GE).center;class V_ extends Map{constructor(t,r=$R){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(K_(this,t))}has(t){return super.has(K_(this,t))}set(t,r){return super.set(NR(this,t),r)}delete(t){return super.delete(IR(this,t))}}function K_({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function NR({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function IR({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function $R(e){return e!==null&&typeof e=="object"?e.valueOf():e}function RR(e=$n){if(e===$n)return XE;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 XE(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const DR=Math.sqrt(50),LR=Math.sqrt(10),BR=Math.sqrt(2);function Ss(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),u=n/Math.pow(10,a),l=u>=DR?10:u>=LR?5:u>=BR?2:1;let c,f,d;return a<0?(d=Math.pow(10,-a)/l,c=Math.round(e*d),f=Math.round(t*d),c/dt&&--f,d=-d):(d=Math.pow(10,a)*l,c=Math.round(e/d),f=Math.round(t/d),c*dt&&--f),f0))return[];if(e===t)return[e];const n=t=a))return[];const c=u-a+1,f=new Array(c);if(n)if(l<0)for(let d=0;d=n)&&(r=n);return r}function X_(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function YE(e,t,r=0,n=1/0,a){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(a=a===void 0?XE:RR(a);n>r;){if(n-r>600){const f=n-r+1,d=t-r+1,h=Math.log(f),v=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*v*(f-v)/f)*(d-f/2<0?-1:1),x=Math.max(r,Math.floor(t-d*v/f+m)),S=Math.min(n,Math.floor(t+(f-d)*v/f+m));YE(e,t,x,S,a)}const u=e[t];let l=r,c=n;for(Ao(e,r,t),a(e[n],u)>0&&Ao(e,r,n);l0;)--c}a(e[r],u)===0?Ao(e,r,c):(++c,Ao(e,c,n)),c<=t&&(r=c+1),t<=c&&(n=c-1)}return e}function Ao(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function qR(e,t,r){if(e=Float64Array.from(CR(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return X_(e);if(t>=1)return G_(e);var n,a=(n-1)*t,u=Math.floor(a),l=G_(YE(e,u).subarray(0,u+1)),c=X_(e.subarray(u+1));return l+(c-l)*(a-u)}}function zR(e,t,r=GE){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,a=(n-1)*t,u=Math.floor(a),l=+r(e[u],u,e),c=+r(e[u+1],u+1,e);return l+(c-l)*(a-u)}}function FR(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,u=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Xl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Xl(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=WR.exec(e))?new Ft(t[1],t[2],t[3],1):(t=HR.exec(e))?new Ft(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=VR.exec(e))?Xl(t[1],t[2],t[3],t[4]):(t=KR.exec(e))?Xl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=GR.exec(e))?rO(t[1],t[2]/100,t[3]/100,1):(t=XR.exec(e))?rO(t[1],t[2]/100,t[3]/100,t[4]):Y_.hasOwnProperty(e)?J_(Y_[e]):e==="transparent"?new Ft(NaN,NaN,NaN,0):null}function J_(e){return new Ft(e>>16&255,e>>8&255,e&255,1)}function Xl(e,t,r,n){return n<=0&&(e=t=r=NaN),new Ft(e,t,r,n)}function ZR(e){return e instanceof ku||(e=Jo(e)),e?(e=e.rgb(),new Ft(e.r,e.g,e.b,e.opacity)):new Ft}function lm(e,t,r,n){return arguments.length===1?ZR(e):new Ft(e,t,r,n??1)}function Ft(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Pg(Ft,lm,ZE(ku,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new Ft(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new Ft(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ft(fi(this.r),fi(this.g),fi(this.b),Os(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:eO,formatHex:eO,formatHex8:JR,formatRgb:tO,toString:tO}));function eO(){return`#${oi(this.r)}${oi(this.g)}${oi(this.b)}`}function JR(){return`#${oi(this.r)}${oi(this.g)}${oi(this.b)}${oi((isNaN(this.opacity)?1:this.opacity)*255)}`}function tO(){const e=Os(this.opacity);return`${e===1?"rgb(":"rgba("}${fi(this.r)}, ${fi(this.g)}, ${fi(this.b)}${e===1?")":`, ${e})`}`}function Os(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function fi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function oi(e){return e=fi(e),(e<16?"0":"")+e.toString(16)}function rO(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new _r(e,t,r,n)}function JE(e){if(e instanceof _r)return new _r(e.h,e.s,e.l,e.opacity);if(e instanceof ku||(e=Jo(e)),!e)return new _r;if(e instanceof _r)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),u=Math.max(t,r,n),l=NaN,c=u-a,f=(u+a)/2;return c?(t===u?l=(r-n)/c+(r0&&f<1?0:l,new _r(l,c,f,e.opacity)}function eD(e,t,r,n){return arguments.length===1?JE(e):new _r(e,t,r,n??1)}function _r(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Pg(_r,eD,ZE(ku,{brighter(e){return e=e==null?_s:Math.pow(_s,e),new _r(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Qo:Math.pow(Qo,e),new _r(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,a=2*r-n;return new Ft(Uv(e>=240?e-240:e+120,a,n),Uv(e,a,n),Uv(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new _r(nO(this.h),Yl(this.s),Yl(this.l),Os(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=Os(this.opacity);return`${e===1?"hsl(":"hsla("}${nO(this.h)}, ${Yl(this.s)*100}%, ${Yl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function nO(e){return e=(e||0)%360,e<0?e+360:e}function Yl(e){return Math.max(0,Math.min(1,e||0))}function Uv(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 Ag=e=>()=>e;function tD(e,t){return function(r){return e+r*t}}function rD(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 nD(e){return(e=+e)==1?ej:function(t,r){return r-t?rD(t,r,e):Ag(isNaN(t)?r:t)}}function ej(e,t){var r=t-e;return r?tD(e,r):Ag(isNaN(e)?t:e)}const iO=(function e(t){var r=nD(t);function n(a,u){var l=r((a=lm(a)).r,(u=lm(u)).r),c=r(a.g,u.g),f=r(a.b,u.b),d=ej(a.opacity,u.opacity);return function(h){return a.r=l(h),a.g=c(h),a.b=f(h),a.opacity=d(h),a+""}}return n.gamma=e,n})(1);function iD(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(u){for(a=0;ar&&(u=t.slice(r,u),c[l]?c[l]+=u:c[++l]=u),(n=n[0])===(a=a[0])?c[l]?c[l]+=a:c[++l]=a:(c[++l]=null,f.push({i:l,x:Ps(n,a)})),r=Wv.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function vD(e,t,r){var n=e[0],a=e[1],u=t[0],l=t[1];return a2?yD:vD,f=d=null,v}function v(m){return m==null||isNaN(m=+m)?u:(f||(f=c(e.map(n),t,r)))(n(l(m)))}return v.invert=function(m){return l(a((d||(d=c(t,e.map(n),Ps)))(m)))},v.domain=function(m){return arguments.length?(e=Array.from(m,As),h()):e.slice()},v.range=function(m){return arguments.length?(t=Array.from(m),h()):t.slice()},v.rangeRound=function(m){return t=Array.from(m),r=Eg,h()},v.clamp=function(m){return arguments.length?(l=m?!0:It,h()):l!==It},v.interpolate=function(m){return arguments.length?(r=m,h()):r},v.unknown=function(m){return arguments.length?(u=m,v):u},function(m,x){return n=m,a=x,h()}}function jg(){return gc()(It,It)}function mD(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Es(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 sa(e){return e=Es(Math.abs(e)),e?e[1]:NaN}function gD(e,t){return function(r,n){for(var a=r.length,u=[],l=0,c=e[0],f=0;a>0&&c>0&&(f+c+1>n&&(c=Math.max(1,n-f)),u.push(r.substring(a-=c,a+c)),!((f+=c+1)>n));)c=e[l=(l+1)%e.length];return u.reverse().join(t)}}function bD(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var xD=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function eu(e){if(!(t=xD.exec(e)))throw new Error("invalid format: "+e);var t;return new Tg({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]})}eu.prototype=Tg.prototype;function Tg(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+""}Tg.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 wD(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var js;function SD(e,t){var r=Es(e,t);if(!r)return js=void 0,e.toPrecision(t);var n=r[0],a=r[1],u=a-(js=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,l=n.length;return u===l?n:u>l?n+new Array(u-l+1).join("0"):u>0?n.slice(0,u)+"."+n.slice(u):"0."+new Array(1-u).join("0")+Es(e,Math.max(0,t+u-1))[0]}function oO(e,t){var r=Es(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const uO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:mD,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)=>oO(e*100,t),r:oO,s:SD,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function lO(e){return e}var sO=Array.prototype.map,cO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function _D(e){var t=e.grouping===void 0||e.thousands===void 0?lO:gD(sO.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",u=e.numerals===void 0?lO:bD(sO.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",c=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function d(v,m){v=eu(v);var x=v.fill,S=v.align,w=v.sign,b=v.symbol,P=v.zero,E=v.width,j=v.comma,T=v.precision,_=v.trim,O=v.type;O==="n"?(j=!0,O="g"):uO[O]||(T===void 0&&(T=12),_=!0,O="g"),(P||x==="0"&&S==="=")&&(P=!0,x="0",S="=");var k=(m&&m.prefix!==void 0?m.prefix:"")+(b==="$"?r:b==="#"&&/[boxX]/.test(O)?"0"+O.toLowerCase():""),N=(b==="$"?n:/[%p]/.test(O)?l:"")+(m&&m.suffix!==void 0?m.suffix:""),$=uO[O],X=/[defgprs%]/.test(O);T=T===void 0?6:/[gprs]/.test(O)?Math.max(1,Math.min(21,T)):Math.max(0,Math.min(20,T));function q(L){var H=k,Y=N,Q,J,te;if(O==="c")Y=$(L)+Y,L="";else{L=+L;var F=L<0||1/L<0;if(L=isNaN(L)?f:$(Math.abs(L),T),_&&(L=wD(L)),F&&+L==0&&w!=="+"&&(F=!1),H=(F?w==="("?w:c:w==="-"||w==="("?"":w)+H,Y=(O==="s"&&!isNaN(L)&&js!==void 0?cO[8+js/3]:"")+Y+(F&&w==="("?")":""),X){for(Q=-1,J=L.length;++Qte||te>57){Y=(te===46?a+L.slice(Q+1):L.slice(Q))+Y,L=L.slice(0,Q);break}}}j&&!P&&(L=t(L,1/0));var K=H.length+L.length+Y.length,G=K>1)+H+L+Y+G.slice(K);break;default:L=G+H+L+Y;break}return u(L)}return q.toString=function(){return v+""},q}function h(v,m){var x=Math.max(-8,Math.min(8,Math.floor(sa(m)/3)))*3,S=Math.pow(10,-x),w=d((v=eu(v),v.type="f",v),{suffix:cO[8+x/3]});return function(b){return w(S*b)}}return{format:d,formatPrefix:h}}var Ql,kg,tj;OD({thousands:",",grouping:[3],currency:["$",""]});function OD(e){return Ql=_D(e),kg=Ql.format,tj=Ql.formatPrefix,Ql}function PD(e){return Math.max(0,-sa(Math.abs(e)))}function AD(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(sa(t)/3)))*3-sa(Math.abs(e)))}function ED(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,sa(t)-sa(e))+1}function rj(e,t,r,n){var a=om(e,t,r),u;switch(n=eu(n??",f"),n.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(u=AD(a,l))&&(n.precision=u),tj(n,l)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(u=ED(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=u-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(u=PD(a))&&(n.precision=u-(n.type==="%")*2);break}}return kg(n)}function Bn(e){var t=e.domain;return e.ticks=function(r){var n=t();return im(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return rj(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,u=n.length-1,l=n[a],c=n[u],f,d,h=10;for(c0;){if(d=am(l,c,r),d===f)return n[a]=l,n[u]=c,t(n);if(d>0)l=Math.floor(l/d)*d,c=Math.ceil(c/d)*d;else if(d<0)l=Math.ceil(l*d)/d,c=Math.floor(c*d)/d;else break;f=d}return e},e}function Ts(){var e=jg();return e.copy=function(){return Cu(e,Ts())},fr.apply(e,arguments),Bn(e)}function nj(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,As),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return nj(e).unknown(t)},e=arguments.length?Array.from(e,As):[0,1],Bn(r)}function ij(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],u=e[n],l;return uMath.pow(e,t)}function MD(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 pO(e){return(t,r)=>-e(-t,r)}function Cg(e){const t=e(fO,dO),r=t.domain;let n=10,a,u;function l(){return a=MD(n),u=CD(n),r()[0]<0?(a=pO(a),u=pO(u),e(jD,TD)):e(fO,dO),t}return t.base=function(c){return arguments.length?(n=+c,l()):n},t.domain=function(c){return arguments.length?(r(c),l()):r()},t.ticks=c=>{const f=r();let d=f[0],h=f[f.length-1];const v=h0){for(;m<=x;++m)for(S=1;Sh)break;P.push(w)}}else for(;m<=x;++m)for(S=n-1;S>=1;--S)if(w=m>0?S/u(-m):S*u(m),!(wh)break;P.push(w)}P.length*2{if(c==null&&(c=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=eu(f)).precision==null&&(f.trim=!0),f=kg(f)),c===1/0)return f;const d=Math.max(1,n*c/t.ticks().length);return h=>{let v=h/u(Math.round(a(h)));return v*nr(ij(r(),{floor:c=>u(Math.floor(a(c))),ceil:c=>u(Math.ceil(a(c)))})),t}function aj(){const e=Cg(gc()).domain([1,10]);return e.copy=()=>Cu(e,aj()).base(e.base()),fr.apply(e,arguments),e}function hO(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function vO(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Mg(e){var t=1,r=e(hO(t),vO(t));return r.constant=function(n){return arguments.length?e(hO(t=+n),vO(t)):t},Bn(r)}function oj(){var e=Mg(gc());return e.copy=function(){return Cu(e,oj()).constant(e.constant())},fr.apply(e,arguments)}function yO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function ND(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function ID(e){return e<0?-e*e:e*e}function Ng(e){var t=e(It,It),r=1;function n(){return r===1?e(It,It):r===.5?e(ND,ID):e(yO(r),yO(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},Bn(t)}function Ig(){var e=Ng(gc());return e.copy=function(){return Cu(e,Ig()).exponent(e.exponent())},fr.apply(e,arguments),e}function $D(){return Ig.apply(null,arguments).exponent(.5)}function mO(e){return Math.sign(e)*e*e}function RD(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function uj(){var e=jg(),t=[0,1],r=!1,n;function a(u){var l=RD(e(u));return isNaN(l)?n:r?Math.round(l):l}return a.invert=function(u){return e.invert(mO(u))},a.domain=function(u){return arguments.length?(e.domain(u),a):e.domain()},a.range=function(u){return arguments.length?(e.range((t=Array.from(u,As)).map(mO)),a):t.slice()},a.rangeRound=function(u){return a.range(u).round(!0)},a.round=function(u){return arguments.length?(r=!!u,a):r},a.clamp=function(u){return arguments.length?(e.clamp(u),a):e.clamp()},a.unknown=function(u){return arguments.length?(n=u,a):n},a.copy=function(){return uj(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},fr.apply(a,arguments),Bn(a)}function lj(){var e=[],t=[],r=[],n;function a(){var l=0,c=Math.max(1,t.length);for(r=new Array(c-1);++l0?r[c-1]:e[0],c=r?[n[r-1],t]:[n[d-1],n[d]]},l.unknown=function(f){return arguments.length&&(u=f),l},l.thresholds=function(){return n.slice()},l.copy=function(){return sj().domain([e,t]).range(a).unknown(u)},fr.apply(Bn(l),arguments)}function cj(){var e=[.5],t=[0,1],r,n=1;function a(u){return u!=null&&u<=u?t[Tu(e,u,0,n)]:r}return a.domain=function(u){return arguments.length?(e=Array.from(u),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(u){return arguments.length?(t=Array.from(u),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(u){var l=t.indexOf(u);return[e[l-1],e[l]]},a.unknown=function(u){return arguments.length?(r=u,a):r},a.copy=function(){return cj().domain(e).range(t).unknown(r)},fr.apply(a,arguments)}const Hv=new Date,Vv=new Date;function pt(e,t,r,n){function a(u){return e(u=arguments.length===0?new Date:new Date(+u)),u}return a.floor=u=>(e(u=new Date(+u)),u),a.ceil=u=>(e(u=new Date(u-1)),t(u,1),e(u),u),a.round=u=>{const l=a(u),c=a.ceil(u);return u-l(t(u=new Date(+u),l==null?1:Math.floor(l)),u),a.range=(u,l,c)=>{const f=[];if(u=a.ceil(u),c=c==null?1:Math.floor(c),!(u0))return f;let d;do f.push(d=new Date(+u)),t(u,c),e(u);while(dpt(l=>{if(l>=l)for(;e(l),!u(l);)l.setTime(l-1)},(l,c)=>{if(l>=l)if(c<0)for(;++c<=0;)for(;t(l,-1),!u(l););else for(;--c>=0;)for(;t(l,1),!u(l););}),r&&(a.count=(u,l)=>(Hv.setTime(+u),Vv.setTime(+l),e(Hv),e(Vv),Math.floor(r(Hv,Vv))),a.every=u=>(u=Math.floor(u),!isFinite(u)||!(u>0)?null:u>1?a.filter(n?l=>n(l)%u===0:l=>a.count(0,l)%u===0):a)),a}const ks=pt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ks.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?pt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):ks);ks.range;const Qr=1e3,lr=Qr*60,Zr=lr*60,nn=Zr*24,$g=nn*7,gO=nn*30,Kv=nn*365,ui=pt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Qr)},(e,t)=>(t-e)/Qr,e=>e.getUTCSeconds());ui.range;const Rg=pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Qr)},(e,t)=>{e.setTime(+e+t*lr)},(e,t)=>(t-e)/lr,e=>e.getMinutes());Rg.range;const Dg=pt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*lr)},(e,t)=>(t-e)/lr,e=>e.getUTCMinutes());Dg.range;const Lg=pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Qr-e.getMinutes()*lr)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getHours());Lg.range;const Bg=pt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCHours());Bg.range;const Mu=pt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*lr)/nn,e=>e.getDate()-1);Mu.range;const bc=pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/nn,e=>e.getUTCDate()-1);bc.range;const fj=pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/nn,e=>Math.floor(e/nn));fj.range;function bi(e){return pt(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())*lr)/$g)}const xc=bi(0),Cs=bi(1),DD=bi(2),LD=bi(3),ca=bi(4),BD=bi(5),qD=bi(6);xc.range;Cs.range;DD.range;LD.range;ca.range;BD.range;qD.range;function xi(e){return pt(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)/$g)}const wc=xi(0),Ms=xi(1),zD=xi(2),FD=xi(3),fa=xi(4),UD=xi(5),WD=xi(6);wc.range;Ms.range;zD.range;FD.range;fa.range;UD.range;WD.range;const qg=pt(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());qg.range;const zg=pt(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());zg.range;const an=pt(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());an.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pt(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)});an.range;const on=pt(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());on.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pt(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)});on.range;function dj(e,t,r,n,a,u){const l=[[ui,1,Qr],[ui,5,5*Qr],[ui,15,15*Qr],[ui,30,30*Qr],[u,1,lr],[u,5,5*lr],[u,15,15*lr],[u,30,30*lr],[a,1,Zr],[a,3,3*Zr],[a,6,6*Zr],[a,12,12*Zr],[n,1,nn],[n,2,2*nn],[r,1,$g],[t,1,gO],[t,3,3*gO],[e,1,Kv]];function c(d,h,v){const m=hb).right(l,m);if(x===l.length)return e.every(om(d/Kv,h/Kv,v));if(x===0)return ks.every(Math.max(om(d,h,v),1));const[S,w]=l[m/l[x-1][2]53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Te=Xv(Eo(ae.y,0,1)),Je=Te.getUTCDay(),Te=Je>4||Je===0?Ms.ceil(Te):Ms(Te),Te=bc.offset(Te,(ae.V-1)*7),ae.y=Te.getUTCFullYear(),ae.m=Te.getUTCMonth(),ae.d=Te.getUTCDate()+(ae.w+6)%7):(Te=Gv(Eo(ae.y,0,1)),Je=Te.getDay(),Te=Je>4||Je===0?Cs.ceil(Te):Cs(Te),Te=Mu.offset(Te,(ae.V-1)*7),ae.y=Te.getFullYear(),ae.m=Te.getMonth(),ae.d=Te.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),Je="Z"in ae?Xv(Eo(ae.y,0,1)).getUTCDay():Gv(Eo(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(Je+5)%7:ae.w+ae.U*7-(Je+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,Xv(ae)):Gv(ae)}}function N(ue,ge,Pe,ae){for(var qe=0,Te=ge.length,Je=Pe.length,et,ht;qe=Je)return-1;if(et=ge.charCodeAt(qe++),et===37){if(et=ge.charAt(qe++),ht=_[et in bO?ge.charAt(qe++):et],!ht||(ae=ht(ue,Pe,ae))<0)return-1}else if(et!=Pe.charCodeAt(ae++))return-1}return ae}function $(ue,ge,Pe){var ae=d.exec(ge.slice(Pe));return ae?(ue.p=h.get(ae[0].toLowerCase()),Pe+ae[0].length):-1}function X(ue,ge,Pe){var ae=x.exec(ge.slice(Pe));return ae?(ue.w=S.get(ae[0].toLowerCase()),Pe+ae[0].length):-1}function q(ue,ge,Pe){var ae=v.exec(ge.slice(Pe));return ae?(ue.w=m.get(ae[0].toLowerCase()),Pe+ae[0].length):-1}function L(ue,ge,Pe){var ae=P.exec(ge.slice(Pe));return ae?(ue.m=E.get(ae[0].toLowerCase()),Pe+ae[0].length):-1}function H(ue,ge,Pe){var ae=w.exec(ge.slice(Pe));return ae?(ue.m=b.get(ae[0].toLowerCase()),Pe+ae[0].length):-1}function Y(ue,ge,Pe){return N(ue,t,ge,Pe)}function Q(ue,ge,Pe){return N(ue,r,ge,Pe)}function J(ue,ge,Pe){return N(ue,n,ge,Pe)}function te(ue){return l[ue.getDay()]}function F(ue){return u[ue.getDay()]}function K(ue){return f[ue.getMonth()]}function G(ue){return c[ue.getMonth()]}function I(ue){return a[+(ue.getHours()>=12)]}function z(ue){return 1+~~(ue.getMonth()/3)}function ne(ue){return l[ue.getUTCDay()]}function ce(ue){return u[ue.getUTCDay()]}function ve(ue){return f[ue.getUTCMonth()]}function we(ue){return c[ue.getUTCMonth()]}function Ee(ue){return a[+(ue.getUTCHours()>=12)]}function Oe(ue){return 1+~~(ue.getUTCMonth()/3)}return{format:function(ue){var ge=O(ue+="",j);return ge.toString=function(){return ue},ge},parse:function(ue){var ge=k(ue+="",!1);return ge.toString=function(){return ue},ge},utcFormat:function(ue){var ge=O(ue+="",T);return ge.toString=function(){return ue},ge},utcParse:function(ue){var ge=k(ue+="",!0);return ge.toString=function(){return ue},ge}}}var bO={"-":"",_:" ",0:"0"},bt=/^\s*\d+/,YD=/^%/,QD=/[\\^$*+?|[\]().{}]/g;function $e(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",u=a.length;return n+(u[t.toLowerCase(),r]))}function JD(e,t,r){var n=bt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function e3(e,t,r){var n=bt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function t3(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function r3(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function n3(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function xO(e,t,r){var n=bt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function wO(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function i3(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 a3(e,t,r){var n=bt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function o3(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function SO(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function u3(e,t,r){var n=bt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function _O(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function l3(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function s3(e,t,r){var n=bt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function c3(e,t,r){var n=bt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function f3(e,t,r){var n=bt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function d3(e,t,r){var n=YD.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function p3(e,t,r){var n=bt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function h3(e,t,r){var n=bt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function OO(e,t){return $e(e.getDate(),t,2)}function v3(e,t){return $e(e.getHours(),t,2)}function y3(e,t){return $e(e.getHours()%12||12,t,2)}function m3(e,t){return $e(1+Mu.count(an(e),e),t,3)}function pj(e,t){return $e(e.getMilliseconds(),t,3)}function g3(e,t){return pj(e,t)+"000"}function b3(e,t){return $e(e.getMonth()+1,t,2)}function x3(e,t){return $e(e.getMinutes(),t,2)}function w3(e,t){return $e(e.getSeconds(),t,2)}function S3(e){var t=e.getDay();return t===0?7:t}function _3(e,t){return $e(xc.count(an(e)-1,e),t,2)}function hj(e){var t=e.getDay();return t>=4||t===0?ca(e):ca.ceil(e)}function O3(e,t){return e=hj(e),$e(ca.count(an(e),e)+(an(e).getDay()===4),t,2)}function P3(e){return e.getDay()}function A3(e,t){return $e(Cs.count(an(e)-1,e),t,2)}function E3(e,t){return $e(e.getFullYear()%100,t,2)}function j3(e,t){return e=hj(e),$e(e.getFullYear()%100,t,2)}function T3(e,t){return $e(e.getFullYear()%1e4,t,4)}function k3(e,t){var r=e.getDay();return e=r>=4||r===0?ca(e):ca.ceil(e),$e(e.getFullYear()%1e4,t,4)}function C3(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+$e(t/60|0,"0",2)+$e(t%60,"0",2)}function PO(e,t){return $e(e.getUTCDate(),t,2)}function M3(e,t){return $e(e.getUTCHours(),t,2)}function N3(e,t){return $e(e.getUTCHours()%12||12,t,2)}function I3(e,t){return $e(1+bc.count(on(e),e),t,3)}function vj(e,t){return $e(e.getUTCMilliseconds(),t,3)}function $3(e,t){return vj(e,t)+"000"}function R3(e,t){return $e(e.getUTCMonth()+1,t,2)}function D3(e,t){return $e(e.getUTCMinutes(),t,2)}function L3(e,t){return $e(e.getUTCSeconds(),t,2)}function B3(e){var t=e.getUTCDay();return t===0?7:t}function q3(e,t){return $e(wc.count(on(e)-1,e),t,2)}function yj(e){var t=e.getUTCDay();return t>=4||t===0?fa(e):fa.ceil(e)}function z3(e,t){return e=yj(e),$e(fa.count(on(e),e)+(on(e).getUTCDay()===4),t,2)}function F3(e){return e.getUTCDay()}function U3(e,t){return $e(Ms.count(on(e)-1,e),t,2)}function W3(e,t){return $e(e.getUTCFullYear()%100,t,2)}function H3(e,t){return e=yj(e),$e(e.getUTCFullYear()%100,t,2)}function V3(e,t){return $e(e.getUTCFullYear()%1e4,t,4)}function K3(e,t){var r=e.getUTCDay();return e=r>=4||r===0?fa(e):fa.ceil(e),$e(e.getUTCFullYear()%1e4,t,4)}function G3(){return"+0000"}function AO(){return"%"}function EO(e){return+e}function jO(e){return Math.floor(+e/1e3)}var Gi,mj,gj;X3({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 X3(e){return Gi=XD(e),mj=Gi.format,Gi.parse,gj=Gi.utcFormat,Gi.utcParse,Gi}function Y3(e){return new Date(e)}function Q3(e){return e instanceof Date?+e:+new Date(+e)}function Fg(e,t,r,n,a,u,l,c,f,d){var h=jg(),v=h.invert,m=h.domain,x=d(".%L"),S=d(":%S"),w=d("%I:%M"),b=d("%I %p"),P=d("%a %d"),E=d("%b %d"),j=d("%B"),T=d("%Y");function _(O){return(f(O)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,u)=>qR(e,u/n))},r.copy=function(){return Sj(t).domain(e)},cn.apply(r,arguments)}function _c(){var e=0,t=.5,r=1,n=1,a,u,l,c,f,d=It,h,v=!1,m;function x(w){return isNaN(w=+w)?m:(w=.5+((w=+h(w))-u)*(n*wr}return Qv=e,Qv}var Zv,MO;function nL(){if(MO)return Zv;MO=1;var e=Aj(),t=rL(),r=Ta();function n(a){return a&&a.length?e(a,r,t):void 0}return Zv=n,Zv}var iL=nL();const Nn=Fe(iL);var Jv,NO;function aL(){if(NO)return Jv;NO=1;function e(t,r){return te.e^u.s<0?1:-1;for(n=u.d.length,a=e.d.length,t=0,r=ne.d[t]^u.s<0?1:-1;return n===a?0:n>a^u.s<0?1:-1};pe.decimalPlaces=pe.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*Ke;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};pe.dividedBy=pe.div=function(e){return rn(this,new this.constructor(e))};pe.dividedToIntegerBy=pe.idiv=function(e){var t=this,r=t.constructor;return ze(rn(t,new r(e),0,1),r.precision)};pe.equals=pe.eq=function(e){return!this.cmp(e)};pe.exponent=function(){return ut(this)};pe.greaterThan=pe.gt=function(e){return this.cmp(e)>0};pe.greaterThanOrEqualTo=pe.gte=function(e){return this.cmp(e)>=0};pe.isInteger=pe.isint=function(){return this.e>this.d.length-2};pe.isNegative=pe.isneg=function(){return this.s<0};pe.isPositive=pe.ispos=function(){return this.s>0};pe.isZero=function(){return this.s===0};pe.lessThan=pe.lt=function(e){return this.cmp(e)<0};pe.lessThanOrEqualTo=pe.lte=function(e){return this.cmp(e)<1};pe.logarithm=pe.log=function(e){var t,r=this,n=r.constructor,a=n.precision,u=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Yt))throw Error(cr+"NaN");if(r.s<1)throw Error(cr+(r.s?"NaN":"-Infinity"));return r.eq(Yt)?new n(0):(Xe=!1,t=rn(ru(r,u),ru(e,u),u),Xe=!0,ze(t,a))};pe.minus=pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?kj(t,e):jj(t,(e.s=-e.s,e))};pe.modulo=pe.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(cr+"NaN");return r.s?(Xe=!1,t=rn(r,e,0,1).times(e),Xe=!0,r.minus(t)):ze(new n(r),a)};pe.naturalExponential=pe.exp=function(){return Tj(this)};pe.naturalLogarithm=pe.ln=function(){return ru(this)};pe.negated=pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};pe.plus=pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?jj(t,e):kj(t,(e.s=-e.s,e))};pe.precision=pe.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(di+e);if(t=ut(a)+1,n=a.d.length-1,r=n*Ke+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};pe.squareRoot=pe.sqrt=function(){var e,t,r,n,a,u,l,c=this,f=c.constructor;if(c.s<1){if(!c.s)return new f(0);throw Error(cr+"NaN")}for(e=ut(c),Xe=!1,a=Math.sqrt(+c),a==0||a==1/0?(t=$r(c.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Na((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(a.toString()),r=f.precision,a=l=r+3;;)if(u=n,n=u.plus(rn(c,u,l+2)).times(.5),$r(u.d).slice(0,l)===(t=$r(n.d)).slice(0,l)){if(t=t.slice(l-3,l+1),a==l&&t=="4999"){if(ze(u,r+1,0),u.times(u).eq(c)){n=u;break}}else if(t!="9999")break;l+=4}return Xe=!0,ze(n,r)};pe.times=pe.mul=function(e){var t,r,n,a,u,l,c,f,d,h=this,v=h.constructor,m=h.d,x=(e=new v(e)).d;if(!h.s||!e.s)return new v(0);for(e.s*=h.s,r=h.e+e.e,f=m.length,d=x.length,f=0;){for(t=0,a=f+n;a>n;)c=u[a]+x[n]*m[a-n-1]+t,u[a--]=c%gt|0,t=c/gt|0;u[a]=(u[a]+t)%gt|0}for(;!u[--l];)u.pop();return t?++r:u.shift(),e.d=u,e.e=r,Xe?ze(e,v.precision):e};pe.toDecimalPlaces=pe.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Br(e,0,Ma),t===void 0?t=n.rounding:Br(t,0,8),ze(r,e+ut(r)+1,t))};pe.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=vi(n,!0):(Br(e,0,Ma),t===void 0?t=a.rounding:Br(t,0,8),n=ze(new a(n),e+1,t),r=vi(n,!0,e+1)),r};pe.toFixed=function(e,t){var r,n,a=this,u=a.constructor;return e===void 0?vi(a):(Br(e,0,Ma),t===void 0?t=u.rounding:Br(t,0,8),n=ze(new u(a),e+ut(a)+1,t),r=vi(n.abs(),!1,e+ut(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};pe.toInteger=pe.toint=function(){var e=this,t=e.constructor;return ze(new t(e),ut(e)+1,t.rounding)};pe.toNumber=function(){return+this};pe.toPower=pe.pow=function(e){var t,r,n,a,u,l,c=this,f=c.constructor,d=12,h=+(e=new f(e));if(!e.s)return new f(Yt);if(c=new f(c),!c.s){if(e.s<1)throw Error(cr+"Infinity");return c}if(c.eq(Yt))return c;if(n=f.precision,e.eq(Yt))return ze(c,n);if(t=e.e,r=e.d.length-1,l=t>=r,u=c.s,l){if((r=h<0?-h:h)<=Ej){for(a=new f(Yt),t=Math.ceil(n/Ke+4),Xe=!1;r%2&&(a=a.times(c),BO(a.d,t)),r=Na(r/2),r!==0;)c=c.times(c),BO(c.d,t);return Xe=!0,e.s<0?new f(Yt).div(a):ze(a,n)}}else if(u<0)throw Error(cr+"NaN");return u=u<0&&e.d[Math.max(t,r)]&1?-1:1,c.s=1,Xe=!1,a=e.times(ru(c,n+d)),Xe=!0,a=Tj(a),a.s=u,a};pe.toPrecision=function(e,t){var r,n,a=this,u=a.constructor;return e===void 0?(r=ut(a),n=vi(a,r<=u.toExpNeg||r>=u.toExpPos)):(Br(e,1,Ma),t===void 0?t=u.rounding:Br(t,0,8),a=ze(new u(a),e,t),r=ut(a),n=vi(a,e<=r||r<=u.toExpNeg,e)),n};pe.toSignificantDigits=pe.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Br(e,1,Ma),t===void 0?t=n.rounding:Br(t,0,8)),ze(new n(r),e,t)};pe.toString=pe.valueOf=pe.val=pe.toJSON=pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ut(e),r=e.constructor;return vi(e,t<=r.toExpNeg||t>=r.toExpPos)};function jj(e,t){var r,n,a,u,l,c,f,d,h=e.constructor,v=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),Xe?ze(t,v):t;if(f=e.d,d=t.d,l=e.e,a=t.e,f=f.slice(),u=l-a,u){for(u<0?(n=f,u=-u,c=d.length):(n=d,a=l,c=f.length),l=Math.ceil(v/Ke),c=l>c?l+1:c+1,u>c&&(u=c,n.length=1),n.reverse();u--;)n.push(0);n.reverse()}for(c=f.length,u=d.length,c-u<0&&(u=c,n=d,d=f,f=n),r=0;u;)r=(f[--u]=f[u]+d[u]+r)/gt|0,f[u]%=gt;for(r&&(f.unshift(r),++a),c=f.length;f[--c]==0;)f.pop();return t.d=f,t.e=a,Xe?ze(t,v):t}function Br(e,t,r){if(e!==~~e||er)throw Error(di+e)}function $r(e){var t,r,n,a=e.length-1,u="",l=e[0];if(a>0){for(u+=l,t=1;tl?1:-1;else for(c=f=0;ca[c]?1:-1;break}return f}function r(n,a,u){for(var l=0;u--;)n[u]-=l,l=n[u]1;)n.shift()}return function(n,a,u,l){var c,f,d,h,v,m,x,S,w,b,P,E,j,T,_,O,k,N,$=n.constructor,X=n.s==a.s?1:-1,q=n.d,L=a.d;if(!n.s)return new $(n);if(!a.s)throw Error(cr+"Division by zero");for(f=n.e-a.e,k=L.length,_=q.length,x=new $(X),S=x.d=[],d=0;L[d]==(q[d]||0);)++d;if(L[d]>(q[d]||0)&&--f,u==null?E=u=$.precision:l?E=u+(ut(n)-ut(a))+1:E=u,E<0)return new $(0);if(E=E/Ke+2|0,d=0,k==1)for(h=0,L=L[0],E++;(d<_||h)&&E--;d++)j=h*gt+(q[d]||0),S[d]=j/L|0,h=j%L|0;else{for(h=gt/(L[0]+1)|0,h>1&&(L=e(L,h),q=e(q,h),k=L.length,_=q.length),T=k,w=q.slice(0,k),b=w.length;b=gt/2&&++O;do h=0,c=t(L,w,k,b),c<0?(P=w[0],k!=b&&(P=P*gt+(w[1]||0)),h=P/O|0,h>1?(h>=gt&&(h=gt-1),v=e(L,h),m=v.length,b=w.length,c=t(v,w,m,b),c==1&&(h--,r(v,k16)throw Error(Hg+ut(e));if(!e.s)return new h(Yt);for(Xe=!1,c=v,l=new h(.03125);e.abs().gte(.1);)e=e.times(l),d+=5;for(n=Math.log(ii(2,d))/Math.LN10*2+5|0,c+=n,r=a=u=new h(Yt),h.precision=c;;){if(a=ze(a.times(e),c),r=r.times(++f),l=u.plus(rn(a,r,c)),$r(l.d).slice(0,c)===$r(u.d).slice(0,c)){for(;d--;)u=ze(u.times(u),c);return h.precision=v,t==null?(Xe=!0,ze(u,v)):u}u=l}}function ut(e){for(var t=e.e*Ke,r=e.d[0];r>=10;r/=10)t++;return t}function iy(e,t,r){if(t>e.LN10.sd())throw Xe=!0,r&&(e.precision=r),Error(cr+"LN10 precision limit exceeded");return ze(new e(e.LN10),t)}function Cn(e){for(var t="";e--;)t+="0";return t}function ru(e,t){var r,n,a,u,l,c,f,d,h,v=1,m=10,x=e,S=x.d,w=x.constructor,b=w.precision;if(x.s<1)throw Error(cr+(x.s?"NaN":"-Infinity"));if(x.eq(Yt))return new w(0);if(t==null?(Xe=!1,d=b):d=t,x.eq(10))return t==null&&(Xe=!0),iy(w,d);if(d+=m,w.precision=d,r=$r(S),n=r.charAt(0),u=ut(x),Math.abs(u)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)x=x.times(e),r=$r(x.d),n=r.charAt(0),v++;u=ut(x),n>1?(x=new w("0."+r),u++):x=new w(n+"."+r.slice(1))}else return f=iy(w,d+2,b).times(u+""),x=ru(new w(n+"."+r.slice(1)),d-m).plus(f),w.precision=b,t==null?(Xe=!0,ze(x,b)):x;for(c=l=x=rn(x.minus(Yt),x.plus(Yt),d),h=ze(x.times(x),d),a=3;;){if(l=ze(l.times(h),d),f=c.plus(rn(l,new w(a),d)),$r(f.d).slice(0,d)===$r(c.d).slice(0,d))return c=c.times(2),u!==0&&(c=c.plus(iy(w,d+2,b).times(u+""))),c=rn(c,new w(v),d),w.precision=b,t==null?(Xe=!0,ze(c,b)):c;c=f,a+=2}}function LO(e,t){var r,n,a;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(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Na(r/Ke),e.d=[],n=(r+1)%Ke,r<0&&(n+=Ke),nNs||e.e<-Ns))throw Error(Hg+r)}else e.s=0,e.e=0,e.d=[0];return e}function ze(e,t,r){var n,a,u,l,c,f,d,h,v=e.d;for(l=1,u=v[0];u>=10;u/=10)l++;if(n=t-l,n<0)n+=Ke,a=t,d=v[h=0];else{if(h=Math.ceil((n+1)/Ke),u=v.length,h>=u)return e;for(d=u=v[h],l=1;u>=10;u/=10)l++;n%=Ke,a=n-Ke+l}if(r!==void 0&&(u=ii(10,l-a-1),c=d/u%10|0,f=t<0||v[h+1]!==void 0||d%u,f=r<4?(c||f)&&(r==0||r==(e.s<0?3:2)):c>5||c==5&&(r==4||f||r==6&&(n>0?a>0?d/ii(10,l-a):0:v[h-1])%10&1||r==(e.s<0?8:7))),t<1||!v[0])return f?(u=ut(e),v.length=1,t=t-u-1,v[0]=ii(10,(Ke-t%Ke)%Ke),e.e=Na(-t/Ke)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(n==0?(v.length=h,u=1,h--):(v.length=h+1,u=ii(10,Ke-n),v[h]=a>0?(d/ii(10,l-a)%ii(10,a)|0)*u:0),f)for(;;)if(h==0){(v[0]+=u)==gt&&(v[0]=1,++e.e);break}else{if(v[h]+=u,v[h]!=gt)break;v[h--]=0,u=1}for(n=v.length;v[--n]===0;)v.pop();if(Xe&&(e.e>Ns||e.e<-Ns))throw Error(Hg+ut(e));return e}function kj(e,t){var r,n,a,u,l,c,f,d,h,v,m=e.constructor,x=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),Xe?ze(t,x):t;if(f=e.d,v=t.d,n=t.e,d=e.e,f=f.slice(),l=d-n,l){for(h=l<0,h?(r=f,l=-l,c=v.length):(r=v,n=d,c=f.length),a=Math.max(Math.ceil(x/Ke),c)+2,l>a&&(l=a,r.length=1),r.reverse(),a=l;a--;)r.push(0);r.reverse()}else{for(a=f.length,c=v.length,h=a0;--a)f[c++]=0;for(a=v.length;a>l;){if(f[--a]0?u=u.charAt(0)+"."+u.slice(1)+Cn(n):l>1&&(u=u.charAt(0)+"."+u.slice(1)),u=u+(a<0?"e":"e+")+a):a<0?(u="0."+Cn(-a-1)+u,r&&(n=r-l)>0&&(u+=Cn(n))):a>=l?(u+=Cn(a+1-l),r&&(n=r-a-1)>0&&(u=u+"."+Cn(n))):((n=a+1)0&&(a+1===l&&(u+="."),u+=Cn(n))),e.s<0?"-"+u:u}function BO(e,t){if(e.length>t)return e.length=t,!0}function Cj(e){var t,r,n;function a(u){var l=this;if(!(l instanceof a))return new a(u);if(l.constructor=a,u instanceof a){l.s=u.s,l.e=u.e,l.d=(u=u.d)?u.slice():u;return}if(typeof u=="number"){if(u*0!==0)throw Error(di+u);if(u>0)l.s=1;else if(u<0)u=-u,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(u===~~u&&u<1e7){l.e=0,l.d=[u];return}return LO(l,u.toString())}else if(typeof u!="string")throw Error(di+u);if(u.charCodeAt(0)===45?(u=u.slice(1),l.s=-1):l.s=1,vL.test(u))LO(l,u);else throw Error(di+u)}if(a.prototype=pe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=Cj,a.config=a.set=yL,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(di+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(di+r+": "+n);return this}var Vg=Cj(hL);Yt=new Vg(1);const Be=Vg;function mL(e){return wL(e)||xL(e)||bL(e)||gL()}function gL(){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 bL(e,t){if(e){if(typeof e=="string")return fm(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 fm(e,t)}}function xL(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function wL(e){if(Array.isArray(e))return fm(e)}function fm(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,a):e(t-l,qO(function(){for(var c=arguments.length,f=new Array(c),d=0;de.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,a=!1,u=void 0;try{for(var l=e[Symbol.iterator](),c;!(n=(c=l.next()).done)&&(r.push(c.value),!(t&&r.length===t));n=!0);}catch(f){a=!0,u=f}finally{try{!n&&l.return!=null&&l.return()}finally{if(a)throw u}}return r}}function RL(e){if(Array.isArray(e))return e}function Rj(e){var t=nu(e,2),r=t[0],n=t[1],a=r,u=n;return r>n&&(a=n,u=r),[a,u]}function Dj(e,t,r){if(e.lte(0))return new Be(0);var n=Ac.getDigitCount(e.toNumber()),a=new Be(10).pow(n),u=e.div(a),l=n!==1?.05:.1,c=new Be(Math.ceil(u.div(l).toNumber())).add(r).mul(l),f=c.mul(a);return t?f:new Be(Math.ceil(f))}function DL(e,t,r){var n=1,a=new Be(e);if(!a.isint()&&r){var u=Math.abs(e);u<1?(n=new Be(10).pow(Ac.getDigitCount(e)-1),a=new Be(Math.floor(a.div(n).toNumber())).mul(n)):u>1&&(a=new Be(Math.floor(e)))}else e===0?a=new Be(Math.floor((t-1)/2)):r||(a=new Be(Math.floor(e)));var l=Math.floor((t-1)/2),c=PL(OL(function(f){return a.add(new Be(f-l).mul(n)).toNumber()}),dm);return c(0,t)}function Lj(e,t,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new Be(0),tickMin:new Be(0),tickMax:new Be(0)};var u=Dj(new Be(t).sub(e).div(r-1),n,a),l;e<=0&&t>=0?l=new Be(0):(l=new Be(e).add(t).div(2),l=l.sub(new Be(l).mod(u)));var c=Math.ceil(l.sub(e).div(u).toNumber()),f=Math.ceil(new Be(t).sub(l).div(u).toNumber()),d=c+f+1;return d>r?Lj(e,t,r,n,a+1):(d0?f+(r-d):f,c=t>0?c:c+(r-d)),{step:u,tickMin:l.sub(new Be(c).mul(u)),tickMax:l.add(new Be(f).mul(u))})}function LL(e){var t=nu(e,2),r=t[0],n=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(a,2),c=Rj([r,n]),f=nu(c,2),d=f[0],h=f[1];if(d===-1/0||h===1/0){var v=h===1/0?[d].concat(hm(dm(0,a-1).map(function(){return 1/0}))):[].concat(hm(dm(0,a-1).map(function(){return-1/0})),[h]);return r>n?pm(v):v}if(d===h)return DL(d,a,u);var m=Lj(d,h,l,u),x=m.step,S=m.tickMin,w=m.tickMax,b=Ac.rangeStep(S,w.add(new Be(.1).mul(x)),x);return r>n?pm(b):b}function BL(e,t){var r=nu(e,2),n=r[0],a=r[1],u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Rj([n,a]),c=nu(l,2),f=c[0],d=c[1];if(f===-1/0||d===1/0)return[n,a];if(f===d)return[f];var h=Math.max(t,2),v=Dj(new Be(d).sub(f).div(h-1),u,0),m=[].concat(hm(Ac.rangeStep(new Be(f),new Be(d).sub(new Be(.99).mul(v)),v)),[d]);return n>a?pm(m):m}var qL=Ij(LL),zL=Ij(BL),FL="Invariant failed";function yi(e,t){throw new Error(FL)}var UL=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function da(e){"@babel/helpers - typeof";return da=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},da(e)}function Is(){return Is=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 YL(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 QL(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZL(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]:[],a=arguments.length>2?arguments[2]:void 0,u=arguments.length>3?arguments[3]:void 0,l=-1,c=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(c<=1)return 0;if(u&&u.axisType==="angleAxis"&&Math.abs(Math.abs(u.range[1]-u.range[0])-360)<=1e-6)for(var f=u.range,d=0;d0?a[d-1].coordinate:a[c-1].coordinate,v=a[d].coordinate,m=d>=c-1?a[0].coordinate:a[d+1].coordinate,x=void 0;if(Or(v-h)!==Or(m-v)){var S=[];if(Or(m-v)===Or(f[1]-f[0])){x=m;var w=v+f[1]-f[0];S[0]=Math.min(w,(w+h)/2),S[1]=Math.max(w,(w+h)/2)}else{x=h;var b=m+f[1]-f[0];S[0]=Math.min(v,(b+v)/2),S[1]=Math.max(v,(b+v)/2)}var P=[Math.min(v,(x+v)/2),Math.max(v,(x+v)/2)];if(t>P[0]&&t<=P[1]||t>=S[0]&&t<=S[1]){l=a[d].index;break}}else{var E=Math.min(h,m),j=Math.max(h,m);if(t>(E+v)/2&&t<=(j+v)/2){l=a[d].index;break}}}else for(var T=0;T0&&T(n[T].coordinate+n[T-1].coordinate)/2&&t<=(n[T].coordinate+n[T+1].coordinate)/2||T===c-1&&t>(n[T].coordinate+n[T-1].coordinate)/2){l=n[T].index;break}return l},Kg=function(t){var r,n=t,a=n.type.displayName,u=(r=t.type)!==null&&r!==void 0&&r.defaultProps?rt(rt({},t.type.defaultProps),t.props):t.props,l=u.stroke,c=u.fill,f;switch(a){case"Line":f=l;break;case"Area":case"Radar":f=l&&l!=="none"?l:c;break;default:f=c;break}return f},vB=function(t){var r=t.barSize,n=t.totalSize,a=t.stackGroups,u=a===void 0?{}:a;if(!u)return{};for(var l={},c=Object.keys(u),f=0,d=c.length;f=0});if(P&&P.length){var E=P[0].type.defaultProps,j=E!==void 0?rt(rt({},E),P[0].props):P[0].props,T=j.barSize,_=j[b];l[_]||(l[_]=[]);var O=Ce(T)?r:T;l[_].push({item:P[0],stackList:P.slice(1),barSize:Ce(O)?void 0:hi(O,n,0)})}}return l},yB=function(t){var r=t.barGap,n=t.barCategoryGap,a=t.bandSize,u=t.sizeList,l=u===void 0?[]:u,c=t.maxBarSize,f=l.length;if(f<1)return null;var d=hi(r,a,0,!0),h,v=[];if(l[0].barSize===+l[0].barSize){var m=!1,x=a/f,S=l.reduce(function(T,_){return T+_.barSize||0},0);S+=(f-1)*d,S>=a&&(S-=(f-1)*d,d=0),S>=a&&x>0&&(m=!0,x*=.9,S=f*x);var w=(a-S)/2>>0,b={offset:w-d,size:0};h=l.reduce(function(T,_){var O={item:_.item,position:{offset:b.offset+b.size+d,size:m?x:_.barSize}},k=[].concat(UO(T),[O]);return b=k[k.length-1].position,_.stackList&&_.stackList.length&&_.stackList.forEach(function(N){k.push({item:N,position:b})}),k},v)}else{var P=hi(n,a,0,!0);a-2*P-(f-1)*d<=0&&(d=0);var E=(a-2*P-(f-1)*d)/f;E>1&&(E>>=0);var j=c===+c?Math.min(E,c):E;h=l.reduce(function(T,_,O){var k=[].concat(UO(T),[{item:_.item,position:{offset:P+(E+d)*O+(E-j)/2,size:j}}]);return _.stackList&&_.stackList.length&&_.stackList.forEach(function(N){k.push({item:N,position:k[k.length-1].position})}),k},v)}return h},mB=function(t,r,n,a){var u=n.children,l=n.width,c=n.margin,f=l-(c.left||0)-(c.right||0),d=Fj({children:u,legendWidth:f});if(d){var h=a||{},v=h.width,m=h.height,x=d.align,S=d.verticalAlign,w=d.layout;if((w==="vertical"||w==="horizontal"&&S==="middle")&&x!=="center"&&se(t[x]))return rt(rt({},t),{},na({},x,t[x]+(v||0)));if((w==="horizontal"||w==="vertical"&&x==="center")&&S!=="middle"&&se(t[S]))return rt(rt({},t),{},na({},S,t[S]+(m||0)))}return t},gB=function(t,r,n){return Ce(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},Uj=function(t,r,n,a,u){var l=r.props.children,c=Pr(l,Ec).filter(function(d){return gB(a,u,d.props.direction)});if(c&&c.length){var f=c.map(function(d){return d.props.dataKey});return t.reduce(function(d,h){var v=Qt(h,n);if(Ce(v))return d;var m=Array.isArray(v)?[Oc(v),Nn(v)]:[v,v],x=f.reduce(function(S,w){var b=Qt(h,w,0),P=m[0]-Math.abs(Array.isArray(b)?b[0]:b),E=m[1]+Math.abs(Array.isArray(b)?b[1]:b);return[Math.min(P,S[0]),Math.max(E,S[1])]},[1/0,-1/0]);return[Math.min(x[0],d[0]),Math.max(x[1],d[1])]},[1/0,-1/0])}return null},bB=function(t,r,n,a,u){var l=r.map(function(c){return Uj(t,c,n,u,a)}).filter(function(c){return!Ce(c)});return l&&l.length?l.reduce(function(c,f){return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]):null},Wj=function(t,r,n,a,u){var l=r.map(function(f){var d=f.props.dataKey;return n==="number"&&d&&Uj(t,f,d,a)||qo(t,d,n,u)});if(n==="number")return l.reduce(function(f,d){return[Math.min(f[0],d[0]),Math.max(f[1],d[1])]},[1/0,-1/0]);var c={};return l.reduce(function(f,d){for(var h=0,v=d.length;h=2?Or(c[0]-c[1])*2*d:d,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(v){var m=u?u.indexOf(v):v;return{coordinate:a(m)+d,value:v,offset:d}});return h.filter(function(v){return!ja(v.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(v,m){return{coordinate:a(v)+d,value:v,index:m,offset:d}}):a.ticks&&!n?a.ticks(t.tickCount).map(function(v){return{coordinate:a(v)+d,value:v,offset:d}}):a.domain().map(function(v,m){return{coordinate:a(v)+d,value:u?u[v]:v,index:m,offset:d}})},ay=new WeakMap,Zl=function(t,r){if(typeof r!="function")return t;ay.has(t)||ay.set(t,new WeakMap);var n=ay.get(t);if(n.has(r))return n.get(r);var a=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},xB=function(t,r,n){var a=t.scale,u=t.type,l=t.layout,c=t.axisType;if(a==="auto")return l==="radial"&&c==="radiusAxis"?{scale:Yo(),realScaleType:"band"}:l==="radial"&&c==="angleAxis"?{scale:Ts(),realScaleType:"linear"}:u==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Bo(),realScaleType:"point"}:u==="category"?{scale:Yo(),realScaleType:"band"}:{scale:Ts(),realScaleType:"linear"};if(pi(a)){var f="scale".concat(fc(a));return{scale:(TO[f]||Bo)(),realScaleType:TO[f]?f:"point"}}return Ae(a)?{scale:a}:{scale:Bo(),realScaleType:"point"}},HO=1e-4,wB=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,a=t.range(),u=Math.min(a[0],a[1])-HO,l=Math.max(a[0],a[1])+HO,c=t(r[0]),f=t(r[n-1]);(cl||fl)&&t.domain([r[0],r[n-1]])}},SB=function(t,r){if(!t)return null;for(var n=0,a=t.length;na)&&(u[1]=a),u[0]>a&&(u[0]=a),u[1]=0?(t[c][n][0]=u,t[c][n][1]=u+f,u=t[c][n][1]):(t[c][n][0]=l,t[c][n][1]=l+f,l=t[c][n][1])}},PB=function(t){var r=t.length;if(!(r<=0))for(var n=0,a=t[0].length;n=0?(t[l][n][0]=u,t[l][n][1]=u+c,u=t[l][n][1]):(t[l][n][0]=0,t[l][n][1]=0)}},AB={sign:OB,expand:lN,none:ia,silhouette:sN,wiggle:cN,positive:PB},EB=function(t,r,n){var a=r.map(function(c){return c.props.dataKey}),u=AB[n],l=uN().keys(a).value(function(c,f){return+Qt(c,f,0)}).order(Ky).offset(u);return l(t)},jB=function(t,r,n,a,u,l){if(!t)return null;var c=l?r.reverse():r,f={},d=c.reduce(function(v,m){var x,S=(x=m.type)!==null&&x!==void 0&&x.defaultProps?rt(rt({},m.type.defaultProps),m.props):m.props,w=S.stackId,b=S.hide;if(b)return v;var P=S[n],E=v[P]||{hasStack:!1,stackGroups:{}};if(dt(w)){var j=E.stackGroups[w]||{numericAxisId:n,cateAxisId:a,items:[]};j.items.push(m),E.hasStack=!0,E.stackGroups[w]=j}else E.stackGroups[Eu("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[m]};return rt(rt({},v),{},na({},P,E))},f),h={};return Object.keys(d).reduce(function(v,m){var x=d[m];if(x.hasStack){var S={};x.stackGroups=Object.keys(x.stackGroups).reduce(function(w,b){var P=x.stackGroups[b];return rt(rt({},w),{},na({},b,{numericAxisId:n,cateAxisId:a,items:P.items,stackedData:EB(t,P.items,u)}))},S)}return rt(rt({},v),{},na({},m,x))},h)},TB=function(t,r){var n=r.realScaleType,a=r.type,u=r.tickCount,l=r.originalDomain,c=r.allowDecimals,f=n||r.scale;if(f!=="auto"&&f!=="linear")return null;if(u&&a==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var d=t.domain();if(!d.length)return null;var h=qL(d,u,c);return t.domain([Oc(h),Nn(h)]),{niceTicks:h}}if(u&&a==="number"){var v=t.domain(),m=zL(v,u,c);return{niceTicks:m}}return null};function VO(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,u=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ce(a[t.dataKey])){var c=ls(r,"value",a[t.dataKey]);if(c)return c.coordinate+n/2}return r[u]?r[u].coordinate+n/2:null}var f=Qt(a,Ce(l)?t.dataKey:l);return Ce(f)?null:t.scale(f)}var KO=function(t){var r=t.axis,n=t.ticks,a=t.offset,u=t.bandSize,l=t.entry,c=t.index;if(r.type==="category")return n[c]?n[c].coordinate+a:null;var f=Qt(l,r.dataKey,r.domain[c]);return Ce(f)?null:r.scale(f)-u/2+a},kB=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),u=Math.max(n[0],n[1]);return a<=0&&u>=0?0:u<0?u:a}return n[0]},CB=function(t,r){var n,a=(n=t.type)!==null&&n!==void 0&&n.defaultProps?rt(rt({},t.type.defaultProps),t.props):t.props,u=a.stackId;if(dt(u)){var l=r[u];if(l){var c=l.items.indexOf(t);return c>=0?l.stackedData[c]:null}}return null},MB=function(t){return t.reduce(function(r,n){return[Oc(n.concat([r[0]]).filter(se)),Nn(n.concat([r[1]]).filter(se))]},[1/0,-1/0])},Kj=function(t,r,n){return Object.keys(t).reduce(function(a,u){var l=t[u],c=l.stackedData,f=c.reduce(function(d,h){var v=MB(h.slice(r,n+1));return[Math.min(d[0],v[0]),Math.max(d[1],v[1])]},[1/0,-1/0]);return[Math.min(f[0],a[0]),Math.max(f[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},GO=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,XO=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,gm=function(t,r,n){if(Ae(t))return t(r,n);if(!Array.isArray(t))return r;var a=[];if(se(t[0]))a[0]=n?t[0]:Math.min(t[0],r[0]);else if(GO.test(t[0])){var u=+GO.exec(t[0])[1];a[0]=r[0]-u}else Ae(t[0])?a[0]=t[0](r[0]):a[0]=r[0];if(se(t[1]))a[1]=n?t[1]:Math.max(t[1],r[1]);else if(XO.test(t[1])){var l=+XO.exec(t[1])[1];a[1]=r[1]+l}else Ae(t[1])?a[1]=t[1](r[1]):a[1]=r[1];return a},Rs=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!n||a>0)return a}if(t&&r&&r.length>=2){for(var u=wg(r,function(v){return v.coordinate}),l=1/0,c=1,f=u.length;cl&&(d=2*Math.PI-d),{radius:c,angle:RB(d),angleInRadian:d}},BB=function(t){var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),u=Math.floor(n/360),l=Math.min(a,u);return{startAngle:r-l*360,endAngle:n-l*360}},qB=function(t,r){var n=r.startAngle,a=r.endAngle,u=Math.floor(n/360),l=Math.floor(a/360),c=Math.min(u,l);return t+c*360},JO=function(t,r){var n=t.x,a=t.y,u=LB({x:n,y:a},r),l=u.radius,c=u.angle,f=r.innerRadius,d=r.outerRadius;if(ld)return!1;if(l===0)return!0;var h=BB(r),v=h.startAngle,m=h.endAngle,x=c,S;if(v<=m){for(;x>m;)x-=360;for(;x=v&&x<=m}else{for(;x>v;)x-=360;for(;x=m&&x<=v}return S?ZO(ZO({},r),{},{radius:l,angle:qB(x,r)}):null};function uu(e){"@babel/helpers - typeof";return uu=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},uu(e)}var zB=["offset"];function FB(e){return VB(e)||HB(e)||WB(e)||UB()}function UB(){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 WB(e,t){if(e){if(typeof e=="string")return bm(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 bm(e,t)}}function HB(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function VB(e){if(Array.isArray(e))return bm(e)}function bm(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 GB(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 eP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function ft(e){for(var t=1;t=0?1:-1,j,T;a==="insideStart"?(j=x+E*l,T=w):a==="insideEnd"?(j=S-E*l,T=!w):a==="end"&&(j=S+E*l,T=w),T=P<=0?T:!T;var _=_t(d,h,b,j),O=_t(d,h,b,j+(T?1:-1)*359),k="M".concat(_.x,",").concat(_.y,` - A`).concat(b,",").concat(b,",0,1,").concat(T?0:1,`, - `).concat(O.x,",").concat(O.y),N=Ce(t.id)?Eu("recharts-radial-line-"):t.id;return B.createElement("text",lu({},n,{dominantBaseline:"central",className:Ne("recharts-radial-bar-label",c)}),B.createElement("defs",null,B.createElement("path",{id:N,d:k})),B.createElement("textPath",{xlinkHref:"#".concat(N)},r))},t4=function(t){var r=t.viewBox,n=t.offset,a=t.position,u=r,l=u.cx,c=u.cy,f=u.innerRadius,d=u.outerRadius,h=u.startAngle,v=u.endAngle,m=(h+v)/2;if(a==="outside"){var x=_t(l,c,d+n,m),S=x.x,w=x.y;return{x:S,y:w,textAnchor:S>=l?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:l,y:c,textAnchor:"middle",verticalAnchor:"end"};var b=(f+d)/2,P=_t(l,c,b,m),E=P.x,j=P.y;return{x:E,y:j,textAnchor:"middle",verticalAnchor:"middle"}},r4=function(t){var r=t.viewBox,n=t.parentViewBox,a=t.offset,u=t.position,l=r,c=l.x,f=l.y,d=l.width,h=l.height,v=h>=0?1:-1,m=v*a,x=v>0?"end":"start",S=v>0?"start":"end",w=d>=0?1:-1,b=w*a,P=w>0?"end":"start",E=w>0?"start":"end";if(u==="top"){var j={x:c+d/2,y:f-v*a,textAnchor:"middle",verticalAnchor:x};return ft(ft({},j),n?{height:Math.max(f-n.y,0),width:d}:{})}if(u==="bottom"){var T={x:c+d/2,y:f+h+m,textAnchor:"middle",verticalAnchor:S};return ft(ft({},T),n?{height:Math.max(n.y+n.height-(f+h),0),width:d}:{})}if(u==="left"){var _={x:c-b,y:f+h/2,textAnchor:P,verticalAnchor:"middle"};return ft(ft({},_),n?{width:Math.max(_.x-n.x,0),height:h}:{})}if(u==="right"){var O={x:c+d+b,y:f+h/2,textAnchor:E,verticalAnchor:"middle"};return ft(ft({},O),n?{width:Math.max(n.x+n.width-O.x,0),height:h}:{})}var k=n?{width:d,height:h}:{};return u==="insideLeft"?ft({x:c+b,y:f+h/2,textAnchor:E,verticalAnchor:"middle"},k):u==="insideRight"?ft({x:c+d-b,y:f+h/2,textAnchor:P,verticalAnchor:"middle"},k):u==="insideTop"?ft({x:c+d/2,y:f+m,textAnchor:"middle",verticalAnchor:S},k):u==="insideBottom"?ft({x:c+d/2,y:f+h-m,textAnchor:"middle",verticalAnchor:x},k):u==="insideTopLeft"?ft({x:c+b,y:f+m,textAnchor:E,verticalAnchor:S},k):u==="insideTopRight"?ft({x:c+d-b,y:f+m,textAnchor:P,verticalAnchor:S},k):u==="insideBottomLeft"?ft({x:c+b,y:f+h-m,textAnchor:E,verticalAnchor:x},k):u==="insideBottomRight"?ft({x:c+d-b,y:f+h-m,textAnchor:P,verticalAnchor:x},k):Ea(u)&&(se(u.x)||ai(u.x))&&(se(u.y)||ai(u.y))?ft({x:c+hi(u.x,d),y:f+hi(u.y,h),textAnchor:"end",verticalAnchor:"end"},k):ft({x:c+d/2,y:f+h/2,textAnchor:"middle",verticalAnchor:"middle"},k)},n4=function(t){return"cx"in t&&se(t.cx)};function kt(e){var t=e.offset,r=t===void 0?5:t,n=KB(e,zB),a=ft({offset:r},n),u=a.viewBox,l=a.position,c=a.value,f=a.children,d=a.content,h=a.className,v=h===void 0?"":h,m=a.textBreakAll;if(!u||Ce(c)&&Ce(f)&&!W.isValidElement(d)&&!Ae(d))return null;if(W.isValidElement(d))return W.cloneElement(d,a);var x;if(Ae(d)){if(x=W.createElement(d,a),W.isValidElement(x))return x}else x=ZB(a);var S=n4(u),w=ke(a,!0);if(S&&(l==="insideStart"||l==="insideEnd"||l==="end"))return e4(a,x,w);var b=S?t4(a):r4(a);return B.createElement(ws,lu({className:Ne("recharts-label",v)},w,b,{breakAll:m}),x)}kt.displayName="Label";var Xj=function(t){var r=t.cx,n=t.cy,a=t.angle,u=t.startAngle,l=t.endAngle,c=t.r,f=t.radius,d=t.innerRadius,h=t.outerRadius,v=t.x,m=t.y,x=t.top,S=t.left,w=t.width,b=t.height,P=t.clockWise,E=t.labelViewBox;if(E)return E;if(se(w)&&se(b)){if(se(v)&&se(m))return{x:v,y:m,width:w,height:b};if(se(x)&&se(S))return{x,y:S,width:w,height:b}}return se(v)&&se(m)?{x:v,y:m,width:0,height:0}:se(r)&&se(n)?{cx:r,cy:n,startAngle:u||a||0,endAngle:l||a||0,innerRadius:d||0,outerRadius:h||f||c||0,clockWise:P}:t.viewBox?t.viewBox:{}},i4=function(t,r){return t?t===!0?B.createElement(kt,{key:"label-implicit",viewBox:r}):dt(t)?B.createElement(kt,{key:"label-implicit",viewBox:r,value:t}):W.isValidElement(t)?t.type===kt?W.cloneElement(t,{key:"label-implicit",viewBox:r}):B.createElement(kt,{key:"label-implicit",content:t,viewBox:r}):Ae(t)?B.createElement(kt,{key:"label-implicit",content:t,viewBox:r}):Ea(t)?B.createElement(kt,lu({viewBox:r},t,{key:"label-implicit"})):null:null},a4=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 a=t.children,u=Xj(t),l=Pr(a,kt).map(function(f,d){return W.cloneElement(f,{viewBox:r||u,key:"label-".concat(d)})});if(!n)return l;var c=i4(t.label,r||u);return[c].concat(FB(l))};kt.parseViewBox=Xj;kt.renderCallByParent=a4;var oy,tP;function o4(){if(tP)return oy;tP=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return oy=e,oy}var u4=o4();const l4=Fe(u4);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)}var s4=["valueAccessor"],c4=["data","dataKey","clockWise","id","textBreakAll"];function f4(e){return v4(e)||h4(e)||p4(e)||d4()}function d4(){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 p4(e,t){if(e){if(typeof e=="string")return xm(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 xm(e,t)}}function h4(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function v4(e){if(Array.isArray(e))return xm(e)}function xm(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 b4(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 x4=function(t){return Array.isArray(t.value)?l4(t.value):t.value};function Rn(e){var t=e.valueAccessor,r=t===void 0?x4:t,n=iP(e,s4),a=n.data,u=n.dataKey,l=n.clockWise,c=n.id,f=n.textBreakAll,d=iP(n,c4);return!a||!a.length?null:B.createElement(Ze,{className:"recharts-label-list"},a.map(function(h,v){var m=Ce(u)?r(h,v):Qt(h&&h.payload,u),x=Ce(c)?{}:{id:"".concat(c,"-").concat(v)};return B.createElement(kt,Ls({},ke(h,!0),d,x,{parentViewBox:h.parentViewBox,value:m,textBreakAll:f,viewBox:kt.parseViewBox(Ce(l)?h:nP(nP({},h),{},{clockWise:l})),key:"label-".concat(v),index:v}))}))}Rn.displayName="LabelList";function w4(e,t){return e?e===!0?B.createElement(Rn,{key:"labelList-implicit",data:t}):B.isValidElement(e)||Ae(e)?B.createElement(Rn,{key:"labelList-implicit",data:t,content:e}):Ea(e)?B.createElement(Rn,Ls({data:t},e,{key:"labelList-implicit"})):null:null}function S4(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,a=Pr(n,Rn).map(function(l,c){return W.cloneElement(l,{data:t,key:"labelList-".concat(c)})});if(!r)return a;var u=w4(e.label,t);return[u].concat(f4(a))}Rn.renderCallByParent=S4;function cu(e){"@babel/helpers - typeof";return cu=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},cu(e)}function wm(){return wm=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(l>d),`, - `).concat(v.x,",").concat(v.y,` - `);if(a>0){var x=_t(r,n,a,l),S=_t(r,n,a,d);m+="L ".concat(S.x,",").concat(S.y,` - A `).concat(a,",").concat(a,`,0, - `).concat(+(Math.abs(f)>180),",").concat(+(l<=d),`, - `).concat(x.x,",").concat(x.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},E4=function(t){var r=t.cx,n=t.cy,a=t.innerRadius,u=t.outerRadius,l=t.cornerRadius,c=t.forceCornerRadius,f=t.cornerIsExternal,d=t.startAngle,h=t.endAngle,v=Or(h-d),m=Jl({cx:r,cy:n,radius:u,angle:d,sign:v,cornerRadius:l,cornerIsExternal:f}),x=m.circleTangency,S=m.lineTangency,w=m.theta,b=Jl({cx:r,cy:n,radius:u,angle:h,sign:-v,cornerRadius:l,cornerIsExternal:f}),P=b.circleTangency,E=b.lineTangency,j=b.theta,T=f?Math.abs(d-h):Math.abs(d-h)-w-j;if(T<0)return c?"M ".concat(S.x,",").concat(S.y,` - a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0 - a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0 - `):Yj({cx:r,cy:n,innerRadius:a,outerRadius:u,startAngle:d,endAngle:h});var _="M ".concat(S.x,",").concat(S.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(x.x,",").concat(x.y,` - A`).concat(u,",").concat(u,",0,").concat(+(T>180),",").concat(+(v<0),",").concat(P.x,",").concat(P.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(E.x,",").concat(E.y,` - `);if(a>0){var O=Jl({cx:r,cy:n,radius:a,angle:d,sign:v,isExternal:!0,cornerRadius:l,cornerIsExternal:f}),k=O.circleTangency,N=O.lineTangency,$=O.theta,X=Jl({cx:r,cy:n,radius:a,angle:h,sign:-v,isExternal:!0,cornerRadius:l,cornerIsExternal:f}),q=X.circleTangency,L=X.lineTangency,H=X.theta,Y=f?Math.abs(d-h):Math.abs(d-h)-$-H;if(Y<0&&l===0)return"".concat(_,"L").concat(r,",").concat(n,"Z");_+="L".concat(L.x,",").concat(L.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(q.x,",").concat(q.y,` - A`).concat(a,",").concat(a,",0,").concat(+(Y>180),",").concat(+(v>0),",").concat(k.x,",").concat(k.y,` - A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(N.x,",").concat(N.y,"Z")}else _+="L".concat(r,",").concat(n,"Z");return _},j4={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Qj=function(t){var r=oP(oP({},j4),t),n=r.cx,a=r.cy,u=r.innerRadius,l=r.outerRadius,c=r.cornerRadius,f=r.forceCornerRadius,d=r.cornerIsExternal,h=r.startAngle,v=r.endAngle,m=r.className;if(l0&&Math.abs(h-v)<360?b=E4({cx:n,cy:a,innerRadius:u,outerRadius:l,cornerRadius:Math.min(w,S/2),forceCornerRadius:f,cornerIsExternal:d,startAngle:h,endAngle:v}):b=Yj({cx:n,cy:a,innerRadius:u,outerRadius:l,startAngle:h,endAngle:v}),B.createElement("path",wm({},ke(r,!0),{className:x,d:b,role:"img"}))};function fu(e){"@babel/helpers - typeof";return fu=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},fu(e)}function Sm(){return Sm=Object.assign?Object.assign.bind():function(e){for(var t=1;tq4.call(e,t));function wi(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const U4="__v",W4="__o",H4="_owner",{getOwnPropertyDescriptor:hP,keys:vP}=Object;function V4(e,t){return e.byteLength===t.byteLength&&Bs(new Uint8Array(e),new Uint8Array(t))}function K4(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 G4(e,t){return e.byteLength===t.byteLength&&Bs(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function X4(e,t){return wi(e.getTime(),t.getTime())}function Y4(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function Q4(e,t){return e===t}function yP(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),u=e.entries();let l,c,f=0;for(;(l=u.next())&&!l.done;){const d=t.entries();let h=!1,v=0;for(;(c=d.next())&&!c.done;){if(a[v]){v++;continue}const m=l.value,x=c.value;if(r.equals(m[0],x[0],f,v,e,t,r)&&r.equals(m[1],x[1],m[0],x[0],e,t,r)){h=a[v]=!0;break}v++}if(!h)return!1;f++}return!0}const Z4=wi;function J4(e,t,r){const n=vP(e);let a=n.length;if(vP(t).length!==a)return!1;for(;a-- >0;)if(!Zj(e,t,r,n[a]))return!1;return!0}function Mo(e,t,r){const n=pP(e);let a=n.length;if(pP(t).length!==a)return!1;let u,l,c;for(;a-- >0;)if(u=n[a],!Zj(e,t,r,u)||(l=hP(e,u),c=hP(t,u),(l||c)&&(!l||!c||l.configurable!==c.configurable||l.enumerable!==c.enumerable||l.writable!==c.writable)))return!1;return!0}function eq(e,t){return wi(e.valueOf(),t.valueOf())}function tq(e,t){return e.source===t.source&&e.flags===t.flags}function mP(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const a=new Array(n),u=e.values();let l,c;for(;(l=u.next())&&!l.done;){const f=t.values();let d=!1,h=0;for(;(c=f.next())&&!c.done;){if(!a[h]&&r.equals(l.value,c.value,l.value,c.value,e,t,r)){d=a[h]=!0;break}h++}if(!d)return!1}return!0}function Bs(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 rq(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 Zj(e,t,r,n){return(n===H4||n===W4||n===U4)&&(e.$$typeof||t.$$typeof)?!0:F4(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const nq="[object ArrayBuffer]",iq="[object Arguments]",aq="[object Boolean]",oq="[object DataView]",uq="[object Date]",lq="[object Error]",sq="[object Map]",cq="[object Number]",fq="[object Object]",dq="[object RegExp]",pq="[object Set]",hq="[object String]",vq={"[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},yq="[object URL]",mq=Object.prototype.toString;function gq({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:u,areMapsEqual:l,areNumbersEqual:c,areObjectsEqual:f,arePrimitiveWrappersEqual:d,areRegExpsEqual:h,areSetsEqual:v,areTypedArraysEqual:m,areUrlsEqual:x,unknownTagComparators:S}){return function(b,P,E){if(b===P)return!0;if(b==null||P==null)return!1;const j=typeof b;if(j!==typeof P)return!1;if(j!=="object")return j==="number"?c(b,P,E):j==="function"?u(b,P,E):!1;const T=b.constructor;if(T!==P.constructor)return!1;if(T===Object)return f(b,P,E);if(Array.isArray(b))return t(b,P,E);if(T===Date)return n(b,P,E);if(T===RegExp)return h(b,P,E);if(T===Map)return l(b,P,E);if(T===Set)return v(b,P,E);const _=mq.call(b);if(_===uq)return n(b,P,E);if(_===dq)return h(b,P,E);if(_===sq)return l(b,P,E);if(_===pq)return v(b,P,E);if(_===fq)return typeof b.then!="function"&&typeof P.then!="function"&&f(b,P,E);if(_===yq)return x(b,P,E);if(_===lq)return a(b,P,E);if(_===iq)return f(b,P,E);if(vq[_])return m(b,P,E);if(_===nq)return e(b,P,E);if(_===oq)return r(b,P,E);if(_===aq||_===cq||_===hq)return d(b,P,E);if(S){let O=S[_];if(!O){const k=z4(b);k&&(O=S[k])}if(O)return O(b,P,E)}return!1}}function bq({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:V4,areArraysEqual:r?Mo:K4,areDataViewsEqual:G4,areDatesEqual:X4,areErrorsEqual:Y4,areFunctionsEqual:Q4,areMapsEqual:r?cy(yP,Mo):yP,areNumbersEqual:Z4,areObjectsEqual:r?Mo:J4,arePrimitiveWrappersEqual:eq,areRegExpsEqual:tq,areSetsEqual:r?cy(mP,Mo):mP,areTypedArraysEqual:r?cy(Bs,Mo):Bs,areUrlsEqual:rq,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const a=ts(n.areArraysEqual),u=ts(n.areMapsEqual),l=ts(n.areObjectsEqual),c=ts(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:u,areObjectsEqual:l,areSetsEqual:c})}return n}function xq(e){return function(t,r,n,a,u,l,c){return e(t,r,c)}}function wq({circular:e,comparator:t,createState:r,equals:n,strict:a}){if(r)return function(c,f){const{cache:d=e?new WeakMap:void 0,meta:h}=r();return t(c,f,{cache:d,equals:n,meta:h,strict:a})};if(e)return function(c,f){return t(c,f,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const u={cache:void 0,equals:n,meta:void 0,strict:a};return function(c,f){return t(c,f,u)}}const Sq=zn();zn({strict:!0});zn({circular:!0});zn({circular:!0,strict:!0});zn({createInternalComparator:()=>wi});zn({strict:!0,createInternalComparator:()=>wi});zn({circular:!0,createInternalComparator:()=>wi});zn({circular:!0,createInternalComparator:()=>wi,strict:!0});function zn(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:a=!1}=e,u=bq(e),l=gq(u),c=r?r(l):xq(l);return wq({circular:t,comparator:l,createState:n,equals:c,strict:a})}function _q(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function gP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(u){r<0&&(r=u),u-r>t?(e(u),r=-1):_q(a)};requestAnimationFrame(n)}function _m(e){"@babel/helpers - typeof";return _m=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},_m(e)}function Oq(e){return jq(e)||Eq(e)||Aq(e)||Pq()}function Pq(){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 Aq(e,t){if(e){if(typeof e=="string")return bP(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 bP(e,t)}}function bP(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:P<0?0:P},w=function(P){for(var E=P>1?1:P,j=E,T=0;T<8;++T){var _=v(j)-E,O=x(j);if(Math.abs(_-E)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,u=a===void 0?8:a,l=t.dt,c=l===void 0?17:l,f=function(h,v,m){var x=-(h-v)*n,S=m*u,w=m+(x-S)*c/1e3,b=m*c/1e3+h;return Math.abs(b-v)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 az(e,t){if(e==null)return{};var r={},n=Object.keys(e),a,u;for(u=0;u=0)&&(r[a]=e[a]);return r}function fy(e){return sz(e)||lz(e)||uz(e)||oz()}function oz(){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 uz(e,t){if(e){if(typeof e=="string")return jm(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 jm(e,t)}}function lz(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sz(e){if(Array.isArray(e))return jm(e)}function jm(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 Fs(e){return Fs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fs(e)}var un=(function(e){hz(r,e);var t=vz(r);function r(n,a){var u;cz(this,r),u=t.call(this,n,a);var l=u.props,c=l.isActive,f=l.attributeName,d=l.from,h=l.to,v=l.steps,m=l.children,x=l.duration;if(u.handleStyleChange=u.handleStyleChange.bind(Cm(u)),u.changeStyle=u.changeStyle.bind(Cm(u)),!c||x<=0)return u.state={style:{}},typeof m=="function"&&(u.state={style:h}),km(u);if(v&&v.length)u.state={style:v[0].style};else if(d){if(typeof m=="function")return u.state={style:d},km(u);u.state={style:f?Do({},f,d):d}}else u.state={style:{}};return u}return dz(r,[{key:"componentDidMount",value:function(){var a=this.props,u=a.isActive,l=a.canBegin;this.mounted=!0,!(!u||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var u=this.props,l=u.isActive,c=u.canBegin,f=u.attributeName,d=u.shouldReAnimate,h=u.to,v=u.from,m=this.state.style;if(c){if(!l){var x={style:f?Do({},f,h):h};this.state&&m&&(f&&m[f]!==h||!f&&m!==h)&&this.setState(x);return}if(!(Sq(a.to,h)&&a.canBegin&&a.isActive)){var S=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=S||d?v:a.to;if(this.state&&m){var b={style:f?Do({},f,w):w};(f&&m[f]!==w||!f&&m!==w)&&this.setState(b)}this.runAnimation(wr(wr({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var u=this,l=a.from,c=a.to,f=a.duration,d=a.easing,h=a.begin,v=a.onAnimationEnd,m=a.onAnimationStart,x=rz(l,c,Hq(d),f,this.changeStyle),S=function(){u.stopJSAnimation=x()};this.manager.start([m,h,S,f,v])}},{key:"runStepAnimation",value:function(a){var u=this,l=a.steps,c=a.begin,f=a.onAnimationStart,d=l[0],h=d.style,v=d.duration,m=v===void 0?0:v,x=function(w,b,P){if(P===0)return w;var E=b.duration,j=b.easing,T=j===void 0?"ease":j,_=b.style,O=b.properties,k=b.onAnimationEnd,N=P>0?l[P-1]:b,$=O||Object.keys(_);if(typeof T=="function"||T==="spring")return[].concat(fy(w),[u.runJSAnimation.bind(u,{from:N.style,to:_,duration:E,easing:T}),E]);var X=SP($,E,T),q=wr(wr(wr({},N.style),_),{},{transition:X});return[].concat(fy(w),[q,E,k]).filter(Nq)};return this.manager.start([f].concat(fy(l.reduce(x,[h,Math.max(m,c)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=Tq());var u=a.begin,l=a.duration,c=a.attributeName,f=a.to,d=a.easing,h=a.onAnimationStart,v=a.onAnimationEnd,m=a.steps,x=a.children,S=this.manager;if(this.unSubscribe=S.subscribe(this.handleStyleChange),typeof d=="function"||typeof x=="function"||d==="spring"){this.runJSAnimation(a);return}if(m.length>1){this.runStepAnimation(a);return}var w=c?Do({},c,f):f,b=SP(Object.keys(w),l,d);S.start([h,u,wr(wr({},w),{},{transition:b}),l,v])}},{key:"render",value:function(){var a=this.props,u=a.children;a.begin;var l=a.duration;a.attributeName,a.easing;var c=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var f=iz(a,nz),d=W.Children.count(u),h=this.state.style;if(typeof u=="function")return u(h);if(!c||d===0||l<=0)return u;var v=function(x){var S=x.props,w=S.style,b=w===void 0?{}:w,P=S.className,E=W.cloneElement(x,wr(wr({},f),{},{style:wr(wr({},b),h),className:P}));return E};return d===1?v(W.Children.only(u)):B.createElement("div",null,W.Children.map(u,function(m){return v(m)}))}}]),r})(W.PureComponent);un.displayName="Animate";un.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};un.propTypes={from:De.oneOfType([De.object,De.string]),to:De.oneOfType([De.object,De.string]),attributeName:De.string,duration:De.number,begin:De.number,easing:De.oneOfType([De.string,De.func]),steps:De.arrayOf(De.shape({duration:De.number.isRequired,style:De.object.isRequired,easing:De.oneOfType([De.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),De.func]),properties:De.arrayOf("string"),onAnimationEnd:De.func})),children:De.oneOfType([De.node,De.func]),isActive:De.bool,canBegin:De.bool,onAnimationEnd:De.func,shouldReAnimate:De.bool,onAnimationStart:De.func,onAnimationReStart:De.func};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 Us(){return Us=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,f=n>=0?1:-1,d=a>=0&&n>=0||a<0&&n<0?1:0,h;if(l>0&&u instanceof Array){for(var v=[0,0,0,0],m=0,x=4;ml?l:u[m];h="M".concat(t,",").concat(r+c*v[0]),v[0]>0&&(h+="A ".concat(v[0],",").concat(v[0],",0,0,").concat(d,",").concat(t+f*v[0],",").concat(r)),h+="L ".concat(t+n-f*v[1],",").concat(r),v[1]>0&&(h+="A ".concat(v[1],",").concat(v[1],",0,0,").concat(d,`, - `).concat(t+n,",").concat(r+c*v[1])),h+="L ".concat(t+n,",").concat(r+a-c*v[2]),v[2]>0&&(h+="A ".concat(v[2],",").concat(v[2],",0,0,").concat(d,`, - `).concat(t+n-f*v[2],",").concat(r+a)),h+="L ".concat(t+f*v[3],",").concat(r+a),v[3]>0&&(h+="A ".concat(v[3],",").concat(v[3],",0,0,").concat(d,`, - `).concat(t,",").concat(r+a-c*v[3])),h+="Z"}else if(l>0&&u===+u&&u>0){var S=Math.min(l,u);h="M ".concat(t,",").concat(r+c*S,` - A `).concat(S,",").concat(S,",0,0,").concat(d,",").concat(t+f*S,",").concat(r,` - L `).concat(t+n-f*S,",").concat(r,` - A `).concat(S,",").concat(S,",0,0,").concat(d,",").concat(t+n,",").concat(r+c*S,` - L `).concat(t+n,",").concat(r+a-c*S,` - A `).concat(S,",").concat(S,",0,0,").concat(d,",").concat(t+n-f*S,",").concat(r+a,` - L `).concat(t+f*S,",").concat(r+a,` - A `).concat(S,",").concat(S,",0,0,").concat(d,",").concat(t,",").concat(r+a-c*S," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return h},Pz=function(t,r){if(!t||!r)return!1;var n=t.x,a=t.y,u=r.x,l=r.y,c=r.width,f=r.height;if(Math.abs(c)>0&&Math.abs(f)>0){var d=Math.min(u,u+c),h=Math.max(u,u+c),v=Math.min(l,l+f),m=Math.max(l,l+f);return n>=d&&n<=h&&a>=v&&a<=m}return!1},Az={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Gg=function(t){var r=kP(kP({},Az),t),n=W.useRef(),a=W.useState(-1),u=mz(a,2),l=u[0],c=u[1];W.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var T=n.current.getTotalLength();T&&c(T)}catch{}},[]);var f=r.x,d=r.y,h=r.width,v=r.height,m=r.radius,x=r.className,S=r.animationEasing,w=r.animationDuration,b=r.animationBegin,P=r.isAnimationActive,E=r.isUpdateAnimationActive;if(f!==+f||d!==+d||h!==+h||v!==+v||h===0||v===0)return null;var j=Ne("recharts-rectangle",x);return E?B.createElement(un,{canBegin:l>0,from:{width:h,height:v,x:f,y:d},to:{width:h,height:v,x:f,y:d},duration:w,animationEasing:S,isActive:E},function(T){var _=T.width,O=T.height,k=T.x,N=T.y;return B.createElement(un,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:w,isActive:P,easing:S},B.createElement("path",Us({},ke(r,!0),{className:j,d:CP(k,N,_,O,m),ref:n})))}):B.createElement("path",Us({},ke(r,!0),{className:j,d:CP(f,d,h,v,m)}))};function Mm(){return Mm=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 Nz(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 Iz=function(t,r,n,a,u,l){return"M".concat(t,",").concat(u,"v").concat(a,"M").concat(l,",").concat(r,"h").concat(n)},$z=function(t){var r=t.x,n=r===void 0?0:r,a=t.y,u=a===void 0?0:a,l=t.top,c=l===void 0?0:l,f=t.left,d=f===void 0?0:f,h=t.width,v=h===void 0?0:h,m=t.height,x=m===void 0?0:m,S=t.className,w=Mz(t,Ez),b=jz({x:n,y:u,top:c,left:d,width:v,height:x},w);return!se(n)||!se(u)||!se(v)||!se(x)||!se(c)||!se(d)?null:B.createElement("path",Nm({},ke(b,!0),{className:Ne("recharts-cross",S),d:Iz(n,u,v,x,c,d)}))},dy,NP;function Rz(){if(NP)return dy;NP=1;var e=PE(),t=e(Object.getPrototypeOf,Object);return dy=t,dy}var py,IP;function Dz(){if(IP)return py;IP=1;var e=ln(),t=Rz(),r=sn(),n="[object Object]",a=Function.prototype,u=Object.prototype,l=a.toString,c=u.hasOwnProperty,f=l.call(Object);function d(h){if(!r(h)||e(h)!=n)return!1;var v=t(h);if(v===null)return!0;var m=c.call(v,"constructor")&&v.constructor;return typeof m=="function"&&m instanceof m&&l.call(m)==f}return py=d,py}var Lz=Dz();const Bz=Fe(Lz);var hy,$P;function qz(){if($P)return hy;$P=1;var e=ln(),t=sn(),r="[object Boolean]";function n(a){return a===!0||a===!1||t(a)&&e(a)==r}return hy=n,hy}var zz=qz();const Fz=Fe(zz);function yu(e){"@babel/helpers - typeof";return yu=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},yu(e)}function Ws(){return Ws=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:m,x:f,y:d},to:{upperWidth:h,lowerWidth:v,height:m,x:f,y:d},duration:w,animationEasing:S,isActive:P},function(j){var T=j.upperWidth,_=j.lowerWidth,O=j.height,k=j.x,N=j.y;return B.createElement(un,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:b,duration:w,easing:S},B.createElement("path",Ws({},ke(r,!0),{className:E,d:BP(k,N,T,_,O),ref:n})))}):B.createElement("g",null,B.createElement("path",Ws({},ke(r,!0),{className:E,d:BP(f,d,h,v,m)})))},Jz=["option","shapeType","propTransformer","activeClassName","isActive"];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)}function e5(e,t){if(e==null)return{};var r=t5(e,t),n,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function t5(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 qP(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Hs(e){for(var t=1;t0&&n.handleDrag(a.changedTouches[0])}),Gt(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,u=a.endIndex,l=a.onDragEnd,c=a.startIndex;l==null||l({endIndex:u,startIndex:c})}),n.detachDragEndListener()}),Gt(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Gt(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Gt(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Gt(n,"handleSlideDragStart",function(a){var u=YP(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:u.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return T5(t,e),P5(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,u=n.endX,l=this.state.scaleValues,c=this.props,f=c.gap,d=c.data,h=d.length-1,v=Math.min(a,u),m=Math.max(a,u),x=t.getIndexInRange(l,v),S=t.getIndexInRange(l,m);return{startIndex:x-x%f,endIndex:S===h?h:S-S%f}}},{key:"getTextOfTick",value:function(n){var a=this.props,u=a.data,l=a.tickFormatter,c=a.dataKey,f=Qt(u[n],c,n);return Ae(l)?l(f,n):f}},{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 a=this.state,u=a.slideMoveStartX,l=a.startX,c=a.endX,f=this.props,d=f.x,h=f.width,v=f.travellerWidth,m=f.startIndex,x=f.endIndex,S=f.onChange,w=n.pageX-u;w>0?w=Math.min(w,d+h-v-c,d+h-v-l):w<0&&(w=Math.max(w,d-l,d-c));var b=this.getIndex({startX:l+w,endX:c+w});(b.startIndex!==m||b.endIndex!==x)&&S&&S(b),this.setState({startX:l+w,endX:c+w,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var u=YP(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:u.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,u=a.brushMoveStartX,l=a.movingTravellerId,c=a.endX,f=a.startX,d=this.state[l],h=this.props,v=h.x,m=h.width,x=h.travellerWidth,S=h.onChange,w=h.gap,b=h.data,P={startX:this.state.startX,endX:this.state.endX},E=n.pageX-u;E>0?E=Math.min(E,v+m-x-d):E<0&&(E=Math.max(E,v-d)),P[l]=d+E;var j=this.getIndex(P),T=j.startIndex,_=j.endIndex,O=function(){var N=b.length-1;return l==="startX"&&(c>f?T%w===0:_%w===0)||cf?_%w===0:T%w===0)||c>f&&_===N};this.setState(Gt(Gt({},l,d+E),"brushMoveStartX",n.pageX),function(){S&&O()&&S(j)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var u=this,l=this.state,c=l.scaleValues,f=l.startX,d=l.endX,h=this.state[a],v=c.indexOf(h);if(v!==-1){var m=v+n;if(!(m===-1||m>=c.length)){var x=c[m];a==="startX"&&x>=d||a==="endX"&&x<=f||this.setState(Gt({},a,x),function(){u.props.onChange(u.getIndex({startX:u.state.startX,endX:u.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,u=n.y,l=n.width,c=n.height,f=n.fill,d=n.stroke;return B.createElement("rect",{stroke:d,fill:f,x:a,y:u,width:l,height:c})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,u=n.y,l=n.width,c=n.height,f=n.data,d=n.children,h=n.padding,v=W.Children.only(d);return v?B.cloneElement(v,{x:a,y:u,width:l,height:c,margin:h,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(n,a){var u,l,c=this,f=this.props,d=f.y,h=f.travellerWidth,v=f.height,m=f.traveller,x=f.ariaLabel,S=f.data,w=f.startIndex,b=f.endIndex,P=Math.max(n,this.props.x),E=by(by({},ke(this.props,!1)),{},{x:P,y:d,width:h,height:v}),j=x||"Min value: ".concat((u=S[w])===null||u===void 0?void 0:u.name,", Max value: ").concat((l=S[b])===null||l===void 0?void 0:l.name);return B.createElement(Ze,{tabIndex:0,role:"slider","aria-label":j,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(_){["ArrowLeft","ArrowRight"].includes(_.key)&&(_.preventDefault(),_.stopPropagation(),c.handleTravellerMoveKeyboard(_.key==="ArrowRight"?1:-1,a))},onFocus:function(){c.setState({isTravellerFocused:!0})},onBlur:function(){c.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,E))}},{key:"renderSlide",value:function(n,a){var u=this.props,l=u.y,c=u.height,f=u.stroke,d=u.travellerWidth,h=Math.min(n,a)+d,v=Math.max(Math.abs(a-n)-d,0);return B.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:h,y:l,width:v,height:c})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,u=n.endIndex,l=n.y,c=n.height,f=n.travellerWidth,d=n.stroke,h=this.state,v=h.startX,m=h.endX,x=5,S={pointerEvents:"none",fill:d};return B.createElement(Ze,{className:"recharts-brush-texts"},B.createElement(ws,Ks({textAnchor:"end",verticalAnchor:"middle",x:Math.min(v,m)-x,y:l+c/2},S),this.getTextOfTick(a)),B.createElement(ws,Ks({textAnchor:"start",verticalAnchor:"middle",x:Math.max(v,m)+f+x,y:l+c/2},S),this.getTextOfTick(u)))}},{key:"render",value:function(){var n=this.props,a=n.data,u=n.className,l=n.children,c=n.x,f=n.y,d=n.width,h=n.height,v=n.alwaysShowText,m=this.state,x=m.startX,S=m.endX,w=m.isTextActive,b=m.isSlideMoving,P=m.isTravellerMoving,E=m.isTravellerFocused;if(!a||!a.length||!se(c)||!se(f)||!se(d)||!se(h)||d<=0||h<=0)return null;var j=Ne("recharts-brush",u),T=B.Children.count(l)===1,_=_5("userSelect","none");return B.createElement(Ze,{className:j,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:_},this.renderBackground(),T&&this.renderPanorama(),this.renderSlide(x,S),this.renderTravellerLayer(x,"startX"),this.renderTravellerLayer(S,"endX"),(w||b||P||E||v)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,u=n.y,l=n.width,c=n.height,f=n.stroke,d=Math.floor(u+c/2)-1;return B.createElement(B.Fragment,null,B.createElement("rect",{x:a,y:u,width:l,height:c,fill:f,stroke:"none"}),B.createElement("line",{x1:a+1,y1:d,x2:a+l-1,y2:d,fill:"none",stroke:"#fff"}),B.createElement("line",{x1:a+1,y1:d+2,x2:a+l-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var u;return B.isValidElement(n)?u=B.cloneElement(n,a):Ae(n)?u=n(a):u=t.renderDefaultTraveller(a),u}},{key:"getDerivedStateFromProps",value:function(n,a){var u=n.data,l=n.width,c=n.x,f=n.travellerWidth,d=n.updateId,h=n.startIndex,v=n.endIndex;if(u!==a.prevData||d!==a.prevUpdateId)return by({prevData:u,prevTravellerWidth:f,prevUpdateId:d,prevX:c,prevWidth:l},u&&u.length?C5({data:u,width:l,x:c,travellerWidth:f,startIndex:h,endIndex:v}):{scale:null,scaleValues:null});if(a.scale&&(l!==a.prevWidth||c!==a.prevX||f!==a.prevTravellerWidth)){a.scale.range([c,c+l-f]);var m=a.scale.domain().map(function(x){return a.scale(x)});return{prevData:u,prevTravellerWidth:f,prevUpdateId:d,prevX:c,prevWidth:l,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,a){for(var u=n.length,l=0,c=u-1;c-l>1;){var f=Math.floor((l+c)/2);n[f]>a?c=f:l=f}return a>=n[c]?c:l}}])})(W.PureComponent);Gt(va,"displayName","Brush");Gt(va,"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 xy,QP;function M5(){if(QP)return xy;QP=1;var e=xg();function t(r,n){var a;return e(r,function(u,l,c){return a=n(u,l,c),!a}),!!a}return xy=t,xy}var wy,ZP;function N5(){if(ZP)return wy;ZP=1;var e=gE(),t=Ln(),r=M5(),n=Ut(),a=mc();function u(l,c,f){var d=n(l)?e:r;return f&&a(l,c,f)&&(c=void 0),d(l,t(c,3))}return wy=u,wy}var I5=N5();const $5=Fe(I5);var Lr=function(t,r){var n=t.alwaysShow,a=t.ifOverflow;return n&&(a="extendDomain"),a===r},Sy,JP;function R5(){if(JP)return Sy;JP=1;var e=RE();function t(r,n,a){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return Sy=t,Sy}var _y,eA;function D5(){if(eA)return _y;eA=1;var e=R5(),t=IE(),r=Ln();function n(a,u){var l={};return u=r(u,3),t(a,function(c,f,d){e(l,f,u(c,f,d))}),l}return _y=n,_y}var L5=D5();const B5=Fe(L5);var Oy,tA;function q5(){if(tA)return Oy;tA=1;function e(t,r){for(var n=-1,a=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function X5(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 Y5(e,t){var r=e.x,n=e.y,a=G5(e,W5),u="".concat(r),l=parseInt(u,10),c="".concat(n),f=parseInt(c,10),d="".concat(t.height||a.height),h=parseInt(d,10),v="".concat(t.width||a.width),m=parseInt(v,10);return No(No(No(No(No({},t),a),l?{x:l}:{}),f?{y:f}:{}),{},{height:h,width:m,name:t.name,radius:t.radius})}function aA(e){return B.createElement(l5,$m({shapeType:"rectangle",propTransformer:Y5,activeClassName:"recharts-active-bar"},e))}var Q5=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof t=="number")return t;var u=se(n)||rM(n);return u?t(n,a):(u||yi(),r)}},Z5=["value","background"],cT;function ya(e){"@babel/helpers - typeof";return ya=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},ya(e)}function J5(e,t){if(e==null)return{};var r=eF(e,t),n,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function eF(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 Xs(){return Xs=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(Q)0&&Math.abs(Y)0&&(H=Math.min((ce||0)-(Y[ve-1]||0),H))}),Number.isFinite(H)){var Q=H/L,J=w.layout==="vertical"?n.height:n.width;if(w.padding==="gap"&&(k=Q*J/2),w.padding==="no-gap"){var te=hi(t.barCategoryGap,Q*J),F=Q*J/2;k=F-te-(F-te)/J*te}}}a==="xAxis"?N=[n.left+(j.left||0)+(k||0),n.left+n.width-(j.right||0)-(k||0)]:a==="yAxis"?N=f==="horizontal"?[n.top+n.height-(j.bottom||0),n.top+(j.top||0)]:[n.top+(j.top||0)+(k||0),n.top+n.height-(j.bottom||0)-(k||0)]:N=w.range,_&&(N=[N[1],N[0]]);var K=xB(w,u,m),G=K.scale,I=K.realScaleType;G.domain(P).range(N),wB(G);var z=TB(G,Sr(Sr({},w),{},{realScaleType:I}));a==="xAxis"?(q=b==="top"&&!T||b==="bottom"&&T,$=n.left,X=v[O]-q*w.height):a==="yAxis"&&(q=b==="left"&&!T||b==="right"&&T,$=v[O]-q*w.width,X=n.top);var ne=Sr(Sr(Sr({},w),z),{},{realScaleType:I,x:$,y:X,scale:G,width:a==="xAxis"?n.width:w.width,height:a==="yAxis"?n.height:w.height});return ne.bandSize=Rs(ne,z),!w.hide&&a==="xAxis"?v[O]+=(q?-1:1)*ne.height:w.hide||(v[O]+=(q?-1:1)*ne.width),Sr(Sr({},x),{},kc({},S,ne))},{})},hT=function(t,r){var n=t.x,a=t.y,u=r.x,l=r.y;return{x:Math.min(n,u),y:Math.min(a,l),width:Math.abs(u-n),height:Math.abs(l-a)}},dF=function(t){var r=t.x1,n=t.y1,a=t.x2,u=t.y2;return hT({x:r,y:n},{x:a,y:u})},vT=(function(){function e(t){lF(this,e),this.scale=t}return sF(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]:{},a=n.bandAware,u=n.position;if(r!==void 0){if(u)switch(u){case"start":return this.scale(r);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+l}case"end":{var c=this.bandwidth?this.bandwidth():0;return this.scale(r)+c}default:return this.scale(r)}if(a){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+f}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],u=n[n.length-1];return a<=u?r>=a&&r<=u:r>=u&&r<=a}}],[{key:"create",value:function(r){return new e(r)}}])})();kc(vT,"EPS",1e-4);var Yg=function(t){var r=Object.keys(t).reduce(function(n,a){return Sr(Sr({},n),{},kc({},a,vT.create(t[a])))},{});return Sr(Sr({},r),{},{apply:function(a){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=u.bandAware,c=u.position;return B5(a,function(f,d){return r[d].apply(f,{bandAware:l,position:c})})},isInRange:function(a){return sT(a,function(u,l){return r[l].isInRange(u)})}})};function pF(e){return(e%180+180)%180}var hF=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,u=pF(a),l=u*Math.PI/180,c=Math.atan(n/r),f=l>c&&l-1?f[d?u[h]:h]:void 0}}return Ey=n,Ey}var jy,fA;function yF(){if(fA)return jy;fA=1;var e=aT();function t(r){var n=e(r),a=n%1;return n===n?a?n-a:n:0}return jy=t,jy}var Ty,dA;function mF(){if(dA)return Ty;dA=1;var e=TE(),t=Ln(),r=yF(),n=Math.max;function a(u,l,c){var f=u==null?0:u.length;if(!f)return-1;var d=c==null?0:r(c);return d<0&&(d=n(f+d,0)),e(u,t(l,3),d)}return Ty=a,Ty}var ky,pA;function gF(){if(pA)return ky;pA=1;var e=vF(),t=mF(),r=e(t);return ky=r,ky}var bF=gF();const xF=Fe(bF);var wF=HA();const SF=Fe(wF);var _F=SF(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("")}),Qg=W.createContext(void 0),Zg=W.createContext(void 0),yT=W.createContext(void 0),mT=W.createContext({}),gT=W.createContext(void 0),bT=W.createContext(0),xT=W.createContext(0),hA=function(t){var r=t.state,n=r.xAxisMap,a=r.yAxisMap,u=r.offset,l=t.clipPathId,c=t.children,f=t.width,d=t.height,h=_F(u);return B.createElement(Qg.Provider,{value:n},B.createElement(Zg.Provider,{value:a},B.createElement(mT.Provider,{value:u},B.createElement(yT.Provider,{value:h},B.createElement(gT.Provider,{value:l},B.createElement(bT.Provider,{value:d},B.createElement(xT.Provider,{value:f},c)))))))},OF=function(){return W.useContext(gT)},wT=function(t){var r=W.useContext(Qg);r==null&&yi();var n=r[t];return n==null&&yi(),n},PF=function(){var t=W.useContext(Qg);return Mn(t)},AF=function(){var t=W.useContext(Zg),r=xF(t,function(n){return sT(n.domain,Number.isFinite)});return r||Mn(t)},ST=function(t){var r=W.useContext(Zg);r==null&&yi();var n=r[t];return n==null&&yi(),n},EF=function(){var t=W.useContext(yT);return t},jF=function(){return W.useContext(mT)},Jg=function(){return W.useContext(xT)},e0=function(){return W.useContext(bT)};function ma(e){"@babel/helpers - typeof";return ma=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},ma(e)}function TF(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function kF(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*a)return!1;var u=r();return e*(t-e*u/2-n)>=0&&e*(t+e*u/2-a)<=0}function f8(e,t){return TT(e,t+1)}function d8(e,t,r,n,a){for(var u=(n||[]).slice(),l=t.start,c=t.end,f=0,d=1,h=l,v=function(){var S=n==null?void 0:n[f];if(S===void 0)return{v:TT(n,d)};var w=f,b,P=function(){return b===void 0&&(b=r(S,w)),b},E=S.coordinate,j=f===0||ec(e,E,P,h,c);j||(f=0,h=l,d+=1),j&&(h=E+e*(P()/2+a),f+=d)},m;d<=u.length;)if(m=v(),m)return m.v;return[]}function _u(e){"@babel/helpers - typeof";return _u=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},_u(e)}function SA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function jt(e){for(var t=1;t0?x.coordinate-b*e:x.coordinate})}else u[m]=x=jt(jt({},x),{},{tickCoord:x.coordinate});var P=ec(e,x.tickCoord,w,c,f);P&&(f=x.tickCoord-e*(w()/2+a),u[m]=jt(jt({},x),{},{isShow:!0}))},h=l-1;h>=0;h--)d(h);return u}function m8(e,t,r,n,a,u){var l=(n||[]).slice(),c=l.length,f=t.start,d=t.end;if(u){var h=n[c-1],v=r(h,c-1),m=e*(h.coordinate+e*v/2-d);l[c-1]=h=jt(jt({},h),{},{tickCoord:m>0?h.coordinate-m*e:h.coordinate});var x=ec(e,h.tickCoord,function(){return v},f,d);x&&(d=h.tickCoord-e*(v/2+a),l[c-1]=jt(jt({},h),{},{isShow:!0}))}for(var S=u?c-1:c,w=function(E){var j=l[E],T,_=function(){return T===void 0&&(T=r(j,E)),T};if(E===0){var O=e*(j.coordinate-e*_()/2-f);l[E]=j=jt(jt({},j),{},{tickCoord:O<0?j.coordinate-O*e:j.coordinate})}else l[E]=j=jt(jt({},j),{},{tickCoord:j.coordinate});var k=ec(e,j.tickCoord,_,f,d);k&&(f=j.tickCoord+e*(_()/2+a),l[E]=jt(jt({},j),{},{isShow:!0}))},b=0;b=2?Or(a[1].coordinate-a[0].coordinate):1,P=c8(u,b,x);return f==="equidistantPreserveStart"?d8(b,P,w,a,l):(f==="preserveStart"||f==="preserveStartEnd"?m=m8(b,P,w,a,l,f==="preserveStartEnd"):m=y8(b,P,w,a,l),m.filter(function(E){return E.isShow}))}var g8=["viewBox"],b8=["viewBox"],x8=["ticks"];function xa(e){"@babel/helpers - typeof";return xa=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},xa(e)}function Zi(){return Zi=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 w8(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 S8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OA(e,t){for(var r=0;r0?f(this.props):f(x)),l<=0||c<=0||!S||!S.length?null:B.createElement(Ze,{className:Ne("recharts-cartesian-axis",d),ref:function(b){n.layerReference=b}},u&&this.renderAxisLine(),this.renderTicks(S,this.state.fontSize,this.state.letterSpacing),kt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,u){var l,c=Ne(a.className,"recharts-cartesian-axis-tick-value");return B.isValidElement(n)?l=B.cloneElement(n,ct(ct({},a),{},{className:c})):Ae(n)?l=n(ct(ct({},a),{},{className:c})):l=B.createElement(ws,Zi({},a,{className:"recharts-cartesian-axis-tick-value"}),u),l}}])})(W.Component);n0(Ia,"displayName","CartesianAxis");n0(Ia,"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 T8=["x1","y1","x2","y2","key"],k8=["offset"];function mi(e){"@babel/helpers - typeof";return mi=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},mi(e)}function PA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).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 I8(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 $8=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,a=t.x,u=t.y,l=t.width,c=t.height,f=t.ry;return B.createElement("rect",{x:a,y:u,ry:f,width:l,height:c,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function MT(e,t){var r;if(B.isValidElement(e))r=B.cloneElement(e,t);else if(Ae(e))r=e(t);else{var n=t.x1,a=t.y1,u=t.x2,l=t.y2,c=t.key,f=AA(t,T8),d=ke(f,!1);d.offset;var h=AA(d,k8);r=B.createElement("line",li({},h,{x1:n,y1:a,x2:u,y2:l,fill:"none",key:c}))}return r}function R8(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,u=e.horizontalPoints;if(!a||!u||!u.length)return null;var l=u.map(function(c,f){var d=Ct(Ct({},e),{},{x1:t,y1:c,x2:t+r,y2:c,key:"line-".concat(f),index:f});return MT(a,d)});return B.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function D8(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,u=e.verticalPoints;if(!a||!u||!u.length)return null;var l=u.map(function(c,f){var d=Ct(Ct({},e),{},{x1:c,y1:t,x2:c,y2:t+r,key:"line-".concat(f),index:f});return MT(a,d)});return B.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function L8(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,u=e.width,l=e.height,c=e.horizontalPoints,f=e.horizontal,d=f===void 0?!0:f;if(!d||!t||!t.length)return null;var h=c.map(function(m){return Math.round(m+a-a)}).sort(function(m,x){return m-x});a!==h[0]&&h.unshift(0);var v=h.map(function(m,x){var S=!h[x+1],w=S?a+l-m:h[x+1]-m;if(w<=0)return null;var b=x%t.length;return B.createElement("rect",{key:"react-".concat(x),y:m,x:n,height:w,width:u,stroke:"none",fill:t[b],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return B.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function B8(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,u=e.x,l=e.y,c=e.width,f=e.height,d=e.verticalPoints;if(!r||!n||!n.length)return null;var h=d.map(function(m){return Math.round(m+u-u)}).sort(function(m,x){return m-x});u!==h[0]&&h.unshift(0);var v=h.map(function(m,x){var S=!h[x+1],w=S?u+c-m:h[x+1]-m;if(w<=0)return null;var b=x%n.length;return B.createElement("rect",{key:"react-".concat(x),x:m,y:l,width:w,height:f,stroke:"none",fill:n[b],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return B.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var q8=function(t,r){var n=t.xAxis,a=t.width,u=t.height,l=t.offset;return Vj(r0(Ct(Ct(Ct({},Ia.defaultProps),n),{},{ticks:Jr(n,!0),viewBox:{x:0,y:0,width:a,height:u}})),l.left,l.left+l.width,r)},z8=function(t,r){var n=t.yAxis,a=t.width,u=t.height,l=t.offset;return Vj(r0(Ct(Ct(Ct({},Ia.defaultProps),n),{},{ticks:Jr(n,!0),viewBox:{x:0,y:0,width:a,height:u}})),l.top,l.top+l.height,r)},Xi={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function NT(e){var t,r,n,a,u,l,c=Jg(),f=e0(),d=jF(),h=Ct(Ct({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Xi.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Xi.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Xi.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:Xi.horizontalFill,vertical:(u=e.vertical)!==null&&u!==void 0?u:Xi.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:Xi.verticalFill,x:se(e.x)?e.x:d.left,y:se(e.y)?e.y:d.top,width:se(e.width)?e.width:d.width,height:se(e.height)?e.height:d.height}),v=h.x,m=h.y,x=h.width,S=h.height,w=h.syncWithTicks,b=h.horizontalValues,P=h.verticalValues,E=PF(),j=AF();if(!se(x)||x<=0||!se(S)||S<=0||!se(v)||v!==+v||!se(m)||m!==+m)return null;var T=h.verticalCoordinatesGenerator||q8,_=h.horizontalCoordinatesGenerator||z8,O=h.horizontalPoints,k=h.verticalPoints;if((!O||!O.length)&&Ae(_)){var N=b&&b.length,$=_({yAxis:j?Ct(Ct({},j),{},{ticks:N?b:j.ticks}):void 0,width:c,height:f,offset:d},N?!0:w);tn(Array.isArray($),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(mi($),"]")),Array.isArray($)&&(O=$)}if((!k||!k.length)&&Ae(T)){var X=P&&P.length,q=T({xAxis:E?Ct(Ct({},E),{},{ticks:X?P:E.ticks}):void 0,width:c,height:f,offset:d},X?!0:w);tn(Array.isArray(q),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(mi(q),"]")),Array.isArray(q)&&(k=q)}return B.createElement("g",{className:"recharts-cartesian-grid"},B.createElement($8,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),B.createElement(R8,li({},h,{offset:d,horizontalPoints:O,xAxis:E,yAxis:j})),B.createElement(D8,li({},h,{offset:d,verticalPoints:k,xAxis:E,yAxis:j})),B.createElement(L8,li({},h,{horizontalPoints:O})),B.createElement(B8,li({},h,{verticalPoints:k})))}NT.displayName="CartesianGrid";var F8=["layout","type","stroke","connectNulls","isRange","ref"],U8=["key"],IT;function wa(e){"@babel/helpers - typeof";return wa=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},wa(e)}function $T(e,t){if(e==null)return{};var r=W8(e,t),n,a;if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function W8(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 si(){return si=Object.assign?Object.assign.bind():function(e){for(var t=1;t0||!tu(h,l)||!tu(v,c))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(l,c,n,a)}},{key:"render",value:function(){var n,a=this.props,u=a.hide,l=a.dot,c=a.points,f=a.className,d=a.top,h=a.left,v=a.xAxis,m=a.yAxis,x=a.width,S=a.height,w=a.isAnimationActive,b=a.id;if(u||!c||!c.length)return null;var P=this.state.isAnimationFinished,E=c.length===1,j=Ne("recharts-area",f),T=v&&v.allowDataOverflow,_=m&&m.allowDataOverflow,O=T||_,k=Ce(b)?this.id:b,N=(n=ke(l,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},$=N.r,X=$===void 0?3:$,q=N.strokeWidth,L=q===void 0?2:q,H=hM(l)?l:{},Y=H.clipDot,Q=Y===void 0?!0:Y,J=X*2+L;return B.createElement(Ze,{className:j},T||_?B.createElement("defs",null,B.createElement("clipPath",{id:"clipPath-".concat(k)},B.createElement("rect",{x:T?h:h-x/2,y:_?d:d-S/2,width:T?x:x*2,height:_?S:S*2})),!Q&&B.createElement("clipPath",{id:"clipPath-dots-".concat(k)},B.createElement("rect",{x:h-J/2,y:d-J/2,width:x+J,height:S+J}))):null,E?null:this.renderArea(O,k),(l||E)&&this.renderDots(O,Q,k),(!w||P)&&Rn.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])})(W.PureComponent);IT=Fn;Rr(Fn,"displayName","Area");Rr(Fn,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ka.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Rr(Fn,"getBaseValue",function(e,t,r,n){var a=e.layout,u=e.baseValue,l=t.props.baseValue,c=l??u;if(se(c)&&typeof c=="number")return c;var f=a==="horizontal"?n:r,d=f.scale.domain();if(f.type==="number"){var h=Math.max(d[0],d[1]),v=Math.min(d[0],d[1]);return c==="dataMin"?v:c==="dataMax"||h<0?h:Math.max(Math.min(d[0],d[1]),0)}return c==="dataMin"?d[0]:c==="dataMax"?d[1]:d[0]});Rr(Fn,"getComposedData",function(e){var t=e.props,r=e.item,n=e.xAxis,a=e.yAxis,u=e.xAxisTicks,l=e.yAxisTicks,c=e.bandSize,f=e.dataKey,d=e.stackedData,h=e.dataStartIndex,v=e.displayedData,m=e.offset,x=t.layout,S=d&&d.length,w=IT.getBaseValue(t,r,n,a),b=x==="horizontal",P=!1,E=v.map(function(T,_){var O;S?O=d[h+_]:(O=Qt(T,f),Array.isArray(O)?P=!0:O=[w,O]);var k=O[1]==null||S&&Qt(T,f)==null;return b?{x:VO({axis:n,ticks:u,bandSize:c,entry:T,index:_}),y:k?null:a.scale(O[1]),value:O,payload:T}:{x:k?null:n.scale(O[1]),y:VO({axis:a,ticks:l,bandSize:c,entry:T,index:_}),value:O,payload:T}}),j;return S||P?j=E.map(function(T){var _=Array.isArray(T.value)?T.value[0]:null;return b?{x:T.x,y:_!=null&&T.y!=null?a.scale(_):null}:{x:_!=null?n.scale(_):null,y:T.y}}):j=b?a.scale(w):n.scale(w),kn({points:E,baseLine:j,layout:x,isRange:P},m)});Rr(Fn,"renderDotItem",function(e,t){var r;if(B.isValidElement(e))r=B.cloneElement(e,t);else if(Ae(e))r=e(t);else{var n=Ne("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,u=$T(t,U8);r=B.createElement(Xg,si({},u,{key:a,className:n}))}return r});function Sa(e){"@babel/helpers - typeof";return Sa=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},Sa(e)}function Z8(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J8(e,t){for(var r=0;re.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 q6(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 z6(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F6(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?l:t&&t.length&&se(a)&&se(u)?t.slice(a,u+1):[]};function YT(e){return e==="number"?[0,"auto"]:void 0}var Jm=function(t,r,n,a){var u=t.graphicalItems,l=t.tooltipAxis,c=Dc(r,t);return n<0||!u||!u.length||n>=c.length?null:u.reduce(function(f,d){var h,v=(h=d.props.data)!==null&&h!==void 0?h:r;v&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(v=v.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(l.dataKey&&!l.allowDuplicatedCategory){var x=v===void 0?c:v;m=ls(x,l.dataKey,a)}else m=v&&v[n]||c[n];return m?[].concat(Pa(f),[Gj(d,m)]):f},[])},$A=function(t,r,n,a){var u=a||{x:t.chartX,y:t.chartY},l=eU(u,n),c=t.orderedTooltipTicks,f=t.tooltipAxis,d=t.tooltipTicks,h=hB(l,c,d,f);if(h>=0&&d){var v=d[h]&&d[h].value,m=Jm(t,r,h,v),x=tU(n,c,h,u);return{activeTooltipIndex:h,activeLabel:v,activePayload:m,activeCoordinate:x}}return null},rU=function(t,r){var n=r.axes,a=r.graphicalItems,u=r.axisType,l=r.axisIdKey,c=r.stackGroups,f=r.dataStartIndex,d=r.dataEndIndex,h=t.layout,v=t.children,m=t.stackOffset,x=Hj(h,u);return n.reduce(function(S,w){var b,P=w.type.defaultProps!==void 0?ee(ee({},w.type.defaultProps),w.props):w.props,E=P.type,j=P.dataKey,T=P.allowDataOverflow,_=P.allowDuplicatedCategory,O=P.scale,k=P.ticks,N=P.includeHidden,$=P[l];if(S[$])return S;var X=Dc(t.data,{graphicalItems:a.filter(function(z){var ne,ce=l in z.props?z.props[l]:(ne=z.type.defaultProps)===null||ne===void 0?void 0:ne[l];return ce===$}),dataStartIndex:f,dataEndIndex:d}),q=X.length,L,H,Y;j6(P.domain,T,E)&&(L=gm(P.domain,null,T),x&&(E==="number"||O!=="auto")&&(Y=qo(X,j,"category")));var Q=YT(E);if(!L||L.length===0){var J,te=(J=P.domain)!==null&&J!==void 0?J:Q;if(j){if(L=qo(X,j,E),E==="category"&&x){var F=iM(L);_&&F?(H=L,L=Vs(0,q)):_||(L=YO(te,L,w).reduce(function(z,ne){return z.indexOf(ne)>=0?z:[].concat(Pa(z),[ne])},[]))}else if(E==="category")_?L=L.filter(function(z){return z!==""&&!Ce(z)}):L=YO(te,L,w).reduce(function(z,ne){return z.indexOf(ne)>=0||ne===""||Ce(ne)?z:[].concat(Pa(z),[ne])},[]);else if(E==="number"){var K=bB(X,a.filter(function(z){var ne,ce,ve=l in z.props?z.props[l]:(ne=z.type.defaultProps)===null||ne===void 0?void 0:ne[l],we="hide"in z.props?z.props.hide:(ce=z.type.defaultProps)===null||ce===void 0?void 0:ce.hide;return ve===$&&(N||!we)}),j,u,h);K&&(L=K)}x&&(E==="number"||O!=="auto")&&(Y=qo(X,j,"category"))}else x?L=Vs(0,q):c&&c[$]&&c[$].hasStack&&E==="number"?L=m==="expand"?[0,1]:Kj(c[$].stackGroups,f,d):L=Wj(X,a.filter(function(z){var ne=l in z.props?z.props[l]:z.type.defaultProps[l],ce="hide"in z.props?z.props.hide:z.type.defaultProps.hide;return ne===$&&(N||!ce)}),E,h,!0);if(E==="number")L=Ym(v,L,$,u,k),te&&(L=gm(te,L,T));else if(E==="category"&&te){var G=te,I=L.every(function(z){return G.indexOf(z)>=0});I&&(L=G)}}return ee(ee({},S),{},Se({},$,ee(ee({},P),{},{axisType:u,domain:L,categoricalDomain:Y,duplicateDomain:H,originalDomain:(b=P.domain)!==null&&b!==void 0?b:Q,isCategorical:x,layout:h})))},{})},nU=function(t,r){var n=r.graphicalItems,a=r.Axis,u=r.axisType,l=r.axisIdKey,c=r.stackGroups,f=r.dataStartIndex,d=r.dataEndIndex,h=t.layout,v=t.children,m=Dc(t.data,{graphicalItems:n,dataStartIndex:f,dataEndIndex:d}),x=m.length,S=Hj(h,u),w=-1;return n.reduce(function(b,P){var E=P.type.defaultProps!==void 0?ee(ee({},P.type.defaultProps),P.props):P.props,j=E[l],T=YT("number");if(!b[j]){w++;var _;return S?_=Vs(0,x):c&&c[j]&&c[j].hasStack?(_=Kj(c[j].stackGroups,f,d),_=Ym(v,_,j,u)):(_=gm(T,Wj(m,n.filter(function(O){var k,N,$=l in O.props?O.props[l]:(k=O.type.defaultProps)===null||k===void 0?void 0:k[l],X="hide"in O.props?O.props.hide:(N=O.type.defaultProps)===null||N===void 0?void 0:N.hide;return $===j&&!X}),"number",h),a.defaultProps.allowDataOverflow),_=Ym(v,_,j,u)),ee(ee({},b),{},Se({},j,ee(ee({axisType:u},a.defaultProps),{},{hide:!0,orientation:sr(Z6,"".concat(u,".").concat(w%2),null),domain:_,originalDomain:T,isCategorical:S,layout:h})))}return b},{})},iU=function(t,r){var n=r.axisType,a=n===void 0?"xAxis":n,u=r.AxisComp,l=r.graphicalItems,c=r.stackGroups,f=r.dataStartIndex,d=r.dataEndIndex,h=t.children,v="".concat(a,"Id"),m=Pr(h,u),x={};return m&&m.length?x=rU(t,{axes:m,graphicalItems:l,axisType:a,axisIdKey:v,stackGroups:c,dataStartIndex:f,dataEndIndex:d}):l&&l.length&&(x=nU(t,{Axis:u,graphicalItems:l,axisType:a,axisIdKey:v,stackGroups:c,dataStartIndex:f,dataEndIndex:d})),x},aU=function(t){var r=Mn(t),n=Jr(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:wg(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Rs(r,n)}},RA=function(t){var r=t.children,n=t.defaultShowTooltip,a=Xt(r,va),u=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(u=a.props.startIndex),a.props.endIndex>=0&&(l=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:u,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!n}},oU=function(t){return!t||!t.length?!1:t.some(function(r){var n=en(r&&r.type);return n&&n.indexOf("Bar")>=0})},DA=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"}},uU=function(t,r){var n=t.props,a=t.graphicalItems,u=t.xAxisMap,l=u===void 0?{}:u,c=t.yAxisMap,f=c===void 0?{}:c,d=n.width,h=n.height,v=n.children,m=n.margin||{},x=Xt(v,va),S=Xt(v,ta),w=Object.keys(f).reduce(function(_,O){var k=f[O],N=k.orientation;return!k.mirror&&!k.hide?ee(ee({},_),{},Se({},N,_[N]+k.width)):_},{left:m.left||0,right:m.right||0}),b=Object.keys(l).reduce(function(_,O){var k=l[O],N=k.orientation;return!k.mirror&&!k.hide?ee(ee({},_),{},Se({},N,sr(_,"".concat(N))+k.height)):_},{top:m.top||0,bottom:m.bottom||0}),P=ee(ee({},b),w),E=P.bottom;x&&(P.bottom+=x.props.height||va.defaultProps.height),S&&r&&(P=mB(P,a,n,r));var j=d-P.left-P.right,T=h-P.top-P.bottom;return ee(ee({brushBottom:E},P),{},{width:Math.max(j,0),height:Math.max(T,0)})},lU=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},sU=function(t){var r=t.chartName,n=t.GraphicalChild,a=t.defaultTooltipEventType,u=a===void 0?"axis":a,l=t.validateTooltipEventTypes,c=l===void 0?["axis"]:l,f=t.axisComponents,d=t.legendContent,h=t.formatAxisMap,v=t.defaultProps,m=function(P,E){var j=E.graphicalItems,T=E.stackGroups,_=E.offset,O=E.updateId,k=E.dataStartIndex,N=E.dataEndIndex,$=P.barSize,X=P.layout,q=P.barGap,L=P.barCategoryGap,H=P.maxBarSize,Y=DA(X),Q=Y.numericAxisName,J=Y.cateAxisName,te=oU(j),F=[];return j.forEach(function(K,G){var I=Dc(P.data,{graphicalItems:[K],dataStartIndex:k,dataEndIndex:N}),z=K.type.defaultProps!==void 0?ee(ee({},K.type.defaultProps),K.props):K.props,ne=z.dataKey,ce=z.maxBarSize,ve=z["".concat(Q,"Id")],we=z["".concat(J,"Id")],Ee={},Oe=f.reduce(function($t,pr){var Si=E["".concat(pr.axisType,"Map")],$a=z["".concat(pr.axisType,"Id")];Si&&Si[$a]||pr.axisType==="zAxis"||yi();var Ra=Si[$a];return ee(ee({},$t),{},Se(Se({},pr.axisType,Ra),"".concat(pr.axisType,"Ticks"),Jr(Ra)))},Ee),ue=Oe[J],ge=Oe["".concat(J,"Ticks")],Pe=T&&T[ve]&&T[ve].hasStack&&CB(K,T[ve].stackGroups),ae=en(K.type).indexOf("Bar")>=0,qe=Rs(ue,ge),Te=[],Je=te&&vB({barSize:$,stackGroups:T,totalSize:lU(Oe,J)});if(ae){var et,ht,dr=Ce(ce)?H:ce,Er=(et=(ht=Rs(ue,ge,!0))!==null&&ht!==void 0?ht:dr)!==null&&et!==void 0?et:0;Te=yB({barGap:q,barCategoryGap:L,bandSize:Er!==qe?Er:qe,sizeList:Je[we],maxBarSize:dr}),Er!==qe&&(Te=Te.map(function($t){return ee(ee({},$t),{},{position:ee(ee({},$t.position),{},{offset:$t.position.offset-Er/2})})}))}var jr=K&&K.type&&K.type.getComposedData;jr&&F.push({props:ee(ee({},jr(ee(ee({},Oe),{},{displayedData:I,props:P,dataKey:ne,item:K,bandSize:qe,barPosition:Te,offset:_,stackedData:Pe,layout:X,dataStartIndex:k,dataEndIndex:N}))),{},Se(Se(Se({key:K.key||"item-".concat(G)},Q,Oe[Q]),J,Oe[J]),"animationId",O)),childIndex:mM(K,P.children),item:K})}),F},x=function(P,E){var j=P.props,T=P.dataStartIndex,_=P.dataEndIndex,O=P.updateId;if(!cw({props:j}))return null;var k=j.children,N=j.layout,$=j.stackOffset,X=j.data,q=j.reverseStackOrder,L=DA(N),H=L.numericAxisName,Y=L.cateAxisName,Q=Pr(k,n),J=jB(X,Q,"".concat(H,"Id"),"".concat(Y,"Id"),$,q),te=f.reduce(function(z,ne){var ce="".concat(ne.axisType,"Map");return ee(ee({},z),{},Se({},ce,iU(j,ee(ee({},ne),{},{graphicalItems:Q,stackGroups:ne.axisType===H&&J,dataStartIndex:T,dataEndIndex:_}))))},{}),F=uU(ee(ee({},te),{},{props:j,graphicalItems:Q}),E==null?void 0:E.legendBBox);Object.keys(te).forEach(function(z){te[z]=h(j,te[z],F,z.replace("Map",""),r)});var K=te["".concat(Y,"Map")],G=aU(K),I=m(j,ee(ee({},te),{},{dataStartIndex:T,dataEndIndex:_,updateId:O,graphicalItems:Q,stackGroups:J,offset:F}));return ee(ee({formattedGraphicalItems:I,graphicalItems:Q,offset:F,stackGroups:J},G),te)},S=(function(b){function P(E){var j,T,_;return z6(this,P),_=W6(this,P,[E]),Se(_,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Se(_,"accessibilityManager",new E6),Se(_,"handleLegendBBoxUpdate",function(O){if(O){var k=_.state,N=k.dataStartIndex,$=k.dataEndIndex,X=k.updateId;_.setState(ee({legendBBox:O},x({props:_.props,dataStartIndex:N,dataEndIndex:$,updateId:X},ee(ee({},_.state),{},{legendBBox:O}))))}}),Se(_,"handleReceiveSyncEvent",function(O,k,N){if(_.props.syncId===O){if(N===_.eventEmitterSymbol&&typeof _.props.syncMethod!="function")return;_.applySyncEvent(k)}}),Se(_,"handleBrushChange",function(O){var k=O.startIndex,N=O.endIndex;if(k!==_.state.dataStartIndex||N!==_.state.dataEndIndex){var $=_.state.updateId;_.setState(function(){return ee({dataStartIndex:k,dataEndIndex:N},x({props:_.props,dataStartIndex:k,dataEndIndex:N,updateId:$},_.state))}),_.triggerSyncEvent({dataStartIndex:k,dataEndIndex:N})}}),Se(_,"handleMouseEnter",function(O){var k=_.getMouseInfo(O);if(k){var N=ee(ee({},k),{},{isTooltipActive:!0});_.setState(N),_.triggerSyncEvent(N);var $=_.props.onMouseEnter;Ae($)&&$(N,O)}}),Se(_,"triggeredAfterMouseMove",function(O){var k=_.getMouseInfo(O),N=k?ee(ee({},k),{},{isTooltipActive:!0}):{isTooltipActive:!1};_.setState(N),_.triggerSyncEvent(N);var $=_.props.onMouseMove;Ae($)&&$(N,O)}),Se(_,"handleItemMouseEnter",function(O){_.setState(function(){return{isTooltipActive:!0,activeItem:O,activePayload:O.tooltipPayload,activeCoordinate:O.tooltipPosition||{x:O.cx,y:O.cy}}})}),Se(_,"handleItemMouseLeave",function(){_.setState(function(){return{isTooltipActive:!1}})}),Se(_,"handleMouseMove",function(O){O.persist(),_.throttleTriggeredAfterMouseMove(O)}),Se(_,"handleMouseLeave",function(O){_.throttleTriggeredAfterMouseMove.cancel();var k={isTooltipActive:!1};_.setState(k),_.triggerSyncEvent(k);var N=_.props.onMouseLeave;Ae(N)&&N(k,O)}),Se(_,"handleOuterEvent",function(O){var k=yM(O),N=sr(_.props,"".concat(k));if(k&&Ae(N)){var $,X;/.*touch.*/i.test(k)?X=_.getMouseInfo(O.changedTouches[0]):X=_.getMouseInfo(O),N(($=X)!==null&&$!==void 0?$:{},O)}}),Se(_,"handleClick",function(O){var k=_.getMouseInfo(O);if(k){var N=ee(ee({},k),{},{isTooltipActive:!0});_.setState(N),_.triggerSyncEvent(N);var $=_.props.onClick;Ae($)&&$(N,O)}}),Se(_,"handleMouseDown",function(O){var k=_.props.onMouseDown;if(Ae(k)){var N=_.getMouseInfo(O);k(N,O)}}),Se(_,"handleMouseUp",function(O){var k=_.props.onMouseUp;if(Ae(k)){var N=_.getMouseInfo(O);k(N,O)}}),Se(_,"handleTouchMove",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&_.throttleTriggeredAfterMouseMove(O.changedTouches[0])}),Se(_,"handleTouchStart",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&_.handleMouseDown(O.changedTouches[0])}),Se(_,"handleTouchEnd",function(O){O.changedTouches!=null&&O.changedTouches.length>0&&_.handleMouseUp(O.changedTouches[0])}),Se(_,"handleDoubleClick",function(O){var k=_.props.onDoubleClick;if(Ae(k)){var N=_.getMouseInfo(O);k(N,O)}}),Se(_,"handleContextMenu",function(O){var k=_.props.onContextMenu;if(Ae(k)){var N=_.getMouseInfo(O);k(N,O)}}),Se(_,"triggerSyncEvent",function(O){_.props.syncId!==void 0&&Ny.emit(Iy,_.props.syncId,O,_.eventEmitterSymbol)}),Se(_,"applySyncEvent",function(O){var k=_.props,N=k.layout,$=k.syncMethod,X=_.state.updateId,q=O.dataStartIndex,L=O.dataEndIndex;if(O.dataStartIndex!==void 0||O.dataEndIndex!==void 0)_.setState(ee({dataStartIndex:q,dataEndIndex:L},x({props:_.props,dataStartIndex:q,dataEndIndex:L,updateId:X},_.state)));else if(O.activeTooltipIndex!==void 0){var H=O.chartX,Y=O.chartY,Q=O.activeTooltipIndex,J=_.state,te=J.offset,F=J.tooltipTicks;if(!te)return;if(typeof $=="function")Q=$(F,O);else if($==="value"){Q=-1;for(var K=0;K=0){var Pe,ae;if(H.dataKey&&!H.allowDuplicatedCategory){var qe=typeof H.dataKey=="function"?ge:"payload.".concat(H.dataKey.toString());Pe=ls(K,qe,Q),ae=G&&I&&ls(I,qe,Q)}else Pe=K==null?void 0:K[Y],ae=G&&I&&I[Y];if(we||ve){var Te=O.props.activeIndex!==void 0?O.props.activeIndex:Y;return[W.cloneElement(O,ee(ee(ee({},$.props),Oe),{},{activeIndex:Te})),null,null]}if(!Ce(Pe))return[ue].concat(Pa(_.renderActivePoints({item:$,activePoint:Pe,basePoint:ae,childIndex:Y,isRange:G})))}else{var Je,et=(Je=_.getItemByXY(_.state.activeCoordinate))!==null&&Je!==void 0?Je:{graphicalItem:ue},ht=et.graphicalItem,dr=ht.item,Er=dr===void 0?O:dr,jr=ht.childIndex,$t=ee(ee(ee({},$.props),Oe),{},{activeIndex:jr});return[W.cloneElement(Er,$t),null,null]}return G?[ue,null,null]:[ue,null]}),Se(_,"renderCustomized",function(O,k,N){return W.cloneElement(O,ee(ee({key:"recharts-customized-".concat(N)},_.props),_.state))}),Se(_,"renderMap",{CartesianGrid:{handler:ns,once:!0},ReferenceArea:{handler:_.renderReferenceElement},ReferenceLine:{handler:ns},ReferenceDot:{handler:_.renderReferenceElement},XAxis:{handler:ns},YAxis:{handler:ns},Brush:{handler:_.renderBrush,once:!0},Bar:{handler:_.renderGraphicChild},Line:{handler:_.renderGraphicChild},Area:{handler:_.renderGraphicChild},Radar:{handler:_.renderGraphicChild},RadialBar:{handler:_.renderGraphicChild},Scatter:{handler:_.renderGraphicChild},Pie:{handler:_.renderGraphicChild},Funnel:{handler:_.renderGraphicChild},Tooltip:{handler:_.renderCursor,once:!0},PolarGrid:{handler:_.renderPolarGrid,once:!0},PolarAngleAxis:{handler:_.renderPolarAxis},PolarRadiusAxis:{handler:_.renderPolarAxis},Customized:{handler:_.renderCustomized}}),_.clipPathId="".concat((j=E.id)!==null&&j!==void 0?j:Eu("recharts"),"-clip"),_.throttleTriggeredAfterMouseMove=FE(_.triggeredAfterMouseMove,(T=E.throttleDelay)!==null&&T!==void 0?T:1e3/60),_.state={},_}return K6(P,b),U6(P,[{key:"componentDidMount",value:function(){var j,T;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(j=this.props.margin.left)!==null&&j!==void 0?j:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var j=this.props,T=j.children,_=j.data,O=j.height,k=j.layout,N=Xt(T,Ir);if(N){var $=N.props.defaultIndex;if(!(typeof $!="number"||$<0||$>this.state.tooltipTicks.length-1)){var X=this.state.tooltipTicks[$]&&this.state.tooltipTicks[$].value,q=Jm(this.state,_,$,X),L=this.state.tooltipTicks[$].coordinate,H=(this.state.offset.top+O)/2,Y=k==="horizontal",Q=Y?{x:L,y:H}:{y:L,x:H},J=this.state.formattedGraphicalItems.find(function(F){var K=F.item;return K.type.name==="Scatter"});J&&(Q=ee(ee({},Q),J.props.points[$].tooltipPosition),q=J.props.points[$].tooltipPayload);var te={activeTooltipIndex:$,isTooltipActive:!0,activeLabel:X,activePayload:q,activeCoordinate:Q};this.setState(te),this.renderCursor(N),this.accessibilityManager.setIndex($)}}}},{key:"getSnapshotBeforeUpdate",value:function(j,T){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==T.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==j.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==j.margin){var _,O;this.accessibilityManager.setDetails({offset:{left:(_=this.props.margin.left)!==null&&_!==void 0?_:0,top:(O=this.props.margin.top)!==null&&O!==void 0?O:0}})}return null}},{key:"componentDidUpdate",value:function(j){qy([Xt(j.children,Ir)],[Xt(this.props.children,Ir)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var j=Xt(this.props.children,Ir);if(j&&typeof j.props.shared=="boolean"){var T=j.props.shared?"axis":"item";return c.indexOf(T)>=0?T:u}return u}},{key:"getMouseInfo",value:function(j){if(!this.container)return null;var T=this.container,_=T.getBoundingClientRect(),O=iR(_),k={chartX:Math.round(j.pageX-O.left),chartY:Math.round(j.pageY-O.top)},N=_.width/T.offsetWidth||1,$=this.inRange(k.chartX,k.chartY,N);if(!$)return null;var X=this.state,q=X.xAxisMap,L=X.yAxisMap,H=this.getTooltipEventType(),Y=$A(this.state,this.props.data,this.props.layout,$);if(H!=="axis"&&q&&L){var Q=Mn(q).scale,J=Mn(L).scale,te=Q&&Q.invert?Q.invert(k.chartX):null,F=J&&J.invert?J.invert(k.chartY):null;return ee(ee({},k),{},{xValue:te,yValue:F},Y)}return Y?ee(ee({},k),Y):null}},{key:"inRange",value:function(j,T){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,O=this.props.layout,k=j/_,N=T/_;if(O==="horizontal"||O==="vertical"){var $=this.state.offset,X=k>=$.left&&k<=$.left+$.width&&N>=$.top&&N<=$.top+$.height;return X?{x:k,y:N}:null}var q=this.state,L=q.angleAxisMap,H=q.radiusAxisMap;if(L&&H){var Y=Mn(L);return JO({x:k,y:N},Y)}return null}},{key:"parseEventsOfWrapper",value:function(){var j=this.props.children,T=this.getTooltipEventType(),_=Xt(j,Ir),O={};_&&T==="axis"&&(_.props.trigger==="click"?O={onClick:this.handleClick}:O={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 k=ss(this.props,this.handleOuterEvent);return ee(ee({},k),O)}},{key:"addListener",value:function(){Ny.on(Iy,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Ny.removeListener(Iy,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(j,T,_){for(var O=this.state.formattedGraphicalItems,k=0,N=O.length;k{let n=String(r[0]);try{const u=new Date(r[0]);Number.isNaN(u.getTime())||(n=u.toLocaleTimeString("en-GB",{hour12:!1}))}catch{}const a=r.length>t?Number(r[t]):0;return{time:n,value:Number.isFinite(a)?a:0}}):[]}function os(e){return e.slice(-30)}function us(e){return e.length===0?null:e[e.length-1].value}function dU(e){return e===null?"text-dash-label":e>=90?"text-red-400":e>=70?"text-amber-400":"text-green-400"}function is({label:e,deviceTag:t,points:r,stroke:n,fill:a,fillOpacity:u=.15}){const l=os(r),c=us(l);return C.jsxs("div",{className:"rounded-lg border border-dash-border bg-dash-card p-3",children:[C.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-sm",style:{backgroundColor:n}}),C.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-dash-label",children:e}),C.jsx("span",{className:"rounded border px-1.5 py-0 text-[9px] font-bold",style:{color:n,borderColor:n+"50",backgroundColor:n+"15"},children:t})]}),C.jsx("div",{className:"text-right",children:c!==null?C.jsxs("span",{className:`font-mono text-xl font-bold ${dU(c)}`,style:{animation:"number-tick 0.25s ease-out"},children:[Math.round(c),C.jsx("span",{className:"ml-0.5 text-xs font-normal opacity-60",children:"%"})]},String(Math.round(c))):C.jsx("span",{className:"text-xs text-dash-label",children:"–"})})]}),l.length===0?C.jsx("div",{className:"flex h-[90px] items-center justify-center",children:C.jsxs("div",{className:"flex flex-col items-center gap-1",children:[C.jsx("div",{className:"h-4 w-4 animate-spin-slow rounded-full border-2 border-dash-border border-t-transparent"}),C.jsx("span",{className:"text-[10px] text-dash-label",children:"Waiting for data…"})]})}):C.jsx("div",{className:"h-[90px]",children:C.jsx(Q$,{width:"100%",height:"100%",children:C.jsxs(cU,{data:l,margin:{top:4,right:0,bottom:0,left:0},children:[C.jsx("defs",{children:C.jsxs("linearGradient",{id:`grad-${e}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[C.jsx("stop",{offset:"5%",stopColor:a,stopOpacity:u*3}),C.jsx("stop",{offset:"95%",stopColor:a,stopOpacity:0})]})}),C.jsx(NT,{strokeDasharray:"3 3",stroke:"#334155",vertical:!1}),C.jsx(Su,{y:90,stroke:"#ef444460",strokeDasharray:"4 2",strokeWidth:1}),C.jsx(Su,{y:50,stroke:"#33415540",strokeDasharray:"4 2",strokeWidth:1}),C.jsx($c,{dataKey:"time",hide:!0}),C.jsx(Rc,{domain:[0,100],tick:{fontSize:9,fill:"#64748b"},width:26,unit:"%",tickLine:!1,axisLine:!1}),C.jsx(Ir,{contentStyle:{background:"#1e293b",border:"1px solid #334155",borderRadius:"6px",fontSize:"11px",color:"#f1f5f9"},itemStyle:{color:n},formatter:f=>[`${f.toFixed(1)}%`,e],labelStyle:{color:"#94a3b8",marginBottom:"2px"}}),C.jsx(Fn,{type:"monotone",dataKey:"value",stroke:n,strokeWidth:2,fill:`url(#grad-${e})`,dot:!1,isAnimationActive:!1})]})})})]})}function pU({metrics:e}){const t=ci(e.cpu_utilization),r=ci(e.gpu_utilization),n=ci(e.npu_utilization),a=ci(e.memory,4),u=us(os(t)),l=us(os(r)),c=us(os(n));return C.jsxs("div",{className:"space-y-2",children:[C.jsxs("div",{className:"flex items-center justify-between",children:[C.jsx("h2",{className:"text-xs font-semibold uppercase tracking-widest text-dash-label",children:"Hardware Utilization"}),C.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-green-900/30 px-2.5 py-0.5 text-[10px] font-semibold text-green-400",children:[C.jsx("span",{className:"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-green-400"}),"LIVE"]})]}),C.jsx("div",{className:"grid grid-cols-3 gap-2",children:[{label:"CPU",val:u,color:"#0071c5"},{label:"GPU",val:l,color:"#16a34a"},{label:"NPU",val:c,color:"#9333ea"}].map(({label:f,val:d,color:h})=>C.jsxs("div",{className:"flex flex-col items-center rounded-lg border border-dash-border bg-dash-card py-2",children:[C.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-dash-label",children:f}),C.jsx("span",{className:"mt-0.5 font-mono text-2xl font-bold",style:{color:h},children:d!==null?`${Math.round(d)}`:"—"}),C.jsx("span",{className:"text-[9px] text-dash-label",children:"%"})]},f))}),C.jsx(is,{label:"CPU Utilization",deviceTag:"CPU",points:t,stroke:"#0071c5",fill:"#0071c5"}),C.jsx(is,{label:"GPU Utilization",deviceTag:"GPU",points:r,stroke:"#16a34a",fill:"#16a34a"}),C.jsx(is,{label:"NPU Utilization",deviceTag:"NPU",points:n,stroke:"#9333ea",fill:"#9333ea"}),C.jsx(is,{label:"Memory",deviceTag:"RAM",points:a,stroke:"#64748b",fill:"#64748b",fillOpacity:.1})]})}function hU({devices:e,selectedId:t,onSelect:r,error:n}){return C.jsxs("div",{children:[C.jsx("p",{className:"text-sm text-kiosk-textmd mb-2",children:"Select the microphone to use for recording."}),C.jsx("select",{className:"w-full border border-kiosk-border rounded-md px-3 py-2 text-sm text-intel-dark bg-white focus:outline-none focus:ring-2 focus:ring-intel-blue",value:t,onChange:a=>r(a.target.value),children:e.map((a,u)=>C.jsx("option",{value:a.deviceId,children:a.label||`Microphone ${u+1}`},a.deviceId))}),n?C.jsx("p",{className:"text-xs text-amber-600 mt-2",children:n}):null,e.length===0?C.jsx("p",{className:"text-xs text-kiosk-textlo mt-2",children:"No microphones detected."}):null]})}async function LA(e,t){try{await fetch(Tt.ragContext,{method:"DELETE"})}catch{}const r=new FormData;r.append("file",new File([t],e,{type:"text/plain"}));const n=await fetch(Tt.ragContextFile,{method:"POST",body:r});if(!n.ok){let a=`HTTP ${n.status}`;try{const u=await n.json();a=u.detail||u.error||a}catch{}throw new Error(String(a))}return n.json()}async function vU(e){const t=await fetch(`/samples/${e}`);if(!t.ok)throw new Error(`Failed to load sample ${e}: ${t.status}`);return t.blob()}const yU={idle:"",loading:"text-intel-blue",success:"text-green-600",error:"text-red-600",warn:"text-amber-600"};var qA;const mU=((qA=zA[0])==null?void 0:qA.file)??"";function gU({onIngestStateChange:e}){const[t,r]=W.useState(mU),[n,a]=W.useState({kind:"idle",message:""}),[u,l]=W.useState(!1),c=async(h,v)=>{l(!0),e==null||e(!0),a({kind:"loading",message:"⏳ Ingesting knowledge base…"});try{const m=await LA(h,v);a({kind:"success",message:`✅ Knowledge base updated — ${m.chunks_added??0} chunks from ${m.source??h}`})}catch(m){const x=m instanceof Error?m.message:"Unknown error";a({kind:"error",message:`⚠️ Ingestion failed: ${x}. Previous knowledge base remains active.`})}finally{l(!1),e==null||e(!1)}},f=async()=>{if(!t){a({kind:"warn",message:"Select a sample knowledge base first."});return}l(!0),e==null||e(!0),a({kind:"loading",message:"⏳ Ingesting knowledge base…"});try{const h=await vU(t),v=await LA(t,h);a({kind:"success",message:`✅ Knowledge base updated — ${v.chunks_added??0} chunks from ${v.source??t}`})}catch(h){const v=h instanceof Error?h.message:"Unknown error";a({kind:"error",message:`⚠️ Ingestion failed: ${v}. Previous knowledge base remains active.`})}finally{l(!1),e==null||e(!1)}},d=async h=>{var m;const v=(m=h.target.files)==null?void 0:m[0];v&&(await c(v.name,v),h.target.value="")};return C.jsxs("section",{className:"rounded-lg border border-kiosk-border bg-white p-4",children:[C.jsx("p",{className:"mb-3 text-sm text-kiosk-textmd",children:"Replace the assistant's knowledge base with a sample or your own .txt / .md document."}),C.jsx("select",{className:"mb-2 w-full rounded-md border border-kiosk-border bg-white px-3 py-2 text-sm",disabled:u,value:t,onChange:h=>r(h.target.value),children:zA.map(h=>C.jsx("option",{value:h.file,children:h.label},h.file))}),C.jsx("a",{href:`/samples/${t}`,download:!0,className:"text-xs text-intel-blue hover:underline",children:"Download selected sample"}),C.jsxs("div",{className:"mt-3 flex gap-2",children:[C.jsx("button",{type:"button",className:"rounded-md border border-kiosk-border px-3 py-1.5 text-sm text-intel-dark hover:bg-kiosk-pane disabled:opacity-50",disabled:u,onClick:()=>void f(),children:"Use Sample & Ingest"}),C.jsxs("label",{"aria-disabled":u,className:`rounded-md bg-intel-blue px-3 py-1.5 text-sm text-white hover:bg-intel-blue-dark disabled:opacity-50 ${u?"pointer-events-none opacity-50":""}`,children:["📄 Upload .txt / .md & Ingest",C.jsx("input",{type:"file",accept:".txt,.md",className:"hidden",disabled:u,onChange:h=>void d(h)})]})]}),n.kind!=="idle"?C.jsx("p",{className:`mt-3 text-sm ${yU[n.kind]}`,children:n.message}):null]})}async function bU(e){try{const t=await fetch(Tt.currentOrder(e),{signal:AbortSignal.timeout(4e3)});return t.status===404||!t.ok?null:await t.json()}catch{return null}}async function xU(e){if(e.length===0)return[];try{const t=await fetch(Tt.upsell,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({product_ids:e}),signal:AbortSignal.timeout(4e3)});return t.ok?await t.json():[]}catch{return[]}}const BA=e=>`$${(e??0).toFixed(2)}`,wU=e=>`ORD-${String(e).padStart(5,"0")}`;function SU({active:e}){const[t,r]=W.useState(null),[n,a]=W.useState([]),u=W.useRef(!1),l=W.useCallback(async()=>{var v;const d=await bU(Yr.userId);if(!u.current)return;r(d);const h=((v=d==null?void 0:d.items)==null?void 0:v.map(m=>m.product_id))??[];if(d&&h.length>0){const m=await xU(h);if(!u.current)return;a(m)}else a([])},[]);W.useEffect(()=>{u.current=!0,l();const d=window.setInterval(()=>{l()},3e3);return()=>{u.current=!1,window.clearInterval(d)}},[l]),W.useEffect(()=>{if(!e)return;l();const d=window.setInterval(()=>{l()},Yr.pollIntervalMs);return()=>window.clearInterval(d)},[e,l]);const c=W.useMemo(()=>n.slice(0,3),[n]),f=(t==null?void 0:t.items)??[];return C.jsxs("section",{className:"rounded-lg border border-kiosk-border bg-white p-4",children:[C.jsxs("div",{className:"flex items-center justify-between gap-2",children:[C.jsx("h2",{className:"text-sm font-semibold text-intel-dark",children:"🛒 Current Order"}),(t==null?void 0:t.order_id)!==void 0?C.jsxs("span",{className:"text-xs text-kiosk-textlo",children:["#",wU(t.order_id)]}):null]}),t?C.jsxs("div",{className:"mt-3",children:[C.jsx("div",{className:"space-y-2",children:f.map(d=>C.jsxs("div",{className:"flex justify-between gap-3",children:[C.jsxs("span",{className:"text-sm text-intel-dark",children:[C.jsxs("span",{className:"text-xs",children:[d.quantity,"×"]})," ",d.product_name]}),C.jsx("span",{className:"text-sm font-medium",children:BA(d.subtotal)})]},d.id))}),C.jsx("div",{className:"my-3 border-t border-kiosk-border"}),C.jsxs("div",{className:"flex items-center justify-between gap-3 text-sm font-bold text-intel-dark",children:[C.jsxs("div",{className:"flex items-center gap-2",children:[C.jsx("span",{children:"Total"}),C.jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] ${t.status==="confirmed"?"bg-green-100 text-green-700":"bg-amber-100 text-amber-700"}`,children:t.status})]}),C.jsx("span",{children:BA(t.total)})]}),t.status==="draft"&&c.length>0?C.jsxs("div",{children:[C.jsx("h3",{className:"mb-1 mt-3 text-xs font-semibold text-kiosk-textmd",children:"✨ You might also like"}),c.map(d=>C.jsxs("div",{className:"mb-1 rounded-md border border-kiosk-border bg-kiosk-asst px-2 py-1 text-xs text-intel-dark",children:[d.product.name," — ",d.reason]},d.product.product_id))]}):null]}):C.jsx("p",{className:"py-3 text-sm text-kiosk-textlo",children:"No active order yet. Start ordering by voice."})]})}function _U({kpis:e,metrics:t,phase:r,orderActive:n,devices:a,selectedDeviceId:u,onSelectDevice:l,micError:c,onIngestStateChange:f,onRefreshKpis:d}){const[h,v]=W.useState("performance");return C.jsxs("aside",{className:"flex h-full flex-col overflow-hidden rounded-xl border border-dash-border bg-dash-bg shadow-xl",children:[C.jsx("div",{className:"flex shrink-0 border-b border-dash-border",children:[{id:"performance",label:"Performance",icon:"📊"},{id:"settings",label:"Settings",icon:"⚙️"}].map(m=>C.jsxs("button",{type:"button",onClick:()=>v(m.id),className:` - flex flex-1 items-center justify-center gap-2 border-b-2 py-3 text-xs font-semibold - uppercase tracking-widest transition-colors duration-150 - ${h===m.id?"border-intel-blue text-intel-blue":"border-transparent text-dash-label hover:text-dash-value"} - `,children:[C.jsx("span",{children:m.icon}),C.jsx("span",{children:m.label})]},m.id))}),C.jsxs("div",{className:"flex-1 overflow-y-auto",children:[h==="performance"&&C.jsxs("div",{className:"space-y-5 p-4",children:[C.jsx(hC,{kpis:e,phase:r}),C.jsx("div",{className:"h-px bg-dash-border"}),C.jsx(vC,{kpis:e}),C.jsx("div",{className:"flex justify-end",children:C.jsxs("button",{type:"button",onClick:d,className:"flex items-center gap-1.5 rounded-md border border-dash-border px-2.5 py-1.5 text-[11px] text-dash-label transition-colors hover:border-intel-blue/50 hover:text-intel-blue",children:[C.jsxs("svg",{className:"h-3 w-3",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[C.jsx("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),C.jsx("path",{d:"M21 3v5h-5"}),C.jsx("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),C.jsx("path",{d:"M8 16H3v5"})]}),"Refresh KPIs"]})}),C.jsx("div",{className:"h-px bg-dash-border"}),C.jsx(pU,{metrics:t})]}),h==="settings"&&C.jsxs("div",{className:"space-y-4 p-4",children:[C.jsxs("div",{className:"overflow-hidden rounded-lg border border-dash-border bg-white/5",children:[C.jsx("div",{className:"border-b border-dash-border bg-white/[0.03] px-3 py-2",children:C.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-dash-label",children:"🛒 Current Order"})}),C.jsx("div",{className:"bg-white p-0",children:C.jsx(SU,{active:n})})]}),C.jsxs("div",{className:"overflow-hidden rounded-lg border border-dash-border",children:[C.jsx("div",{className:"border-b border-dash-border bg-white/[0.03] px-3 py-2",children:C.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-dash-label",children:"🎙 Audio Device"})}),C.jsx("div",{className:"bg-white p-3",children:C.jsx(hU,{devices:a,selectedId:u,onSelect:l,error:c})})]}),C.jsxs("div",{className:"overflow-hidden rounded-lg border border-dash-border",children:[C.jsx("div",{className:"border-b border-dash-border bg-white/[0.03] px-3 py-2",children:C.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-dash-label",children:"📚 Knowledge Base"})}),C.jsx("div",{className:"bg-white p-3",children:C.jsx(gU,{onIngestStateChange:f})})]}),C.jsx(OU,{kpis:e})]})]})]})}function OU({kpis:e}){var a,u,l,c,f,d,h,v;const t=m=>m==null||m===""?"—":String(m),r=m=>t(m).split("/").pop()??"—",n=[["🎙 ASR",r((a=e.asr)==null?void 0:a.model),t((u=e.asr)==null?void 0:u.device).toUpperCase()],["🔍 Embedding",r((l=e.rag)==null?void 0:l.embedding_model),t((c=e.rag)==null?void 0:c.embedding_device).toUpperCase()],["🧠 LLM",r((f=e.rag)==null?void 0:f.llm_model),t((d=e.rag)==null?void 0:d.llm_device).toUpperCase()],["🔊 TTS",r((h=e.tts)==null?void 0:h.model),t((v=e.tts)==null?void 0:v.device).toUpperCase()]];return C.jsxs("div",{className:"overflow-hidden rounded-lg border border-dash-border",children:[C.jsx("div",{className:"border-b border-dash-border bg-white/[0.03] px-3 py-2",children:C.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-dash-label",children:"⚙️ Model Configuration"})}),C.jsx("div",{className:"divide-y divide-dash-border",children:n.map(([m,x,S])=>C.jsxs("div",{className:"flex items-center justify-between gap-2 bg-dash-card px-3 py-2",children:[C.jsx("span",{className:"shrink-0 text-xs text-dash-label",children:m}),C.jsx("span",{className:"min-w-0 flex-1 truncate text-center text-[11px] font-medium text-dash-value",children:x}),C.jsx("span",{className:"shrink-0 rounded border border-dash-border px-1.5 py-0.5 text-[9px] font-bold text-dash-label",children:S})]},m))})]})}const PU="Microphone access requires HTTPS or localhost.",AU="Unable to access the microphone. Device names may be unavailable until permission is granted.",EU="Unable to list microphones. Check your browser permissions.";function jU(){const[e,t]=W.useState([]),[r,n]=W.useState(""),[a,u]=W.useState(null),l=W.useCallback(async()=>{var f;if(!((f=navigator.mediaDevices)!=null&&f.enumerateDevices)){t([]),n(""),u(PU);return}let c=null;if(navigator.mediaDevices.getUserMedia)try{(await navigator.mediaDevices.getUserMedia({audio:!0})).getTracks().forEach(h=>h.stop())}catch{c=AU}try{const d=(await navigator.mediaDevices.enumerateDevices()).filter(h=>h.kind==="audioinput");t(d),n(h=>{var v;return h&&d.some(m=>m.deviceId===h)?h:((v=d[0])==null?void 0:v.deviceId)??""}),u(c)}catch{t([]),n(""),u(c??EU)}},[]);return W.useEffect(()=>{var c;if(l(),!!((c=navigator.mediaDevices)!=null&&c.addEventListener))return navigator.mediaDevices.addEventListener("devicechange",l),()=>{navigator.mediaDevices.removeEventListener("devicechange",l)}},[l]),{devices:e,selectedId:r,setSelectedId:n,refresh:l,error:a}}async function Yi(e){try{const t=await fetch(e,{signal:AbortSignal.timeout(4e3)});return t.ok?await t.json():{}}catch{return{}}}async function TU(){const[e,t,r,n,a,u]=await Promise.all([Yi(Tt.asrModelInfo),Yi(Tt.asrPerformance),Yi(Tt.ttsModelInfo),Yi(Tt.ttsPerformance),Yi(Tt.ragModelInfo),Yi(Tt.ragPerformance)]),l=(c,f)=>({...c,perf:f.latency??{}});return{asr:l(e,t),rag:l(a,u),tts:l(r,n)}}const kU=()=>({asr:{},rag:{},tts:{}});function CU(){const e=W.useRef(!1),[t,r]=W.useState(()=>kU()),[n,a]=W.useState(!1),u=W.useCallback(()=>{e.current&&(a(!0),TU().then(l=>{e.current&&r(l)}).catch(()=>{}).finally(()=>{e.current&&a(!1)}))},[]);return W.useEffect(()=>(e.current=!0,u(),()=>{e.current=!1}),[u]),{kpis:t,loading:n,refresh:u}}const MU={analyzer_url:"http://audio-analyzer:8010/v1/audio/transcriptions",rag_url:"http://rag-service:8020/api/v1/query",tts_url:"http://text-to-speech:8011/v1/audio/speech"};async function NU(e,t){const r=await fetch(Tt.startStream,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sample_rate:e,chunk_seconds:Yr.chunkSeconds,silence_timeout_seconds:2,max_session_seconds:60,silence_threshold:900,language:"en",temperature:0,tts_model:"speecht5",tts_language:"English",history:t,...MU})});if(!r.ok)throw new Error(`Failed to start session: ${r.status} ${r.statusText}`);return r.json()}async function IU(e,t){const r=await fetch(Tt.pushAudio(e),{method:"POST",headers:{"Content-Type":"audio/wav"},body:t});if(!r.ok)throw new Error(`Failed to push audio: ${r.status}`)}async function $U(e){const t=await fetch(Tt.endAudio(e),{method:"POST"});if(!t.ok)throw new Error(`Failed to end stream: ${t.status}`)}async function RU(e){const t=await fetch(Tt.pollSession(e));if(!t.ok)throw new Error(`Failed to poll session: ${t.status}`);return t.json()}function DU(e,t){const r=t.split("/").pop()??"";return Tt.sessionAudioFile(e,r)}function LU(e){let t=0;for(const a of e)t+=a.length;const r=new Float32Array(t);let n=0;for(const a of e)r.set(a,n),n+=a.length;return r}function BU(e,t,r){if(t===r||e.length===0)return e;const n=t/r,a=Math.floor(e.length/n),u=new Float32Array(a);for(let l=0;l(l.current||(l.current=new Audio,l.current.preload="auto"),l.current),[]),h=W.useCallback(()=>{var E,j,T,_;const S=n.current.shift();if(!S){u.current=!1,r("idle"),c.current&&(c.current=!1,(j=(E=f.current)==null?void 0:E.onAllDone)==null||j.call(E));return}u.current=!0,r("playing");const w=d();w.src=S,c.current||(c.current=!0,(_=(T=f.current)==null?void 0:T.onFirstPlay)==null||_.call(T));const b=()=>{w.removeEventListener("ended",b),w.removeEventListener("error",P),h()},P=()=>{w.removeEventListener("ended",b),w.removeEventListener("error",P),h()};w.addEventListener("ended",b),w.addEventListener("error",P),w.play().catch(()=>{w.removeEventListener("ended",b),w.removeEventListener("error",P),h()})},[d]),v=W.useCallback(S=>{let w=!1;for(const b of S)!b||a.current.has(b)||(a.current.add(b),n.current.push(b),w=!0);w&&!u.current&&(r("queued"),h())},[h]),m=W.useCallback(()=>{n.current=[],a.current=new Set},[]),x=W.useCallback(()=>{n.current=[],l.current&&(l.current.pause(),l.current.src=""),u.current=!1,c.current=!1,r("idle")},[]);return W.useEffect(()=>()=>{l.current&&(l.current.pause(),l.current.src="")},[]),{state:t,enqueue:v,reset:m,stop:x}}const Ry=Yr.sampleRate;function UU({deviceId:e,enabled:t,onTurnComplete:r}){const[n,a]=W.useState("idle"),[u,l]=W.useState([]),[c,f]=W.useState(""),[d,h]=W.useState(""),[v,m]=W.useState("Tap the mic and ask a question"),[x,S]=W.useState(null),w=FU({onAllDone:()=>{r==null||r()}}),b=W.useRef(null),P=W.useRef(null),E=W.useRef(null),j=W.useRef(null),T=W.useRef([]),_=W.useRef(48e3),O=W.useRef(null),k=W.useRef(!1),N=W.useRef(!1),$=W.useRef(null),X=W.useRef([]);X.current=u;const q=W.useCallback(()=>X.current.slice(-4).filter(K=>K.text.trim()).map(K=>({role:K.role,content:K.text})),[]),L=W.useCallback(async(F=!1)=>{const K=T.current;if(K.length===0)return;const I=K.reduce((we,Ee)=>we+Ee.length,0)/_.current;if(!F&&I{var F,K,G;k.current=!1;try{(F=E.current)==null||F.disconnect(),(K=j.current)==null||K.disconnect()}catch{}(G=P.current)==null||G.getTracks().forEach(I=>I.stop()),b.current&&b.current.state!=="closed"&&b.current.close().catch(()=>{}),E.current=null,j.current=null,P.current=null,b.current=null},[]),Y=W.useCallback(()=>{$.current!==null&&(window.clearTimeout($.current),$.current=null)},[]),Q=W.useCallback(async()=>{const F=O.current;if(!F)return;let K;try{K=await RU(F)}catch{$.current=window.setTimeout(Q,Yr.pollIntervalMs);return}const G=(K.transcript??"").trim(),I=(K.response??"").trim(),z=K.status==="running"||K.status==="stopping";G&&f(G),I&&h(I);const ne=K.tts_audio_segments??[];if(ne.length>0){const ce=ne.map(ve=>DU(F,String(ve.audio_file)));w.enqueue(ce)}if(N.current&&(ne.length?m(`🔊 Speaking… (${ne.length})`):m(I?"💬 Generating response…":G?"📝 Querying knowledge base…":"⏳ Processing speech…")),N.current&&!z){Y();const ce=G,ve=I;l(we=>{const Ee=[...we];return ce&&Ee.push({role:"user",text:ce}),ve&&Ee.push({role:"assistant",text:ve}),Ee}),f(""),h(""),O.current=null,N.current=!1,a("idle"),m("✓ Done — tap 🎤 for another question"),ne.length===0&&(r==null||r());return}$.current=window.setTimeout(Q,Yr.pollIntervalMs)},[w,r,Y]),J=W.useCallback(async()=>{var F;if(!t){m("⏳ Ingestion in progress — please wait…");return}if(!(k.current||n!=="idle")){S(null),w.reset(),T.current=[],N.current=!1,f("🎤 Listening…"),h(""),a("listening"),m("🎙 Listening — speak now");try{if(!((F=navigator.mediaDevices)!=null&&F.getUserMedia))throw new Error("Microphone access requires HTTPS or localhost.");const K={audio:e?{deviceId:{exact:e}}:!0},G=await navigator.mediaDevices.getUserMedia(K);P.current=G;const I=new AudioContext;b.current=I,_.current=I.sampleRate,await I.audioWorklet.addModule("/pcm-capture-processor.js");const z=I.createMediaStreamSource(G);j.current=z;const ne=new AudioWorkletNode(I,"pcm-capture-processor");E.current=ne,ne.port.onmessage=ve=>{k.current&&(T.current.push(ve.data),L(!1))},z.connect(ne),ne.connect(I.destination),k.current=!0;const{session_id:ce}=await NU(Ry,q());O.current=ce,Y(),$.current=window.setTimeout(Q,Yr.pollIntervalMs)}catch(K){H(),a("idle"),f("");const G=K instanceof Error?K.message:String(K);S(G),m(`❌ ${G}`)}}},[t,n,e,w,q,L,Q,Y,H]),te=W.useCallback(async()=>{if(!k.current)return;k.current=!1,a("processing"),m("⏳ Processing…"),f(K=>K==="🎤 Listening…"?"⏳ Processing…":K),await L(!0),H();const F=O.current;if(!F){a("idle"),m("No audio — try again"),f("");return}try{await $U(F),N.current=!0}catch(K){const G=K instanceof Error?K.message:String(K);S(G),m(`❌ ${G}`),a("idle");return}},[L,H]);return W.useEffect(()=>()=>{Y(),H(),w.stop()},[]),{phase:n,messages:u,partialUser:c,partialAssistant:d,statusText:v,error:x,playbackState:w.state,start:J,stop:te}}function WU(){const[e,t]=W.useState({}),[r,n]=W.useState(!0),a=W.useRef(!1),u=W.useRef(!1),l=W.useCallback(async()=>{if(!u.current){u.current=!0,a.current&&n(!0);try{const f=await fU();a.current&&t(f)}finally{u.current=!1,a.current&&n(!1)}}},[]);W.useEffect(()=>{a.current=!0,l();const f=window.setInterval(()=>{l()},Yr.perfRefreshMs);return()=>{a.current=!1,window.clearInterval(f)}},[l]);const c=W.useCallback(()=>{l()},[l]);return{metrics:e,loading:r,refresh:c}}function HU(){const{devices:e,selectedId:t,setSelectedId:r,error:n}=jU(),{kpis:a,refresh:u}=CU(),{metrics:l}=WU(),[c,f]=W.useState(!1),d=W.useCallback(()=>{u()},[u]),{phase:h,messages:v,partialUser:m,partialAssistant:x,statusText:S,playbackState:w,start:b,stop:P}=UU({deviceId:t,enabled:!c,onTurnComplete:d}),E=h==="listening"||h==="processing"||w!=="idle",{cpuPct:j,gpuPct:T,npuPct:_}=W.useMemo(()=>{const O=k=>k.length>0?k[k.length-1].value:null;return{cpuPct:O(ci(l.cpu_utilization)),gpuPct:O(ci(l.gpu_utilization)),npuPct:O(ci(l.npu_utilization))}},[l]);return C.jsxs("div",{className:"flex flex-col h-full bg-kiosk-pane font-text",children:[C.jsx(iC,{phase:h,cpuPct:j,gpuPct:T,npuPct:_}),C.jsx("main",{className:"flex-1 overflow-hidden",children:C.jsxs("div",{className:"h-full mx-auto px-4 py-4 grid gap-4",style:{maxWidth:"1600px",gridTemplateColumns:"1fr 420px"},children:[C.jsxs("section",{className:"flex flex-col bg-white rounded-xl border border-kiosk-border overflow-hidden min-h-0 shadow-sm",children:[C.jsx(lC,{messages:v,partialUser:m,partialAssistant:x,phase:h}),C.jsx("div",{className:"shrink-0 border-t border-kiosk-border bg-kiosk-pane/60 px-6 py-4",children:C.jsxs("div",{className:"flex flex-col items-center gap-3",children:[C.jsx(cC,{phase:h,playbackState:w}),C.jsx(sC,{phase:h,locked:c,onStart:b,onStop:P}),C.jsx("p",{className:"text-xs text-kiosk-textlo text-center min-h-[1rem] max-w-sm",children:S})]})})]}),C.jsx(_U,{kpis:a,metrics:l,phase:h,orderActive:E,devices:e,selectedDeviceId:t,onSelectDevice:r,micError:n,onIngestStateChange:f,onRefreshKpis:u})]})}),C.jsx(aC,{})]})}tC.createRoot(document.getElementById("root")).render(C.jsx(W.StrictMode,{children:C.jsx(HU,{})})); diff --git a/smart-kiosk-assistant/kiosk-ui/dist/assets/index-ZH1LMXpw.css b/smart-kiosk-assistant/kiosk-ui/dist/assets/index-ZH1LMXpw.css new file mode 100644 index 00000000..c9f5c056 --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/dist/assets/index-ZH1LMXpw.css @@ -0,0 +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:Roboto Mono,ui-monospace,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}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.-bottom-1{bottom:-.25rem}.-right-1{right:-.25rem}.-right-2{right:-.5rem}.-top-2{top:-.5rem}.bottom-0{bottom:0}.left-0{left:0}.left-1\/2{left:50%}.right-0{right:0}.top-0{top:0}.top-20{top:5rem}.z-10{z-index:10}.z-50{z-index:50}.z-\[100\]{z-index:100}.mx-auto{margin-left:auto;margin-right:auto}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-0\.5{margin-left:.125rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.block{display:block}.inline-block{display:inline-block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-video{aspect-ratio:16 / 9}.h-1\.5{height:.375rem}.h-12{height:3rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-\[150px\]{height:150px}.h-\[44px\]{height:44px}.h-\[90px\]{height:90px}.h-full{height:100%}.h-px{height:1px}.min-h-0{min-height:0px}.min-h-\[1rem\]{min-height:1rem}.min-h-\[360px\]{min-height:360px}.min-h-\[420px\]{min-height:420px}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\.5{width:.375rem}.w-12{width:3rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-2xl{max-width:42rem}.max-w-\[80\%\]{max-width:80%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.-translate-x-1\/2{--tw-translate-x: -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))}.-translate-y-2{--tw-translate-y: -.5rem;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))}.translate-y-0{--tw-translate-y: 0px;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-180{--tw-rotate: 180deg;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))}@keyframes kpi-glow{0%,to{box-shadow:0 0 #0071c500}50%{box-shadow:0 0 12px 2px #0071c559}}.animate-kpi-glow{animation:kpi-glow 2.5s ease-in-out infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.animate-spin-slow{animation:spin 2s linear infinite}@keyframes stage-pulse{0%,to{opacity:1;transform:scale(1)}50%{opacity:.7;transform:scale(1.04)}}.animate-stage-pulse{animation:stage-pulse 1.8s ease-in-out infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.cursor-wait{cursor:wait}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0{gap:0px}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.space-x-0\.5>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.125rem * var(--tw-space-x-reverse));margin-left:calc(.125rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.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-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * 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-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-100>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(243 244 246 / var(--tw-divide-opacity, 1))}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-bl-sm{border-bottom-left-radius:.125rem}.rounded-br-sm{border-bottom-right-radius:.125rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-t{border-top-width:1px}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-asr{--tw-border-opacity: 1;border-color:rgb(234 88 12 / var(--tw-border-opacity, 1))}.border-asr\/40{border-color:#ea580c66}.border-cpu-muted{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-current{border-color:currentColor}.border-gpu-muted{--tw-border-opacity: 1;border-color:rgb(134 239 172 / var(--tw-border-opacity, 1))}.border-gpu\/30{border-color:#16a34a4d}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-intel-blue{--tw-border-opacity: 1;border-color:rgb(0 113 197 / var(--tw-border-opacity, 1))}.border-intel-blue-dark{--tw-border-opacity: 1;border-color:rgb(0 90 158 / var(--tw-border-opacity, 1))}.border-intel-blue\/40{border-color:#0071c566}.border-kiosk-border{--tw-border-opacity: 1;border-color:rgb(200 216 234 / var(--tw-border-opacity, 1))}.border-llm{--tw-border-opacity: 1;border-color:rgb(8 145 178 / var(--tw-border-opacity, 1))}.border-llm\/40{border-color:#0891b266}.border-npu-muted{--tw-border-opacity: 1;border-color:rgb(192 132 252 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-ret{--tw-border-opacity: 1;border-color:rgb(202 138 4 / var(--tw-border-opacity, 1))}.border-ret\/30{border-color:#ca8a044d}.border-transparent{border-color:transparent}.border-tts{--tw-border-opacity: 1;border-color:rgb(219 39 119 / var(--tw-border-opacity, 1))}.border-tts\/40{border-color:#db277766}.border-t-transparent{border-top-color:transparent}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-500{--tw-bg-opacity: 1;background-color:rgb(245 158 11 / var(--tw-bg-opacity, 1))}.bg-asr-light{--tw-bg-opacity: 1;background-color:rgb(255 237 213 / var(--tw-bg-opacity, 1))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-blue-50\/50{background-color:#eff6ff80}.bg-blue-50\/60{background-color:#eff6ff99}.bg-cpu-light{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-gpu-light{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\/80{background-color:#f9fafbcc}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-intel-blue{--tw-bg-opacity: 1;background-color:rgb(0 113 197 / var(--tw-bg-opacity, 1))}.bg-intel-blue\/10{background-color:#0071c51a}.bg-kiosk-asst{--tw-bg-opacity: 1;background-color:rgb(235 242 250 / var(--tw-bg-opacity, 1))}.bg-kiosk-user{--tw-bg-opacity: 1;background-color:rgb(0 104 181 / var(--tw-bg-opacity, 1))}.bg-llm-light{--tw-bg-opacity: 1;background-color:rgb(207 250 254 / var(--tw-bg-opacity, 1))}.bg-npu-light{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-ret-light{--tw-bg-opacity: 1;background-color:rgb(254 249 195 / var(--tw-bg-opacity, 1))}.bg-tts-light{--tw-bg-opacity: 1;background-color:rgb(252 231 243 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/70{background-color:#ffffffb3}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.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}.pb-4{padding-bottom:1rem}.pt-1{padding-top:.25rem}.text-center{text-align:center}.text-right{text-align:right}.font-display{font-family:IntelOne Display,Inter,system-ui,sans-serif}.font-mono{font-family:Roboto Mono,ui-monospace,monospace}.font-text{font-family:IntelOne Text,Inter,system-ui,sans-serif}.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-6xl{font-size:3.75rem;line-height:1}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[9px\]{font-size:9px}.text-base{font-size:1rem;line-height:1.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-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-400{--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-asr{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-asr-dark{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-cpu{--tw-text-opacity: 1;color:rgb(0 113 197 / var(--tw-text-opacity, 1))}.text-cpu-dark{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-gpu{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-gpu-dark{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-green-400{--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-intel-blue{--tw-text-opacity: 1;color:rgb(0 113 197 / var(--tw-text-opacity, 1))}.text-intel-dark{--tw-text-opacity: 1;color:rgb(43 44 48 / var(--tw-text-opacity, 1))}.text-intel-gray{--tw-text-opacity: 1;color:rgb(106 109 117 / var(--tw-text-opacity, 1))}.text-kiosk-textlo{--tw-text-opacity: 1;color:rgb(143 160 174 / var(--tw-text-opacity, 1))}.text-kiosk-textmd{--tw-text-opacity: 1;color:rgb(74 96 112 / var(--tw-text-opacity, 1))}.text-llm{--tw-text-opacity: 1;color:rgb(8 145 178 / var(--tw-text-opacity, 1))}.text-llm-dark{--tw-text-opacity: 1;color:rgb(14 116 144 / var(--tw-text-opacity, 1))}.text-npu-dark{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-red-400{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-ret{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.text-ret-dark{--tw-text-opacity: 1;color:rgb(161 98 7 / var(--tw-text-opacity, 1))}.text-tts{--tw-text-opacity: 1;color:rgb(219 39 119 / var(--tw-text-opacity, 1))}.text-tts-dark{--tw-text-opacity: 1;color:rgb(190 24 93 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-white\/50{color:#ffffff80}.underline{text-decoration-line:underline}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.shadow-\[0_-2px_8px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow: 0 -2px 8px rgba(0,0,0,.04);--tw-shadow-colored: 0 -2px 8px 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-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-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px 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-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 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-asr\/30{--tw-shadow-color: rgb(234 88 12 / .3);--tw-shadow: var(--tw-shadow-colored)}.shadow-tts\/30{--tw-shadow-color: rgb(219 39 119 / .3);--tw-shadow: var(--tw-shadow-colored)}.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}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}html,body,#root{height:100%;margin:0}.dash-scroll::-webkit-scrollbar{width:4px}.dash-scroll::-webkit-scrollbar-track{background:transparent}.dash-scroll::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:2px}.dash-scroll::-webkit-scrollbar-thumb:hover{background:#94a3b8}@keyframes dash-flow{0%{stroke-dashoffset:12}to{stroke-dashoffset:0}}@keyframes stage-glow-pulse{0%,to{opacity:1}50%{opacity:.65}}@keyframes kpi-glow{0%{box-shadow:0 0 #0071c500}40%{box-shadow:0 0 14px 3px #0071c54d}to{box-shadow:0 0 #0071c500}}.animate-kpi-glow{animation:kpi-glow 1.2s ease-out}@keyframes number-tick{0%{opacity:0;transform:translateY(-5px)}to{opacity:1;transform:translateY(0)}}@keyframes stage-pulse{0%,to{transform:scale(1);opacity:1}50%{transform:scale(1.04);opacity:.8}}.animate-stage-pulse{animation:stage-pulse 1.6s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin-slow{animation:spin 1.8s linear infinite}@keyframes messageSlideIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.kiosk-message-fade-in{animation:messageSlideIn .3s ease-out}@keyframes kiosk-blink{0%,49%{opacity:1}50%,to{opacity:0}}.kiosk-cursor{animation:kiosk-blink 1s steps(1) infinite}@keyframes typingDot{0%,60%,to{transform:translateY(0);opacity:.6}30%{transform:translateY(-8px);opacity:1}}.kiosk-typing-dot{display:inline-block;width:6px;height:6px;margin:0 2px;background-color:#64748b;border-radius:50%;animation:typingDot 1.4s ease-in-out infinite}@keyframes kiosk-bar{0%,to{transform:scaleY(.35)}50%{transform:scaleY(1)}}.kiosk-bar{transform-origin:bottom;animation:kiosk-bar .9s ease-in-out infinite}.kiosk-bar:nth-child(2){animation-delay:.15s}.kiosk-bar:nth-child(3){animation-delay:.3s}.kiosk-bar:nth-child(4){animation-delay:.45s}@keyframes kiosk-pulse{0%{box-shadow:0 0 #0068b573;transform:scale(1)}50%{box-shadow:0 0 0 12px #0068b500;transform:scale(1.05)}to{box-shadow:0 0 #0068b500;transform:scale(1)}}@keyframes kiosk-pulse-red{0%{box-shadow:0 0 #ef444473;transform:scale(1)}50%{box-shadow:0 0 0 12px #ef444400;transform:scale(1.05)}to{box-shadow:0 0 #ef444400;transform:scale(1)}}.kiosk-pulse-recording{animation:kiosk-pulse-red 1.5s infinite}@keyframes bounce-slow{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}.animate-bounce-slow{animation:bounce-slow 2s ease-in-out infinite}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#94a3b8}*{scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;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))}.hover\:border-intel-blue:hover{--tw-border-opacity: 1;border-color:rgb(0 113 197 / var(--tw-border-opacity, 1))}.hover\:border-intel-blue\/50:hover{border-color:#0071c580}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-intel-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(0 90 158 / var(--tw-bg-opacity, 1))}.hover\:bg-kiosk-pane:hover{--tw-bg-opacity: 1;background-color:rgb(244 247 251 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-intel-blue:hover{--tw-text-opacity: 1;color:rgb(0 113 197 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-4:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-amber-500\/30:focus{--tw-ring-color: rgb(245 158 11 / .3)}.focus\:ring-intel-blue:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(0 113 197 / var(--tw-ring-opacity, 1))}.focus\:ring-intel-blue\/30:focus{--tw-ring-color: rgb(0 113 197 / .3)}.focus\:ring-red-500\/30:focus{--tw-ring-color: rgb(239 68 68 / .3)}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;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))}.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\:block{display:block}.sm\:gap-3{gap:.75rem}.sm\:gap-4{gap:1rem}.sm\:p-10{padding:2.5rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-4{padding-top:1rem;padding-bottom:1rem}.sm\:text-base{font-size:1rem;line-height:1.5rem}}@media(min-width:1024px){.lg\:grid{display:grid}.lg\:h-full{height:100%}.lg\:min-h-0{min-height:0px}.lg\:gap-3{gap:.75rem}} diff --git a/smart-kiosk-assistant/kiosk-ui/dist/index.html b/smart-kiosk-assistant/kiosk-ui/dist/index.html index f2f9b1a7..c890f126 100644 --- a/smart-kiosk-assistant/kiosk-ui/dist/index.html +++ b/smart-kiosk-assistant/kiosk-ui/dist/index.html @@ -5,8 +5,8 @@ Kiosk Voice Assistant - - + +
diff --git a/smart-kiosk-assistant/kiosk-ui/src/api/identityApi.ts b/smart-kiosk-assistant/kiosk-ui/src/api/identityApi.ts new file mode 100644 index 00000000..5a37c3bd --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/src/api/identityApi.ts @@ -0,0 +1,67 @@ +import { endpoints } from '../constants'; +import type { + ChallengeResponse, + RegisterRequest, + RegisterResponse, + VerifyRequest, + VerifyResponse, +} from '../types'; + +/** + * Runtime capability probe — mirrors the backend's KIOSK_CORE_IDENTITY_ENABLED + * flag. This endpoint is always reachable (unlike the flag-gated identity + * router) so the UI can decide gate-vs-bypass without a rebuild. Any failure + * (network error, service down) is treated as "disabled" so the kiosk falls + * back to the existing chat behaviour rather than blocking the user. + */ +export async function fetchIdentityEnabled(): Promise { + try { + const res = await fetch(endpoints.identityEnabled, { signal: AbortSignal.timeout(4000) }); + if (!res.ok) return false; + const data: { enabled: boolean } = await res.json(); + return Boolean(data.enabled); + } catch { + return false; + } +} + +/** Fetch a random anti-replay voice challenge prompt for the user to read aloud. */ +export async function fetchChallenge(): Promise { + try { + const res = await fetch(endpoints.identityChallenge, { signal: AbortSignal.timeout(4000) }); + if (!res.ok) return null; + return await res.json(); + } catch { + return null; + } +} + +/** Verify a captured face frame + voice clip against enrolled loyalty profiles. */ +export async function verifyIdentity(request: VerifyRequest): Promise { + const res = await fetch(endpoints.identityVerify, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(request), + signal: AbortSignal.timeout(15000), + }); + if (!res.ok) { + const detail = await res.text().catch(() => ''); + throw new Error(`Verification request failed (${res.status}): ${detail}`); + } + return await res.json(); +} + +/** Self-service enrolment: register a new loyalty profile from face + voice. */ +export async function registerIdentity(request: RegisterRequest): Promise { + const res = await fetch(endpoints.identityRegister, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(request), + signal: AbortSignal.timeout(15000), + }); + if (!res.ok) { + const detail = await res.text().catch(() => ''); + throw new Error(`Registration request failed (${res.status}): ${detail}`); + } + return await res.json(); +} diff --git a/smart-kiosk-assistant/kiosk-ui/src/components/Auth/AuthGate.tsx b/smart-kiosk-assistant/kiosk-ui/src/components/Auth/AuthGate.tsx new file mode 100644 index 00000000..6f0ef908 --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/src/components/Auth/AuthGate.tsx @@ -0,0 +1,82 @@ +import { useCallback, useEffect, useState, type ReactNode } from 'react'; +import { fetchIdentityEnabled } from '../../api/identityApi'; +import { LoginScreen } from './LoginScreen'; +import { RegisterScreen } from './RegisterScreen'; +import { AuthSuccessToast } from './AuthSuccessToast'; +import type { LoyaltyProfile } from '../../types'; + +type GateStatus = 'checking' | 'bypass' | 'login' | 'register' | 'authenticated'; + +/** + * Wraps the existing kiosk chat home page with an optional biometric auth + * gate. The gate is driven entirely by the backend's runtime capability flag + * (`KIOSK_CORE_IDENTITY_ENABLED`, exposed at GET /api/v1/identity/enabled): + * - disabled/unreachable → bypass, render children exactly as before + * - enabled → require face+voice verification (or self-service + * registration) before rendering children + * This component only decides what to render; it never touches the existing + * chat/session/ordering logic, so kiosk behaviour is unchanged when the + * identity feature is off. + */ +export function AuthGate({ children }: { children: ReactNode }) { + const [status, setStatus] = useState('checking'); + const [profile, setProfile] = useState(null); + const [authedUserId, setAuthedUserId] = useState(null); + const [showSuccessToast, setShowSuccessToast] = useState(false); + + useEffect(() => { + let cancelled = false; + fetchIdentityEnabled().then((enabled) => { + if (cancelled) return; + setStatus(enabled ? 'login' : 'bypass'); + }); + return () => { + cancelled = true; + }; + }, []); + + const handleVerified = useCallback((p: LoyaltyProfile | null, userId: string) => { + setProfile(p); + setAuthedUserId(userId); + setStatus('authenticated'); + setShowSuccessToast(true); + }, []); + + const handleRegistered = useCallback(() => { + // Enrolment complete — return to sign-in so the user authenticates with + // the credentials they just registered (mirrors verify()'s own contract). + setStatus('login'); + }, []); + + if (status === 'checking') { + return ( +
+

Loading…

+
+ ); + } + + if (status === 'bypass' || status === 'authenticated') { + const displayName = profile?.name || authedUserId || 'Guest'; + return ( + <> + {children} + {showSuccessToast && ( + setShowSuccessToast(false)} /> + )} + + ); + } + + if (status === 'register') { + return ( + setStatus('login')} /> + ); + } + + return ( + setStatus('register')} /> + ); +} + +export default AuthGate; diff --git a/smart-kiosk-assistant/kiosk-ui/src/components/Auth/AuthSuccessToast.tsx b/smart-kiosk-assistant/kiosk-ui/src/components/Auth/AuthSuccessToast.tsx new file mode 100644 index 00000000..d861b3d9 --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/src/components/Auth/AuthSuccessToast.tsx @@ -0,0 +1,53 @@ +import { useEffect, useState } from 'react'; + +interface AuthSuccessToastProps { + name: string; + onDismiss: () => void; + durationMs?: number; +} + +/** + * Brief overlay toast confirming a successful biometric login, shown on top of + * the existing chat home page. Auto-dismisses after `durationMs`. + */ +export function AuthSuccessToast({ name, onDismiss, durationMs = 3000 }: AuthSuccessToastProps) { + const [visible, setVisible] = useState(true); + + useEffect(() => { + const hideTimer = window.setTimeout(() => setVisible(false), durationMs); + const dismissTimer = window.setTimeout(onDismiss, durationMs + 300); + return () => { + window.clearTimeout(hideTimer); + window.clearTimeout(dismissTimer); + }; + }, [durationMs, onDismiss]); + + return ( +
+
+
+ + + +
+
+

Successfully authenticated

+

Welcome, {name}!

+
+
+
+ ); +} + +export default AuthSuccessToast; diff --git a/smart-kiosk-assistant/kiosk-ui/src/components/Auth/LoginScreen.tsx b/smart-kiosk-assistant/kiosk-ui/src/components/Auth/LoginScreen.tsx new file mode 100644 index 00000000..cf59a5da --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/src/components/Auth/LoginScreen.tsx @@ -0,0 +1,140 @@ +import { useCallback, useEffect, useState } from 'react'; +import { useCamera } from '../../hooks/useCamera'; +import { useVoiceCapture } from '../../hooks/useVoiceCapture'; +import { fetchChallenge, verifyIdentity } from '../../api/identityApi'; +import type { LoyaltyProfile } from '../../types'; + +// Hard cap only — recording stops earlier once the sentence trails into +// silence (see useVoiceCapture's voice-activity detection). +const VOICE_CLIP_MAX_SECONDS = 6; + +interface LoginScreenProps { + onVerified: (profile: LoyaltyProfile | null, userId: string) => void; + onRegisterRequested: () => void; +} + +type LoginStatus = 'idle' | 'capturing' | 'verifying' | 'error'; + +/** + * Biometric login gate for the kiosk. Shows a live camera preview and an + * on-screen challenge phrase; on "Authenticate" it captures one face frame + * plus a short voice clip and posts both to /api/v1/identity/verify (proxied + * through kiosk-core). On success the caller is handed the resolved loyalty + * profile and redirected to the existing chat home page. + */ +export function LoginScreen({ onVerified, onRegisterRequested }: LoginScreenProps) { + const camera = useCamera(); + const voice = useVoiceCapture(); + const [status, setStatus] = useState('idle'); + const [prompt, setPrompt] = useState('Loading challenge phrase…'); + const [challengeId, setChallengeId] = useState(null); + const [errorMsg, setErrorMsg] = useState(null); + + const loadChallenge = useCallback(async () => { + const challenge = await fetchChallenge(); + if (challenge) { + setPrompt(challenge.prompt_text); + setChallengeId(challenge.challenge_id); + } else { + setPrompt('Please look at the camera and say your name.'); + setChallengeId(null); + } + }, []); + + useEffect(() => { + void camera.start(); + void loadChallenge(); + return () => camera.stop(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const handleAuthenticate = useCallback(async () => { + setErrorMsg(null); + setStatus('capturing'); + const image_base64 = camera.captureFrameBase64(); + if (!image_base64) { + setErrorMsg('Could not capture a camera frame. Please ensure your face is visible.'); + setStatus('error'); + return; + } + const audio_base64 = await voice.recordClip(VOICE_CLIP_MAX_SECONDS); + if (!audio_base64) { + setErrorMsg(voice.error ?? 'Could not capture audio.'); + setStatus('error'); + return; + } + setStatus('verifying'); + try { + const result = await verifyIdentity({ + challenge_id: challengeId, + image_base64, + audio_base64, + }); + if (result.verified && result.user_id) { + onVerified(result.profile ?? null, result.user_id); + } else { + setErrorMsg(result.reason ?? 'User not authenticated. Please try again or register.'); + setStatus('error'); + void loadChallenge(); + } + } catch (err) { + const msg = err instanceof Error ? err.message : String(err); + setErrorMsg(`User not authenticated: ${msg}`); + setStatus('error'); + } + }, [camera, voice, challengeId, onVerified, loadChallenge]); + + const busy = status === 'capturing' || status === 'verifying'; + + return ( +
+
+

Sign in to the kiosk

+

+ Look at the camera and read the phrase below aloud. +

+ +
+
+ +
+ Say aloud +

{prompt}

+
+ + {camera.error &&

{camera.error}

} + + {status === 'error' && errorMsg && ( +
+ {errorMsg} +
+ )} + + + + +
+
+ ); +} + +export default LoginScreen; diff --git a/smart-kiosk-assistant/kiosk-ui/src/components/Auth/RegisterScreen.tsx b/smart-kiosk-assistant/kiosk-ui/src/components/Auth/RegisterScreen.tsx new file mode 100644 index 00000000..7016dee0 --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/src/components/Auth/RegisterScreen.tsx @@ -0,0 +1,161 @@ +import { useCallback, useEffect, useState } from 'react'; +import { useCamera } from '../../hooks/useCamera'; +import { useVoiceCapture } from '../../hooks/useVoiceCapture'; +import { fetchChallenge, registerIdentity } from '../../api/identityApi'; + +// Hard cap only — recording stops earlier once the sentence trails into +// silence (see useVoiceCapture's voice-activity detection). +const VOICE_CLIP_MAX_SECONDS = 6; + +interface RegisterScreenProps { + onRegistered: (userId: string) => void; + onCancel: () => void; +} + +type RegisterStatus = 'idle' | 'capturing' | 'submitting' | 'error' | 'success'; + +/** Slugify a display name and append a short random suffix for uniqueness. */ +function generateUserId(name: string): string { + const slug = name + .trim() + .toLowerCase() + .replace(/[^a-z0-9]+/g, '-') + .replace(/(^-|-$)+/g, '') || 'guest'; + const suffix = Math.random().toString(36).slice(2, 7); + return `${slug}-${suffix}`; +} + +/** + * Self-service enrolment screen. Collects a display name, shows an on-screen + * challenge phrase, captures one face frame + a short voice clip, and posts + * both to /api/v1/identity/register (proxied through kiosk-core). This is a + * pure add-on to the existing bootstrap/video-file enrolment path used by + * identity-service — it reuses the same register() pipeline. + */ +export function RegisterScreen({ onRegistered, onCancel }: RegisterScreenProps) { + const camera = useCamera(); + const voice = useVoiceCapture(); + const [name, setName] = useState(''); + const [status, setStatus] = useState('idle'); + const [prompt, setPrompt] = useState('Loading challenge phrase…'); + const [errorMsg, setErrorMsg] = useState(null); + + const loadChallenge = useCallback(async () => { + const challenge = await fetchChallenge(); + setPrompt(challenge?.prompt_text ?? 'Please say your name clearly.'); + }, []); + + useEffect(() => { + void camera.start(); + void loadChallenge(); + return () => camera.stop(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + const handleRegister = useCallback(async () => { + setErrorMsg(null); + if (!name.trim()) { + setErrorMsg('Please enter your name first.'); + setStatus('error'); + return; + } + setStatus('capturing'); + const image_base64 = camera.captureFrameBase64(); + if (!image_base64) { + setErrorMsg('Could not capture a camera frame. Please ensure your face is visible.'); + setStatus('error'); + return; + } + const audio_base64 = await voice.recordClip(VOICE_CLIP_MAX_SECONDS); + if (!audio_base64) { + setErrorMsg(voice.error ?? 'Could not capture audio.'); + setStatus('error'); + return; + } + setStatus('submitting'); + const userId = generateUserId(name); + try { + const result = await registerIdentity({ + user_id: userId, + name: name.trim(), + image_base64, + audio_base64, + }); + if (result.registered) { + setStatus('success'); + onRegistered(result.user_id); + } else { + setErrorMsg(result.reason ?? 'Registration failed. Please try again.'); + setStatus('error'); + void loadChallenge(); + } + } catch (err) { + const msg = err instanceof Error ? err.message : String(err); + setErrorMsg(`Registration failed: ${msg}`); + setStatus('error'); + } + }, [camera, voice, name, onRegistered, loadChallenge]); + + const busy = status === 'capturing' || status === 'submitting'; + + return ( +
+
+

Register your face & voice

+

+ Enter your name, then read the phrase below aloud while looking at the camera. +

+ + setName(e.target.value)} + placeholder="Your name" + disabled={busy} + className="w-full max-w-lg rounded-lg border border-gray-300 px-4 py-3 text-base focus:outline-none focus:ring-2 focus:ring-intel-blue/30" + /> + +
+
+ +
+ Say aloud +

{prompt}

+
+ + {camera.error &&

{camera.error}

} + + {status === 'error' && errorMsg && ( +
+ {errorMsg} +
+ )} + + + + +
+
+ ); +} + +export default RegisterScreen; diff --git a/smart-kiosk-assistant/kiosk-ui/src/constants.ts b/smart-kiosk-assistant/kiosk-ui/src/constants.ts index 389fc0cd..3de2aac1 100644 --- a/smart-kiosk-assistant/kiosk-ui/src/constants.ts +++ b/smart-kiosk-assistant/kiosk-ui/src/constants.ts @@ -34,6 +34,11 @@ export const endpoints = { metrics: '/metrics-svc/metrics', // pipeline latency (kiosk-core) pipelineLatest: '/api/v1/pipeline/latest', + // identity (biometric auth, proxied to kiosk-core; feature-flag gated) + identityEnabled: '/api/v1/identity/enabled', + identityChallenge: '/api/v1/identity/challenge', + identityVerify: '/api/v1/identity/verify', + identityRegister: '/api/v1/identity/register', }; // Tuning constants (mirror kiosk_core config defaults). diff --git a/smart-kiosk-assistant/kiosk-ui/src/hooks/useCamera.ts b/smart-kiosk-assistant/kiosk-ui/src/hooks/useCamera.ts new file mode 100644 index 00000000..2eedb205 --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/src/hooks/useCamera.ts @@ -0,0 +1,75 @@ +import { useCallback, useEffect, useRef, useState } from 'react'; + +interface UseCameraResult { + videoRef: React.RefObject; + ready: boolean; + error: string | null; + start: () => Promise; + stop: () => void; + /** Grab the current video frame as a base64 JPEG (no `data:` prefix). */ + captureFrameBase64: () => string | null; +} + +/** + * Minimal camera-preview hook for the identity login/register screens. + * Mirrors the getUserMedia error-handling style of `useMicDevices`. Only + * requests video (audio is captured separately via `useVoiceCapture`). + */ +export function useCamera(): UseCameraResult { + const videoRef = useRef(null); + const streamRef = useRef(null); + const [ready, setReady] = useState(false); + const [error, setError] = useState(null); + + const start = useCallback(async () => { + setError(null); + setReady(false); + try { + if (!navigator.mediaDevices?.getUserMedia) { + throw new Error('Camera access requires HTTPS or localhost.'); + } + const stream = await navigator.mediaDevices.getUserMedia({ + video: { facingMode: 'user' }, + }); + streamRef.current = stream; + if (videoRef.current) { + videoRef.current.srcObject = stream; + await videoRef.current.play(); + } + setReady(true); + } catch (err) { + const msg = err instanceof Error ? err.message : String(err); + setError(`Unable to access the camera: ${msg}`); + setReady(false); + } + }, []); + + const stop = useCallback(() => { + streamRef.current?.getTracks().forEach((t) => t.stop()); + streamRef.current = null; + if (videoRef.current) videoRef.current.srcObject = null; + setReady(false); + }, []); + + const captureFrameBase64 = useCallback((): string | null => { + const video = videoRef.current; + if (!video || video.readyState < 2) return null; + const canvas = document.createElement('canvas'); + canvas.width = video.videoWidth; + canvas.height = video.videoHeight; + const ctx = canvas.getContext('2d'); + if (!ctx) return null; + ctx.drawImage(video, 0, 0, canvas.width, canvas.height); + const dataUrl = canvas.toDataURL('image/jpeg', 0.9); + const commaIdx = dataUrl.indexOf(','); + return commaIdx >= 0 ? dataUrl.slice(commaIdx + 1) : null; + }, []); + + // Always release the camera on unmount. + useEffect(() => { + return () => stop(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return { videoRef, ready, error, start, stop, captureFrameBase64 }; +} diff --git a/smart-kiosk-assistant/kiosk-ui/src/hooks/useVoiceCapture.ts b/smart-kiosk-assistant/kiosk-ui/src/hooks/useVoiceCapture.ts new file mode 100644 index 00000000..0c299e5a --- /dev/null +++ b/smart-kiosk-assistant/kiosk-ui/src/hooks/useVoiceCapture.ts @@ -0,0 +1,157 @@ +import { useCallback, useRef, useState } from 'react'; +import { tuning } from '../constants'; +import { concatFloat32, encodeWav, resampleLinear } from '../api/audioUtils'; + +const TARGET_RATE = tuning.sampleRate; // 16000 + +// Voice-activity heuristics: stop early once a full sentence has been +// spoken (sustained silence after detected speech), otherwise fall back to +// the hard `maxSeconds` cap so the capture never hangs indefinitely. +const SPEECH_RMS_THRESHOLD = 0.015; +const MIN_SPEECH_MS = 1200; +const TRAILING_SILENCE_MS = 1500; + +interface UseVoiceCaptureResult { + recording: boolean; + error: string | null; + /** + * Record a mono WAV clip and resolve to base64 (no `data:` prefix). + * Recording stops automatically once a sentence has been spoken + * (speech followed by ~1.5s of silence), or after `maxSeconds` elapses, + * whichever comes first. + */ + recordClip: (maxSeconds?: number) => Promise; +} + +/** + * Voice-activity-aware capture for the identity login/register challenge + * phrase. Reuses the same AudioWorklet PCM pipeline as `useVoiceSession` + * (`/pcm-capture-processor.js`) and the shared `audioUtils` WAV encoder, but + * captures a single clip instead of streaming chunks. Recording ends as soon + * as the spoken sentence trails off into silence, giving the ECAPA voice + * embedding a fuller, more consistent sample than a fixed short clip. + */ +export function useVoiceCapture(): UseVoiceCaptureResult { + const [recording, setRecording] = useState(false); + const [error, setError] = useState(null); + const stopRef = useRef<(() => void) | null>(null); + + const recordClip = useCallback(async (maxSeconds: number = 5): Promise => { + setError(null); + setRecording(true); + + let stream: MediaStream | null = null; + let ctx: AudioContext | null = null; + let worklet: AudioWorkletNode | null = null; + let source: MediaStreamAudioSourceNode | null = null; + const frames: Float32Array[] = []; + + const teardown = () => { + try { + worklet?.disconnect(); + source?.disconnect(); + } catch { + /* ignore */ + } + stream?.getTracks().forEach((t) => t.stop()); + if (ctx && ctx.state !== 'closed') ctx.close().catch(() => undefined); + }; + stopRef.current = teardown; + + try { + if (!navigator.mediaDevices?.getUserMedia) { + throw new Error('Microphone access requires HTTPS or localhost.'); + } + stream = await navigator.mediaDevices.getUserMedia({ audio: true }); + ctx = new AudioContext(); + await ctx.audioWorklet.addModule('/pcm-capture-processor.js'); + + source = ctx.createMediaStreamSource(stream); + worklet = new AudioWorkletNode(ctx, 'pcm-capture-processor'); + + let speechStarted = false; + let speechStartMs: number | null = null; + let silenceStartMs: number | null = null; + let resolveEarlyStop: (() => void) | null = null; + const earlyStop = new Promise((resolve) => { + resolveEarlyStop = resolve; + }); + + // Track the sample-offset range that actually contains speech so the + // trailing/leading silence (including the ~1.5s of silence used just + // to *detect* the sentence has ended) can be trimmed before encoding — + // otherwise it dilutes the voice embedding with non-speech samples. + let samplesSeen = 0; + let speechStartSample: number | null = null; + let lastSpeechEndSample = 0; + + worklet.port.onmessage = (ev: MessageEvent) => { + const chunk = ev.data; + frames.push(chunk); + + let sumSq = 0; + for (let i = 0; i < chunk.length; i++) sumSq += chunk[i] * chunk[i]; + const rms = Math.sqrt(sumSq / chunk.length); + const now = performance.now(); + + if (rms >= SPEECH_RMS_THRESHOLD) { + if (!speechStarted) { + speechStarted = true; + speechStartMs = now; + speechStartSample = samplesSeen; + } + silenceStartMs = null; + lastSpeechEndSample = samplesSeen + chunk.length; + } else if (speechStarted) { + if (silenceStartMs === null) { + silenceStartMs = now; + } else if ( + now - silenceStartMs >= TRAILING_SILENCE_MS && + now - (speechStartMs ?? now) >= MIN_SPEECH_MS + ) { + resolveEarlyStop?.(); + } + } + samplesSeen += chunk.length; + }; + source.connect(worklet); + worklet.connect(ctx.destination); + + const ctxRate = ctx.sampleRate; + const hardCap = new Promise((resolve) => setTimeout(resolve, maxSeconds * 1000)); + await Promise.race([earlyStop, hardCap]); + + teardown(); + let merged = concatFloat32(frames); + + // Trim leading/trailing silence, keeping a small padding margin around + // the detected speech so words aren't clipped. + if (speechStartSample !== null) { + const padSamples = Math.round(ctxRate * 0.2); // 200ms pre/post-roll + const start = Math.max(0, speechStartSample - padSamples); + const end = Math.min(merged.length, lastSpeechEndSample + padSamples); + if (end > start) { + merged = merged.slice(start, end); + } + } + + const resampled = resampleLinear(merged, ctxRate, TARGET_RATE); + const wav = encodeWav(resampled, TARGET_RATE); + const buf = await wav.arrayBuffer(); + let binary = ''; + const bytes = new Uint8Array(buf); + for (let i = 0; i < bytes.length; i++) binary += String.fromCharCode(bytes[i]); + return btoa(binary); + } catch (err) { + teardown(); + const msg = err instanceof Error ? err.message : String(err); + setError(`Unable to capture audio: ${msg}`); + return null; + } finally { + setRecording(false); + stopRef.current = null; + } + }, []); + + return { recording, error, recordClip }; +} diff --git a/smart-kiosk-assistant/kiosk-ui/src/main.tsx b/smart-kiosk-assistant/kiosk-ui/src/main.tsx index dfacde09..ce5e8952 100644 --- a/smart-kiosk-assistant/kiosk-ui/src/main.tsx +++ b/smart-kiosk-assistant/kiosk-ui/src/main.tsx @@ -1,10 +1,13 @@ import { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import App from './App'; +import { AuthGate } from './components/Auth/AuthGate'; import './index.css'; createRoot(document.getElementById('root')!).render( - + + + , ); diff --git a/smart-kiosk-assistant/kiosk-ui/src/types.ts b/smart-kiosk-assistant/kiosk-ui/src/types.ts index a94d03a5..46cacc0f 100644 --- a/smart-kiosk-assistant/kiosk-ui/src/types.ts +++ b/smart-kiosk-assistant/kiosk-ui/src/types.ts @@ -184,3 +184,54 @@ export interface HardwareSnapshot { npuPct: number; memPct: number; } + +// ── Identity (biometric auth) ─────────────────────────────────────────────── +export interface LoyaltyProfile { + user_id: string; + name: string; + favorites: string[]; + restrictions: string[]; +} + +export interface ChallengeResponse { + challenge_id: string; + prompt_text: string; +} + +export interface VerifyRequest { + challenge_id?: string | null; + image_base64: string; + audio_base64: string; +} + +export interface VerifyResponse { + verified: boolean; + user_id?: string | null; + profile?: LoyaltyProfile | null; + face_similarity?: number | null; + voice_similarity?: number | null; + fused_score?: number | null; + reason?: string | null; +} + +export interface RegisterRequest { + user_id: string; + name: string; + favorites?: string[]; + restrictions?: string[]; + image_base64?: string | null; + audio_base64?: string | null; +} + +export interface RegisterResponse { + user_id: string; + registered: boolean; + face_faiss_id?: number | null; + voice_faiss_id?: number | null; + reason?: string | null; +} + +export interface IdentityEnabledResponse { + enabled: boolean; +} + diff --git a/smart-kiosk-assistant/kiosk-ui/tsconfig.tsbuildinfo b/smart-kiosk-assistant/kiosk-ui/tsconfig.tsbuildinfo deleted file mode 100644 index bb729fe9..00000000 --- a/smart-kiosk-assistant/kiosk-ui/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"root":["./src/App.tsx","./src/constants.ts","./src/main.tsx","./src/types.ts","./src/vite-env.d.ts","./src/api/audioUtils.ts","./src/api/kioskApi.ts","./src/api/metricsApi.ts","./src/api/orderingApi.ts","./src/api/ragApi.ts","./src/api/ttsApi.ts","./src/components/Chat/AssistantIndicator.tsx","./src/components/Chat/ChatPane.tsx","./src/components/Chat/Message.tsx","./src/components/Chat/MicButton.tsx","./src/components/Chat/TypingIndicator.tsx","./src/components/Chat/WelcomeScreen.tsx","./src/components/Dashboard/ExecutiveKpis.tsx","./src/components/Dashboard/HardwareCharts.tsx","./src/components/Dashboard/PerformanceDashboard.tsx","./src/components/Dashboard/PipelineFlow.tsx","./src/components/Footer/Footer.tsx","./src/components/Header/Header.tsx","./src/components/Order/OrderPanel.tsx","./src/components/Panels/DeviceSettings.tsx","./src/components/Panels/KnowledgeBase.tsx","./src/components/Panels/ModelKpis.tsx","./src/components/Panels/Performance.tsx","./src/components/common/Accordion.tsx","./src/hooks/useAudioQueue.ts","./src/hooks/useKpis.ts","./src/hooks/useMetrics.ts","./src/hooks/useMicDevices.ts","./src/hooks/useVoiceSession.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/smart-kiosk-assistant/kiosk_core/audio_session.py b/smart-kiosk-assistant/kiosk_core/audio_session.py index 1564a365..42349305 100644 --- a/smart-kiosk-assistant/kiosk_core/audio_session.py +++ b/smart-kiosk-assistant/kiosk_core/audio_session.py @@ -308,7 +308,7 @@ def _stream_rag_response(self, transcript: str) -> None: token_source = self.agent_client.get_reply( transcription=transcript, session_id=self.agent_session_id, # persistent across voice turns - user_id=getattr(self.request, "user_id", None) or "kiosk-user", + user_id=getattr(self.request, "user_id", None) or config.DEFAULT_ORDERING_USER_ID, history=history, ) label = "Agent" diff --git a/smart-kiosk-assistant/kiosk_core/config.py b/smart-kiosk-assistant/kiosk_core/config.py index c9ac01af..3b43ae06 100644 --- a/smart-kiosk-assistant/kiosk_core/config.py +++ b/smart-kiosk-assistant/kiosk_core/config.py @@ -46,6 +46,10 @@ # and keep the legacy RAG-only Q&A flow. ORDERING_ENABLED = os.getenv("KIOSK_CORE_ORDERING_ENABLED", "true").lower() not in ("false", "0", "no") +# Single shared kiosk identity used for ordering when no per-user login is +# wired into the request (this kiosk currently serves one customer at a time). +DEFAULT_ORDERING_USER_ID = os.getenv("KIOSK_CORE_DEFAULT_USER_ID", "kiosk-user") + # RAG-service agent chat endpoint (for ordering turns). DEFAULT_AGENT_URL = os.getenv( "KIOSK_CORE_AGENT_URL", diff --git a/smart-kiosk-assistant/kiosk_core/identity/api.py b/smart-kiosk-assistant/kiosk_core/identity/api.py index 131f4e64..291f7113 100644 --- a/smart-kiosk-assistant/kiosk_core/identity/api.py +++ b/smart-kiosk-assistant/kiosk_core/identity/api.py @@ -19,6 +19,8 @@ from kiosk_core.identity.client import IdentityClient from kiosk_core.identity.models import ( ChallengeResponse, + RegisterRequest, + RegisterResponse, VerifyRequest, VerifyResponse, ) @@ -70,3 +72,26 @@ async def verify(request: VerifyRequest, client: ClientDep) -> VerifyResponse: except httpx.HTTPError as exc: logger.error("[IDENTITY-API] verify upstream error: %s", exc) raise HTTPException(status_code=502, detail=f"identity-service unavailable: {exc}") from exc + + +@router.post( + "/register", + response_model=RegisterResponse, + summary="Self-service enrolment (face + voice captured from kiosk-ui)", +) +async def register(request: RegisterRequest, client: ClientDep) -> RegisterResponse: + """Forward a UI-driven registration (name + face + voice) to identity-service. + + Both modalities are required here (unlike the admin/bootstrap contract) since + the kiosk-ui registration flow always captures face and voice together. + """ + if not request.image_base64 or not request.audio_base64: + raise HTTPException( + status_code=422, + detail="Both image_base64 and audio_base64 are required for registration.", + ) + try: + return await client.register(request) + except httpx.HTTPError as exc: + logger.error("[IDENTITY-API] register upstream error: %s", exc) + raise HTTPException(status_code=502, detail=f"identity-service unavailable: {exc}") from exc diff --git a/smart-kiosk-assistant/kiosk_core/identity/client.py b/smart-kiosk-assistant/kiosk_core/identity/client.py index 745d7bce..0a10202a 100644 --- a/smart-kiosk-assistant/kiosk_core/identity/client.py +++ b/smart-kiosk-assistant/kiosk_core/identity/client.py @@ -14,6 +14,8 @@ from kiosk_core import config from kiosk_core.identity.models import ( ChallengeResponse, + RegisterRequest, + RegisterResponse, VerifyRequest, VerifyResponse, ) @@ -44,6 +46,14 @@ async def verify(self, request: VerifyRequest) -> VerifyResponse: response.raise_for_status() return VerifyResponse.model_validate(response.json()) + async def register(self, request: RegisterRequest) -> RegisterResponse: + """Self-service enrolment: forwards face+voice capture to identity-service.""" + url = f"{self.base_url}/api/v1/identity/register" + async with httpx.AsyncClient(timeout=self.timeout_seconds, trust_env=False) as client: + response = await client.post(url, json=request.model_dump()) + response.raise_for_status() + return RegisterResponse.model_validate(response.json()) + async def health(self) -> bool: """Liveness probe — returns True when identity-service responds 200.""" url = f"{self.base_url}/health" diff --git a/smart-kiosk-assistant/kiosk_core/identity/models.py b/smart-kiosk-assistant/kiosk_core/identity/models.py index 98dfa19d..385e948d 100644 --- a/smart-kiosk-assistant/kiosk_core/identity/models.py +++ b/smart-kiosk-assistant/kiosk_core/identity/models.py @@ -55,3 +55,41 @@ class VerifyResponse(BaseModel): default=None, description="Human-readable explanation when verified is false.", ) + + +class RegisterRequest(BaseModel): + """Self-service enrolment request (face + voice captured from the kiosk UI). + + At least one biometric is required by the upstream identity-service, but the + kiosk-ui registration flow always collects both face and voice. + """ + + user_id: str = Field(description="Auto-generated slug (name + random suffix).") + name: str + favorites: list[str] = Field(default_factory=list) + restrictions: list[str] = Field(default_factory=list) + image_base64: str | None = Field( + default=None, description="Base64-encoded camera frame." + ) + audio_base64: str | None = Field( + default=None, description="Base64-encoded WAV audio buffer." + ) + + +class RegisterResponse(BaseModel): + """Result of a self-service enrolment attempt.""" + + user_id: str + registered: bool + face_faiss_id: int | None = None + voice_faiss_id: int | None = None + reason: str | None = Field( + default=None, + description="Human-readable explanation when registered is false.", + ) + + +class IdentityStatusResponse(BaseModel): + """Runtime capability flag consumed by kiosk-ui to decide gate vs. bypass.""" + + enabled: bool diff --git a/smart-kiosk-assistant/kiosk_core/ordering/repository.py b/smart-kiosk-assistant/kiosk_core/ordering/repository.py index 7a9f57b1..c017ee0e 100644 --- a/smart-kiosk-assistant/kiosk_core/ordering/repository.py +++ b/smart-kiosk-assistant/kiosk_core/ordering/repository.py @@ -64,6 +64,10 @@ async def update_total(self, order_id: int) -> float: async def confirm(self, order_id: int) -> None: ... + @abstractmethod + async def delete_draft_orders(self, user_id: str) -> int: + ... + # --------------------------------------------------------------------------- # SQLite implementations @@ -223,3 +227,31 @@ async def confirm(self, order_id: int) -> None: (order_id,), ) logger.info("[ORDER-REPO] Confirmed order_id=%d", order_id) + + async def delete_draft_orders(self, user_id: str) -> int: + """Delete every still-open ('draft') order (and its items) for a user. + + Confirmed orders are left untouched — this only clears abandoned/stale + carts, e.g. when a fresh conversation starts. + """ + cursor = await self._db.execute( + "SELECT order_id FROM orders WHERE user_id = ? AND status = 'draft'", + (user_id,), + ) + rows = await cursor.fetchall() + order_ids = [r[0] for r in rows] + if not order_ids: + return 0 + + placeholders = ",".join("?" * len(order_ids)) + await self._db.execute( + f"DELETE FROM order_items WHERE order_id IN ({placeholders})", order_ids + ) + await self._db.execute( + f"DELETE FROM orders WHERE order_id IN ({placeholders})", order_ids + ) + logger.info( + "[ORDER-REPO] Cleared %d stale draft order(s) for user=%s: %s", + len(order_ids), user_id, order_ids, + ) + return len(order_ids) diff --git a/smart-kiosk-assistant/kiosk_core/ordering/service.py b/smart-kiosk-assistant/kiosk_core/ordering/service.py index f09b44e1..bfbb753a 100644 --- a/smart-kiosk-assistant/kiosk_core/ordering/service.py +++ b/smart-kiosk-assistant/kiosk_core/ordering/service.py @@ -206,6 +206,22 @@ async def update_order_items(self, order_id: int, items: list[OrderItemIn]) -> O updated = await self.get_order(order_id) return updated # type: ignore[return-value] + async def clear_draft_carts(self, user_id: str) -> int: + """Delete any stale (never-confirmed) draft orders for a user. + + Intended to be called when a brand-new conversation/session starts so + each session begins with an empty cart instead of resurfacing an + abandoned draft from a previous visit. + """ + async with get_db() as db: + repo = SqliteOrderRepository(db) + deleted = await repo.delete_draft_orders(user_id) + await db.commit() + + if deleted: + logger.info("[SERVICE] Cleared %d stale draft cart(s) for user=%s", deleted, user_id) + return deleted + async def confirm_order(self, order_id: int) -> Order: """Confirm a draft order → status becomes 'confirmed'.""" async with get_db() as db: diff --git a/smart-kiosk-assistant/main.py b/smart-kiosk-assistant/main.py index 0cabaa21..ddee1288 100644 --- a/smart-kiosk-assistant/main.py +++ b/smart-kiosk-assistant/main.py @@ -4,6 +4,7 @@ from pathlib import Path from fastapi import FastAPI, File, Form, HTTPException, Request, UploadFile +from fastapi.concurrency import run_in_threadpool from fastapi.responses import FileResponse from kiosk_core import config as cfg @@ -89,11 +90,43 @@ async def lifespan(app: FastAPI): app.include_router(identity_router) +async def _clear_stale_cart_for_new_session(history: list[dict[str, str]] | None = None) -> None: + """Clear any abandoned draft cart before a brand-new conversation starts. + + A "new session" (one microphone press) is not the same as a "new + conversation" — the kiosk-ui keeps reusing the same ``conversation_id`` + (and forwards prior turns via ``history``) across all voice turns of a + single customer visit so the agent retains cart/order state between + presses (see ``kiosk_core/models.py``). Only clear the draft cart when + ``history`` is empty, i.e. this really is the first turn of a fresh + conversation; otherwise this would wipe an in-progress cart on every turn. + + Best-effort: if ordering is disabled or the DB call fails for any reason, + log and continue — this must never block a new session from starting. + """ + if not cfg.ORDERING_ENABLED or history: + return + try: + from kiosk_core.ordering.api import get_ordering_service + + ordering_service = get_ordering_service() + await ordering_service.clear_draft_carts(cfg.DEFAULT_ORDERING_USER_ID) + except Exception: + logger.exception("[SESSION_START] Failed to clear stale draft cart — continuing anyway") + + @app.get("/health") def health() -> dict[str, str]: return {"status": "ok"} +@app.get("/api/v1/identity/enabled") +def identity_enabled() -> dict[str, bool]: + """Runtime capability flag — always reachable (unlike the gated identity + router) so kiosk-ui can decide gate-vs-bypass without a rebuild.""" + return {"enabled": cfg.IDENTITY_ENABLED} + + @app.get("/api/v1/pipeline/latest") def pipeline_latest() -> dict: """Return the most recent completed voice turn trace with per-stage latencies.""" @@ -129,10 +162,11 @@ def get_session(session_id: str) -> dict[str, object]: @app.post("/api/v1/sessions/start-stream") -def start_stream_session(request: SessionStartRequest) -> dict[str, object]: +async def start_stream_session(request: SessionStartRequest) -> dict[str, object]: """Open a browser streaming session. The caller then pushes audio chunks via POST /api/v1/sessions/{session_id}/audio and signals end-of-stream via POST /api/v1/sessions/{session_id}/audio/end.""" + await _clear_stale_cart_for_new_session(request.history) try: return service.start_stream_session(request) except ValueError as exc: @@ -167,7 +201,8 @@ def end_audio_stream(session_id: str) -> dict[str, str]: @app.post("/api/v1/sessions/start", response_model=None) -def start_session(request: SessionStartRequest) -> dict[str, object]: +async def start_session(request: SessionStartRequest) -> dict[str, object]: + await _clear_stale_cart_for_new_session(request.history) try: return service.start_session(request) except ValueError as exc: @@ -175,7 +210,7 @@ def start_session(request: SessionStartRequest) -> dict[str, object]: @app.post("/api/v1/sessions/start-file") -def start_file_session( +async def start_file_session( file: UploadFile = File(...), device: int | str | None = Form(None), sample_rate: int = Form(16000), @@ -212,8 +247,9 @@ def start_file_session( tts_instructions=tts_instructions, realtime_factor=realtime_factor, ) + await _clear_stale_cart_for_new_session(request.history) try: - return service.start_file_session(request, file) + return await run_in_threadpool(service.start_file_session, request, file) except ValueError as exc: raise HTTPException(status_code=409, detail=str(exc)) from exc